Auto Sequencing in column list

Hi,
I want to create a column with sequence.
My Scenario is
-India                            1
          01/02/1992         1.1
          02/04/2000          1.2
-America                      2
            05/08/2011      2.1
             02/02/2001      2.2

Hi,
You have to write event receiver to achieve this auto increment.
The following is the example code to increment the value by 1.  You can tweak the code the meet your requirements like condition based on country etc.
public override void ItemAdded(SPItemEventProperties properties)
SPWeb web = properties.OpenWeb();
bool allowUpdates = web.AllowUnsafeUpdates; //store original value
this.EventFiringEnabled = false;
try
web.AllowUnsafeUpdates = true;
/*get the current list*/
SPList list = web.Lists[properties.ListId];
var highestvalue = 0;
var objQuery = new SPQuery
Query ="<OrderBy><FieldRef Name='" + ColumnName
+"' Ascending='False' /></OrderBy><RowLimit>1</RowLimit>",
Folder = list.RootFolder
SPListItemCollection colItems = list.GetItems(objQuery);
if (colItems.Count > 0)
highestvalue = int.Parse(colItems[0][ColumnName].ToString());
var currItem = properties.ListItem;
currItem[ColumnName] = highestvalue + 1;
currItem.SystemUpdate(false);
catch (Exception ex)
Trace.WriteLine(ex.Message);
finally
this.EventFiringEnabled = true;
web.AllowUnsafeUpdates = allowUpdates; //restore original value
And also refer to the following article, if you are not going to use the event receiver.
Add a Unique Auto-Incrementing Column to a SharePoint List
Please mark it answered, if your problem resolved.

Similar Messages

  • Auto size of columns is not working after latest update of itunes 8.02

    columns will no longer auto resize correctly after the 8.02 update. the song title column hides song titles on request to resize very annoying please fix this Apple. any thoughts?

    SAME HERE!
    I just created a New List in my iTunes 8.0.2, and noticed the same Columns Width Issue, in List View and Cover Flow View:
    When I Controll-clicked on any Column, and chose Auto Size All Columns, it made the Name Column width more narrow then needed to display it's full content.
    I Controll-clicked on the Name Column, and chose Auto Size Column. It didn't make it wider to extend its width to the the width of the longest Name in that Playlist.
    I tried different Playlists, and another Library and it was the same issue!
    It did work in Music and Podcasts, but not in Videos and Audio Books. Unchecking Columns didn't help.
    Repairing Permissions, and Restarting iTunes and Restarting my Powerbook G4 didn't help either...
    I am sending this bug report to Apple
    http://www.apple.com/feedback/itunesapp.html
    and hope others will do also, if they encounter the same problem.
    And while at it, please join me in asking Apple to make Lyrics Field SEARCHABLE! What an underutilized opportunity that Lyrics Field is. I can store my notes in there, and have clickable web links, if they are in the same format as the one above, in this post. And while at it, make it Searchable on iPhones/iPods, or at least visible!
    Powerbook G4 17', 1.67, 10.4.11, 2GB RAM, all latest Software Updates

  • Import/Export wizard auto-generates all columns as DATE

    Hi
    I'm trying to use the Import/Export Wizard as I used to, as a handy tool to figure out what a series of T-SQL statements (in an SSIS package) is doing - or, if I'm lucky, what on earth the original dev
    intended them to do.
    Version: SQL 2014 64-bit running on Win 7 64-bit
    The code is pretty dreadful:
    SELECT DISTINCT on one set of column names,
    join this set to another table but not on exactly the same set of column names,
    embedded (SELECT MAX(bla) FROM SameTable WHERE [match to outer set on another set of columns] GROUP BY [hey, yet another set of columns!]) inside the SELECT column list...
    and it all goes to a nasty #Tmp, which is then abused with further bad code further down.
    Imp/Exp is always handy to quickly get the intermediate results into an auto-created real table, so I can figure out exactly what the effect of this is.  I use it to export from the database back to the same database, but to a persisted table.
    This time (first time with SQL2014) it's not working.  The source is "write a query" (paste the actual query).  The destination I set to a new table.  The auto-generation of the new table creates every column as type
    date.  Not surprisingly, this doesn't work, as the original data is mostly not of
    date time.
    Looks like a bug.  Any idea of a workaround or fix?
    thanks!

    Sorry, but I think you're still not getting what I'm saying.
    This is not a production SSIS package design, but a quick'n'nasty diagnosis technique I'm used to using:
    - Find some SQL in an existing query/script that I'm trying to debug
    - Paste it into Import/Export wizard as a source
    - Wizard creates a new table for the result - I then have the results persisted for examination, comparison with the results from refactored code, etc.
    And I can't even put suitable CAST/CONVERT statements in, because the wizard is mis-identifying the
    input column data types, with no way to change them.   It's somehow thinking that every column in the input (the SQL query) is of type
    date(500), when the columns are obviously not of this type.

  • Auto sequence ???

    hello all,
    from the browse form in uix , i am calling a new empty input form, how can i generate the auto-sequence number and assign it to the empid in the new form?? and the user can see but cannot edit it , its an oracle sequence using nexval or else.
    {urgent}
    zaibi.

    One way you could do it is to allow your database to assign the value to empid. If you were using an Oracle database you would use a "Before Insert Trigger" in combination with a "DB Sequence". Then in the Jdeveloper "Entity Object Editor" you would assign the type of your attribute "empid" to DBSequence. Also note the Tabs near the bottom of the editor. There is one for "Database Column" and one for "Sequence". These both need to be filled out as well and should be once you assign the type to DB Sequence. If their not, then for the Database Column the "name" and "type" are the actual name and type that you created in your database. The Sequence tab needs the name of the Sequence that you created in your database and usually starts at 1.
    One reason that you let the database assign the value to your id's and not the application is that you may have more than one application using that data, and in other cases the application technology may be different.
    BG...

  • Mail landscape view in ipad, cannot suppress the column listing

    I want to use landscape view To read email...but I cannot suppress the column listing my messages. In portrait that column is missing so I can see whole message.
    What do I do?

    There is nothing that you can do. That is a feature of landscape viewing of mail.
    Glor

  • How to extract information in cells of a mult-column list box?

    I have multi column list box. At run time this listbox allow me to select entire row (this is fine), how to extract the data from each cell along the selected row? It seems to me that the Multi column Listbox (MCL) is merely a 1D array (I guess index of this 1D array corresponds to row index of the MCL and value of the element corresponds to column index of MCL.)

    To extract cell values of the selected row, you can create a property node for the MCL. From this property node, choose "Item Names". This is a 2D array containing all cell values. Index this array with the MCL terminal. Note that you must choose the scalar data type for the MCL. To choose the scalar data type, right click on the MCL and go to "Selection Mode"->"Data Type"->"Scalar".
    See attachment written with LabVIEW 6.
    I hope it will help you.
    Attachments:
    MCL.vi ‏15 KB

  • How to create a 2 column list with bullets

    How can I create a 2 columned list with bullets? When I hit tab button, the whole word and bullet moves. I am trying to create a checklist with 2 columns with a visual bullet in front of specific list items. Thanks for any help! chris

    Why not just use 2 columns?
    Or if they need to stay in step, a table?
    Peter
    btw A tab in a list changes its level, option tab moves it to the next tab on the ruler. A silly choice to make it the opposite of common sense, but they followed the lead of MsWord on this one.

  • How to get the index of Mult column list box

    Hello all,
    I need small help. Please help me.
    Is there is any property to change the "Multi column list box" row index position dynamically?
    I want to change the index position at runtime like below.
    Munna
    Solved!
    Go to Solution.

    It's called Top Left Visible Cell. There aren't that many properties there.
    Try to take over the world!

  • Thumbnails in Column & List views

    My Finder (v10.4.5) mostly does NOT show the thumbnails of my JPGs in Column & List views, unless those JPGs were created on my computer (Tiger 10.4.6).
    I got it to finally show the thumbnails in Icon view (View > Show View Options > Show Icon Preview + All windows), but I also want to see the little thumbnails in Column and List Views. Anyone know how to do this.
    NOTE: those same JPGs that don't get the thumbnails on my MAC, do show thumbnails on my crappy-*** Windows ME Dell's Explorer.
    By the way, (different Question) is there a way I can set up to be notified via email when somebody replies to my question here in this discussion area?
    Thanks,
    Ted
    PowerBook G4   Mac OS X (10.4.6)   2 GB DDR SDRAM
    PowerBook G4   Mac OS X (10.4.6)   2 GB DDR SDRAM

    With a Finder window open in Column view, when you go to the View menu item and select Show View Options there are not any "Show Icons" or "Show preview column" selections for me to check.
    That is very very strange. Try opening a Finder window, have it in icon view, and the bring up Show View Options, I presume you are getting the options? Now go to View (don't close the options window!) and change to List. A different set of options should appear in the options window, and if you then change the view to Column what happens to the options window?
    If you want to see thumbnails for files that don't have them you either use Column view with a preview column set to display icons, or put the folder in Icon view. The Mac OS Finder does not create thumbnail.db files, as does Windows (I believe many Linux window managers create analogous files). Instead the Finder either reads the thumb from the resource fork of the file (most--maybe all--Mac graphics programs have always had the ability to create custom icons that are a part of the file), or else it will create a thumb "on the fly" for files that don't have them if told to do so in Icon and Column views. In List view it will display a small icon if the file has one, otherwise it just uses the generic icon. Windows is incapable of reading Mac resource forks, where the custom icon is for files created on a Mac, and the Finder is incapable of reading Windows thumbnail.db files. Any file you create on your Mac with a Mac graphics program will have a custom icon, if you set the preference of the program to save the file that way. This includes Image Capture, if you use it to transfer files from your camera. Images you get from a Windows or Linux box, or download from the Internet, do not have a resource fork and so do not have a custom icon.
    Francine
    Francine
    Schwieder

  • PHP MySQL 2 column list

    I am building at site in dreamweaver using PHP/MySQL.
    I have a page that will list a bunch of categories. I would
    like to have them in a two column list instead of one. It will look
    better as far as the design goes. How can I do this. I would like
    each column to be an equal amount as possible

    On 13 Mar 2007 in macromedia.dreamweaver.appdev,
    newhorizonhosting.com
    wrote:
    > I have a page that will list a bunch of categories. I
    would like to
    > have them in a two column list instead of one. It will
    look better
    > as far as the design goes. How can I do this. I would
    like each
    > column to be an equal amount as possible
    Have a look at Tom Muck's Horizontal Looper extension:
    http://www.tom-muck.com/extensions/help/HorizontalLooper/
    Joe Makowiec
    http://makowiec.net/
    Email:
    http://makowiec.net/email.php

  • Auto created FK columns in data modeler

    Newbie to sql data modeler and have this question.
    When created a relational model, it automatically generated many extra columns for Foreign Keys with notion of (1,2,..) Is there a setting to disable it. I like to have the generated DDL not to include these extra columns . Thanks.

    Hi,
    you can create foreign keys in two ways:
    1) using table dialog - no new FK columns are generated
    2) using "New FK Relation" tool - new FK columns are created automatically; However you can tune the process to your preferences:
    - "General Options>General" page - select "Show properties dialog on new object" - as result FK dialog will appear when new FK is created;
    - "General Options>Model>Relational" - select "Delete generated FK columns" - auto generated FK columns are here to help - you always have to define FK columns as part of FK definition (no functional FKs in current release) - you can replace these columns with existing columns and auto generated FK columns will be removed automatically (this cause only auto generated columns).
    At the end you can find that auto generated columns are not that bad.
    Philip

  • How can i Auto Size the Column width in RDLC Report

    Hi Friend's,
    I have created Windows application with RDLC Report. I am binding(Generating) dynamic columns and data's in RDLC Report Using Matrix control, I need to make Auto size of Column width for each Column in
    Matrix of RDLC report. So Can any one suggest me to make the Auto Size of Column Width in RDLC.
    Thanks in Advance,
    Mohan G

    Hi Mohan,
    In Reporting Services, the column width/height is hard-coded, hence, we cannot set the column width/height dynamically or based on an expression. So is the report size.
    In addition, since it is a RDLC report, we need a ReportViewer control to display this report within a custom application. If you need to change the size of the whole report, we can set the AsyncRendering property of the ReportViewer control to false, and
    set the SizeToReportContent property to true.
    Regards,
    Mike Yin
    TechNet Community Support

  • How do I undo auto sizing of columns in my music library?

    How do I undo the auto sizing of columns in my music library?

    Put your mouse pointer over the faint line dividing the columns and it will change to a cross with 2 arrowheads.
    Drag the column boundaries left or right as you desire.

  • Column missing in measure group columns list for dimension usage

    I added some new columns (dimension ids) to my fact table and refreshed the data source view. Now the new columns show up in the data source view for this fact table. But when I go to dimension usage to tie the new dimensions to this measure, I am not able
    to find the columns just added in the measure group columns list.
    What do I have to do to be able to see my new columns in this list so that I can update dimension usage.
    Thanks.

    Hi kvd123,
    According to your description, you add columns in fact table and the data source view is already refreshed. However, in dimension usage the meta data is not refreshed. Right?
    In this scenario, I suggest you redeploy your cube. Because in Analysis Services, when we modify the cube, the changes are recorded in xxxxx.cube XML file. After you redeploy the cube, those changes are copied to Analysis Services server. Then
    the source data will reload into the measure groups.
    If you have any question, please feel free to ask.
    Simon Hou
    TechNet Community Support

  • Lion's Finder settings for "always view in column/list mode" not working

    I set specific folders to "always view in column/list" mode using Command+J setting. After upgrading to Lion, Finder seems to always opens folders in the last view mode of the previous folder I open.

    Did you try right clicking in the folder area then select "Show view options" then check always show in List/Icon view? You can do this in individual folders as you please.

Maybe you are looking for

  • BAP_SALES_ORDER_CREATE_WITH_REFERENCE - Document flow

    Hi, I have a problem with the bapi for create sales order with reference, When the line items be created, the Update indicator for flow table(VBAP-UPFLU) be created whit the value 'X'(Create document flow records). If the sales order is manual, the v

  • App for Editing PDF documents

    I use PDF's in event planning and I was wondering what app is best to use to draw schematics over the PDF document and be able to email it out to all participants in the meeting at the conclusion.

  • Entity object control hints not propagating to ui component

    hi there, i have had no problem with entity object label control hints propagating to ui components... but it would appear that if i add the labe lcontrol hint after the view and ui component are in place then the control hint is not proagating to th

  • Script won't run on machine w/MAC OSX Server 10.4.9

    Why won't the following script work on a machine that is running MAC OSX Server 10.4.9. On Machines running Mac OS X 10.4.9 it works fine, but on my server machine it won't name the file as per the script--the menu dialog box pops ("save as") up aski

  • How can I better analyze my usage on HomeFusion?

    I understand all the factors that can aggregate data usage... uploading photos, automatic updates,,, all those things. Yet the only analysis tool I have with Home Fusion is a downloadable spreadsheet with snapshots of what Verizon is recording as tot