Add an auto incremental value to TITLE field.
Hi, i am currently working on a custom list in SharePoint 2010 and there is a title field. I would like to append an auto incremental variable to "Request" to make it look like:
Request 1
Request 2
Request 3
and so on...
As you can see below, i tried to use the calculated value Request+ID, but it didn't work out. So is there anyway to solve this problem?
<input name="ctl00$m$g_0bb0fcf5_65ea_4af9_ba76_7c0babad1a82$ctl00$ctl05$ctl00$ctl00$ctl00$ctl04$ctl00$ctl00$TextField"
type="text" value="[Request-]&[ID]"
maxlength="50" id="ctl00_m_g_0bb0fcf5_65ea_4af9_ba76_7c0babad1a82_ctl00_ctl05_ctl00_ctl00_ctl00_ctl04_ctl00_ctl00_TextField"
title="Title" class="ms-long ms-spellcheck-true" /><br />
Hi andylow,
You can also accomplish this without using a workflow but with a custom form on your list. To do this take the following steps:
Make sure that the title field of your list is not a required value
When you're in the list, click on the List tab in the ribbon
There select "Customize Form"
Your form will now open in InfoPath. In the right hand menu you will see all your data fields.
Make the Title number field "Read Only". To do this right click the field, select properties, click on the second tab and select Read Only
In the menu bar, click on Manage Rules
Now click the Data tab in the menu and select Sumit Options
In the menu that opens select the option to run rules before submit
Now there will be a button available in the menu for Submit Options, click on that
Now you can add rules and actions on the submit action
Create a new Action rule and call it Initial Save
As condition for the rule, set the condition that the Title field must be blank
The first action of the rule will be to Submit the form. When the form is submitted it will be assigned an ID, before that will be blank
Now add an Action to set a fields value.
Select the Title field as the field to set
You can set a hard coded value for the value to set but you can also click the function button, click on that
Now another window opens where you can add fields, functions etc.
Now first select the concat function from the function menu
Then double click the first link in the resulting function and type Request
Now double click the second link and select the ID field
Now get rid of the last remaining arguments in the concat function
Click OK until you're back in InfoPath
Now set one more action to submit the form again
Now ad a second rule and call that Edit
As condition for the rule, set the condition that the Title field must be not blank
Add the Submit Form action for this rule
Now you can publish your form with the Quick Publish button. This is a Blue circle with a white upward arrow and a lightning bolt next to the save button in the top menu bar.
Now when you add a new item and save it, the title will be set to Request&ID. When you edit the form no changes will be made.
Cheers,
Eduard Spelier
Similar Messages
-
LINQ: Update a column with auto increment value
Hi All,
Greetings.
I am very new to C# (though with lot of experience in VC++). Now a days, I am engaged in a C# project where I need to deal with ADO.NET DataTable and related classes. I am stuck up in a scenario as follows:
I have a data table (of DataTable type) pre-populated with many rows (50000+), parsed from a log file. Now I need to add a column that will be holding index number for each records; eg. 1, 2, 3......
I have tried to add the auto-incremented column dynamically, with seed = 0 and increment = 1, but it is not working.
Is there any LINQ query that I can run to update the DataTable at once? Or foreach loop per DataRow is the only option here?
I appreciate any quick suggestion on this.
Thanks in advance.
Sanjoy Jana.You should add the auto increment column to the DataTable before you pouplate it with the other data:
//1. Create a datatable
DataTable dt = new DataTable();
//2. add the autoincrement column:
DataColumn column = new DataColumn();
column.DataType = System.Type.GetType("System.Int32");
column.AutoIncrement = true;
column.AutoIncrementStep = 1;
column.AutoIncrementSeed = 1;
//3. Fill the dataTable using an SqlDataAdapter or whatever
dt.Columns.Add(new DataColumn("name"));
dt.Rows.Add("1");
dt.Rows.Add("2");
dt.Rows.Add("3");
dt.Rows.Add("4");
Then you don't have to add the "auto incremented" values yourself in some kind of a loop (using for example LINQ or foreach).
If you want to know how to poplulate the DataTable from a database query using an adapter, please refer to the following page:
http://www.dotnetperls.com/sqldataadapter
Hope that helps.
Please remember to mark helpful posts as answer to close your threads and then start a new thread if you have a new question. -
How to create auto increment value in my column using identity ?
hi Team,
I have an requirement where i create an auto increment value ,with my table column
Create table Temp(
DeptID int IDENTITY(1,1) PRIMARY KEY,
Name varchar(50),
Emailid nvarchar(50),
Phone varchar(50)
so this is my table structure ,Here my column name is
Deptid here i need to creat an autoincrement value with today's date like below
ex:STM0000120012015
STM0000221012015
STM0000322012015(Currentdate)
.......................................... like this
Here i need only one column like identity column with the given incremental order,not more than one column
so can u pls help me out any one.
Thanks!Here the output came like this ,
1 STM0000120150121
2 STM0000220150121
3 STM0000320150121
4 STM0000420150121
5 STM0000520150121
6 STM0000620150121
7 STM0000720150121
8 STM0000820150121
9 STM0000920150121
10 STM00001020150121 --see this exceed length
and here i dnt need to increment that Stm000010,Here my output will come like this, idnt need to increment my charcter size
1 STM0000120150121
2 STM0000220150121
3 STM0000320150121
4 STM0000420150121
5 STM0000520150121
6 STM0000620150121
7 STM0000720150121
8 STM0000820150121
9 STM0000920150121
10 STM0001020150121
11 STM0001120150121
12 STM0001220150121
so here i dont need to increment my charcter length(16)
The length should be STM(3char)+00001(5Charcters)+CurrentDateFormat,
see the above suggested o/p
so can u pls help me out Dimant -
Can i use an auto increment value in ldap entry?
For example i can insert, for each ldap entry, an id that is different from the previous one.
ThanksCan i use an auto increment value in ldap entry?
For example i can insert, for each ldap entry, an id
that is different from the previous one.
ThanksI don't think that there is a "built-in" way to do this, but I have seen several methods for doing this. One way is to use a primary/unique key from another system (i.e. an employee number from an HR database), another way is to create a GUID for each object prior to creating it in the Directory. You can muck around in the schema to set a attribute globally unique, if you want to avoid doing the lookup for an existing entry when you create a new one. -
How to get auto-increment value after insert on ACCESS db?
When you insert a new record to a table with an auto-incrementing key, how do you find the value for the row you just inserted? This works differently with different databases. I know how it's done on ORACLE and mySql.
How does it work with ACCESS through ODBC? How about MSSQL?I have discovered there's a LAST aggregate function which when I've tested it gets the just inserted auto-increment, but I'm not sure if it's reliable. You have to do:
SELECT LAST(index-field) FROM table
That ought to be faster than MAX, which I've noticed some people use. Persumable LAST will get the value from the last row in the table's natural order.
In fact an auto-increment field has no business filling in missing slots since the main point is a a foreign key in other tables and a foreign key pointing to a deleted table row ought to be invalidated, not point to some unrelated successor record.
I could use a separate table as a source of counters, of course, though that's one more call. In either case I'm worried about thread safety. In Oracle there are special sequence objects for this purpose which are incremented and read atomically. I'm not sure if the access driver transaction handling works adequately.
Perhaps the safest approach might be to use a separate sequencer table and Java sychronisation to serialise access to each row in the sequencer table (assuming all the access is from the same app). -
Update table column with same auto-increment value, via T-SQL stored procedure
Good Evening to every one,
I have a table 'Contracts' as we can see in the picture below (I exported my data on An Excel Spreadsheet). Table's primary key is 'ID' column.
I am trying to create a stored procedure (i.e. updContractNum), through which I am going to update the 'Contract_Num' column, in every row where the values on Property_Code, Customer, Cust_Category and Amnt ARE EQUAL, as we can see in the schema above.
The value of Contract_Num is a combination of varchar and auto_increment (integer). For example, the next value on 'Contract number' column will be 'CN0005' for the combination of 11032-14503-02-1450,00
I' m trying to use CURSORS for this update but I am new in using cursors and I am stuck in whole process. I atttach my code below:
CREATE PROCEDURE updContractNum
AS
--declare the variables
DECLARE @CONTRACT_NUM VARCHAR(10); -- Contract Number. The value that will be updated on the table.
DECLARE @CONTRACT INTEGER; -- Contract number, the auto increment section on contract number
DECLARE @CONTR_ROW VARCHAR(200); -- Contract row. The row elements that will be using on cursor
DECLARE CONTRACT_CURSOR CURSOR FOR -- Get the necessary fields from table
SELECT PROPERTY_CODE, CUSTOMER, CUST_CATEGORY, AMNT
FROM CONTRACTS;
OPEN CONTRACT_CURSOR -- open a cursor
FETCH NEXT FROM CONTRACT_CURSOR INTO @CONTR_ROW
WHILE @@FETCH_STATUS = 0 -- execute the update, for every row of the tabl
BEGIN
--update Contract_Num, using the format coding : contract_number = 'CN' + 0001
UPDATE CONTRACTS
SET CONTRACT_NUM = 'CN'+@CONTRACT_NUM+1
END
CLOSE CONTRACT_CURSOR
Thank you in advance!You dont need cursor
You can simply use an update statement like this
UPDATE t
SET Contract_Num = 'CN' + RIGHT('00000' + CAST(Rnk AS varchar(5)),5)
FROM
SELECT Contract_Num,
DENSE_RANK() OVER (ORDER BY Property_Code,Customer,Cust_category,Amnt) AS Rnk
FROM table
)t
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Increment value in a field but keeping it constant throughout the day
In a PRE-INSERT trigger on an application I have a problem
keeping the value in a field constant for the rest of the day
until the next day. The automatically generated number should
change only if the system date changes. How can i do this?.
The code is as below:
begin
update sequence_number
set maxseqno = maxseqno + 1
where table_name
= 'ECONET';
begin
select maxseqno into :two.seqno from sequence_number
where table_name = 'ECONET';
end;
begin
select ltrim(to_char(:two.seqno,'00000000000000000009'))
into :two.line_number from sequence_number
where table_name = 'ECONET';
end;
begin
select ltrim(to_char(:two.seqno,'00000000000000000009'))
into :two.unique_transfer_batch from sequence_number
where table_name = 'ECONET';
end;
end;The easist way is probably to store the date the sequence number
was last set, and then only increment the number if the date is
different.
If you just want a sequence number that changes once each a day,
an alternative might be to just calculate the number of days
since a particular date.
In oracle this would be something along the lines of
trunc(sysdate) - to_date('01-OCT-2001','DD-MON-YYYY') to give
the number of days since October 1st. -
How to auto increment values in an XSL
Hi all,
Is there any way to increment values in an XSL in the Jdeveloper.Hi David,
Check out implementing any of following BADIs.
ECRM_ISU_BPSEARCH
CRM_IC_BP_SEARCH
BUS_LOCA_HIDE_SEARCH
CRM_ORDERADM_SCENARI
CRM_ORDER_FIELDCHECK
Thanks,
Faisal -
Auto insert values to addition fields from a comma seperate value input?
I pray someone (Gunter :) ) knows how to do this or perhaps a better approach.
I have a google map api geocoding application that I created by following some sample files from the google api documentation. Works really well.
It gets the address information from an address field that has its values put in this format
"Street# Street, city, state/province" So... it would like like "123 fake ave, toronto, ON"
It is able to generate the longitude and latitude perfectly. How ever on the front end I would like the user to pull down show me based on just the city.
so.. show me "New york" or "Bowling green"... I was thinking of adding a city field into my table to facilitate this. It just seems redundant since the user already is going to put the address (which includes the cityname) above in the format I detailed. This is so the geocoding works.
So in the admin section when they add a new record is it possible to have some hidden fields that take the second comma seperated value (which would be the city)from the "address form field" (which is formatted with commas liek above) and input it into my "city column" in my table ?
any help of guidance is greatly appreciated, as alwaysHi Kevin,
PHP´s function "explode" (http://de2.php.net/explode) would allow you to split a comma separated string and echo the individual substrings wherever you want, however...
is it possible to have some hidden fields that take the second comma seperated value
...it seems you´d like to have the hidden fields "value" attribute dynamically updated based on the selected menu item, correct ? This will be much more complicated, as you´ll need some custom javascript to make this happen.
Cheers,
Günter Schenk
Adobe Community Expert, Dreamweaver -
Auto increment VALUE attribute extension
I was wondering if there was such an extension or a built in
tool for Dreamweaver that searches for all <INPUT> tags of
TYPE 'checkbox' and sets a unique value for the VALUE attribute.
Example:
I have 3 checkboxes as follows:
<INPUT ID="chkOption1" TYPE="checkbox" VALUE="checkbox"
/>
<INPUT ID="chkOption2" TYPE="checkbox" VALUE="checkbox"
/>
<INPUT ID="chkOption3" TYPE="checkbox" VALUE="checkbox"
/>
and I want the end result to change the VALUE attribute as
follows:
<INPUT ID="chkOption1" TYPE="checkbox" VALUE="1" />
<INPUT ID="chkOption2" TYPE="checkbox" VALUE="2" />
<INPUT ID="chkOption3" TYPE="checkbox" VALUE="3" />
Problem is that I have thousands of those checkboxes instead
of 3. So I was thinking maybe there is a value incrementing tool
available somewhere that someone might know of that parses through
all checkboxes or input tags.
I hope that explains it. Thanks in advance guys.I think I know what you are wanting. You want to find and
replace all the <input> tags or rather checkbox value. Well
the only simple way is to go to the edit menu in Dreamweaver 8 and
go down to: find and replace. Set it up so that is covers the
entire website not just the page you are working on. You will need
to put in the find box this code:
VALUE="checkbox" />
Then in the replace box:
VALUE="what ever value" />
maybe this will help, hope it does!
Want free Macromedia tutorials on Studio 8?
http://www.avelx.co.uk -
Attaching an Auto Incrementer to an existing table
Hi!
Have a few tables orders of records of which I need not to change and add an auto-increment sort of additional field to help in sort and manipulate the same. Any idea how to achieve the same???
Thanx in advance,
Best Regards, Faraz A QureshiIf you use SQL Server 2012 and onwards take a look ta SEQUENCE
http://msdn.microsoft.com/en-us/library/ff878091.aspx
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Incrementing Values to be mapped in a field
Hi All,
I have a requirement to map incremental values to a field in a Record based on repeations of the Record.
For Example:
Suppose I have a structure as below
Employee
- S.No
- Name
- ID
So here the S.No should be a incremental based on number of repeations of employee record which is in turn dependent on the source structure.
Output put should be like
<Employee>
<S.No> 1</S.No>
<Name>Kiran</Name>
<ID>1234</ID>
</Employee>
<Employee>
<S.No> 2</S.No>
<Name>Ram</Name>
<ID>1234</ID>
</Employee>
<Employee>
<S.No>32</S.No>
<Name>Alex</Name>
<ID>1234</ID>
</Employee>
Please give me some suggestionsHi,
Create one UDF for Sequence number generation and assign SNo to that UDF and output of that UDF to target SNO field.It will work.
int inc=1;
Integer seqno=(Integer) container.getParameter("seqno");
if(seqno==null)
seqno = new Integer(1);
else
int number=seqno.intValue()+inc;
seqno=new Integer(number);
container.setParameter("seqno",seqno);
return seqno.toString();
Edited by: murali krishna on Sep 2, 2008 3:06 PM -
Is it possible to auto increment a number in share point list ?
hello,
is it possible to generate an auto increment field in share point list?
for example, there are two fields [auto increment id] and [title]
lets say i create title as 'Steve' ; it will automate auto increment field with value 1
next , i insert title 'Paul' it ll populate the auto increment field with value 2.
thanks,
JayHi Jay,
You can use the Item Id field of the SharePoint list which will get incremented by 1 whenever you add the new item.
you can refer the below threads for other options of auto increment id
http://social.technet.microsoft.com/Forums/sharepoint/en-US/134fd5f6-17ce-4044-a78e-e7a32b523190/creating-autoincrement-field-in-sharepoint-list?forum=sharepointgeneralprevious
http://social.technet.microsoft.com/Forums/sharepoint/en-US/39743bb3-872d-4788-96a8-2b9fb8813011/create-auto-increment-value-in-sharepoint-column?forum=sharepointgeneralprevious
My Blog- http://www.sharepoint-journey.com| Twitter
If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful -
HSQL DB Identity & Auto Increment
We are trying to write records to this table:
create table location_groups
group_id identity
,jdoversion integer
,jdoclass varchar(255) default 'path.impl.LocationGroup' not null
,group_name varchar(100) not null
,group_parent_id integer
Package.jdo is:
<package name="path">
<class name="LocationComponent">
</class>
</package>
<package name="path.impl">
<class name="LocationGroup" persistence-capable-superclass="path.LocationComponent">
<!--<extension vendor-name="kodo" key="jdbc-field-map" value="one-one"/>-->
<extension vendor-name="kodo" key="jdbc-auto-increment" value="true"/>
<field name="children" persistence-modifier="persistent" default-fetch-group="true">
<collection element-type="path.impl.Location"/>
</field>
</class>
and package.mapping is:
<package name="path">
<class name="LocationComponent">
<jdbc-class-map type="horizontal"/>
</class>
</package>
<package name="path.impl">
<class name="LocationGroup">
<jdbc-class-map type="base" pk-column="GROUP_ID" table="LOCATION_GROUPS"/>
<jdbc-version-ind type="version-number" column="JDOVERSION"/>
<jdbc-class-ind type="in-class-name" column="JDOCLASS"/>
<field name="path.LocationComponent.name">
<jdbc-field-map type="value" column="GROUP_NAME"/>
</field>
<field name="children">
<jdbc-field-map type="one-many" table="LOCATIONS" ref-column.GROUP_ID="GROUP_PARENT_ID"/>
</field>
</class>
</package>
I have tried all manner of configurations but the error remains the same:
25-Apr-2008 16:05:24 com.ea.albt.infrastructure.persistence.jdo.JDODataStore BeginTransaction
CONFIG: Starting transaction
25-Apr-2008 16:05:24 com.ea.albt.infrastructure.persistence.jdo.JDODataStore updateObjects
FINE: Updating object ALBT Loc1209135924484 (has not yet been persisted)
25-Apr-2008 16:05:25 com.ea.albt.infrastructure.persistence.jdo.JDODataStore updateObjects
WARNING: Failed to persist/update objectALBT Loc1209135924484
kodo.util.FatalDataStoreException: Attempt to update the sequence table "JDO_SEQUENCE" failed. The sequence table is typically created when you run the mappingtool's refresh action on any datastore identity class. If you have not run the mappingtool but want to create the sequence table, run:
java kodo.jdbc.schema.DBSequenceFactory -action add
NestedThrowables:
Why is Kodo trying to use the jdo_sequence table when we want it to use the HSQLdb identity field ?We have many users using single field identity and auto-increment together.
-
Auto increment with collection is not working
I am using KODO 3.0 with MYSQL 4.0.16. I have created two JDO object as
follows
BankAccount contains a collection of Contacts object. My metadata looks
like this
<class name="BankAccount">
<field name="contacts">
<collection element-type="Contacts"/>
<extension vendor-name="kodo" key="element-dependent"
value="true"/>
</field>
</class>
<class name="Contacts" objectid-class="Contacts$contactId">
<field name="contactId" primary-key="true">
<extension vendor-name="kodo" key="jdbc-auto-increment"
value="true"/>
</field>
</class>
There is no problem in the persisting of BankAccount object and adding
Contacts to it, but Contacts collation is not retrieved along with parent
object. In the database join table, the contact Id value it is always set
to null.
Things are working well with out contact id in Contacts.
Can anyone help?
Regards,
dharmiSet the following property:
kodo.jdbc.AutoIncrementConstraints: true
Described here:
http://www.solarmetric.com/Software/Documentation/latest/docs/ref_guide_pc_oid.html#ref_guide_pc_oid_pkgen_autoinc
Maybe you are looking for
-
There is a song on my computer that I want to add to iTunes. Usually when I click on any song, it automatically adds to iTunes and plays. This song is an MPEG file. When I double click on it, iTunes pops up, but the song does not add to the list and
-
Vat reports available in sap for india
Hi, Any one please tell me about the VAT reports available in standard sap system for INDIA.
-
So, the admin/creator of a group chat that I'm in is tryign to promote me to the rank of MASTER but for some reason my role only shows as USER and I have no MASTER permissions. It's a P2P chat that we're in and he's tried promoting me twice with no e
-
How does request.setAttribute() works?
How does request.setAttribute() works? Does it append data to http header and forward? Does it set to a memory space like session.setAttribute() does? Thank you Jim
-
Keep getting an error msg (-1) when trying to restore my iphone4