Question
TSL
IN
Last activity: 12 Apr 2020 23:40 EDT
How to Increment counter value in pega 8
I have created one activity.
In that, in adding incomming data to data type
i have many columns and also one PRIMARY KEY(ID- Integer type)
now, want to auto increment this EMP ID for every row inserting...... Can some tell me???
Refer the attachment
***Edited by Moderator Marissa to change type from Pega Academy to General; update Platform Capability Tags***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Updated: 14 Jun 2021 7:38 EDT
Pegasystems Inc.
IN
If the Employee ID in Data Type starts from 1, then Get the pxResultCount from the Data Type by using a data page and increase it by 1 and set it for the new row's ID.
-
Kumar K DUGGIRALA NAVYA
Pegasystems Inc.
IN
Hi @kanap2,
If the Employee ID in Data Type starts from 100, then your solution may not work so you need to do one small modification i.e increase by 1st EMP ID rather than increasing by "1".
-
Kumar K
Pegasystems Inc.
IN
You can also try to fetch the last emp id and increment it by 1 Employee.pxResults(<APPEND>).Employeeid=Employee.pxResults(<LAST>).Employeeid+1
-
Kumar K
TSL
IN
Thanks Its working
-
Kumar K
Updated: 14 Jun 2021 7:38 EDT
Pegasystems Inc.
IN
Thanks yerrh for the additional information.
Yes, we can add pxResultCount to pxResults(1) and set it to Employee ID.
-
Kumar K
TSL
IN
Thanks Its Working.
TSL
IN
Thanks Its Worked.