Adding a new row in a grid(interface)

Hi

I want to auto increment a user defined id in a grid when a new row is added.
I was able to increment the id but facing an issue...
Test scenario:
Add 2 new rows,delete the 1st row,
again add a new row.
In this scenario am getting the repeated id.
This is because i have used grid row index for id increment,
Please refer the attached screenshots for more details.

Can anybody suggest me how to handle this scenario.

Thanks in advance.

OriginalPostID-239262



  Discussion posts and replies are publicly visible

Parents
  • Hi
    Best approach to show the Employee-Id dynamically, don't add in the CDT in Add Link
    a!textField(
    value:          
               if(len(ri!CDT[ri!Index].employeeId)=0,
               concat("INC-",stripwith(ri!CDT[ri!Index].employeeId,"INC-")+ ri!Index)
               ,concat("INC-",right(year(today()),2),0,0,0,ri!CDT[ri!Index].employeeId)
               )
    )

    On the save of first name you can also save the Employee-Id to
    a!save(
    ri!CDT[ri!Index].employeeId,
               if(len(ri!employeeId)=0,
               concat("INC-",stripwith(ri!CDT[ri!Index].employeeId,"INC-")+ ri!Index)
               ,concat("INC-",right(year(today()),2),0,0,0,ri!CDT[ri!Index].employeeId)
               )
    )

    Hope this help
Reply
  • Hi
    Best approach to show the Employee-Id dynamically, don't add in the CDT in Add Link
    a!textField(
    value:          
               if(len(ri!CDT[ri!Index].employeeId)=0,
               concat("INC-",stripwith(ri!CDT[ri!Index].employeeId,"INC-")+ ri!Index)
               ,concat("INC-",right(year(today()),2),0,0,0,ri!CDT[ri!Index].employeeId)
               )
    )

    On the save of first name you can also save the Employee-Id to
    a!save(
    ri!CDT[ri!Index].employeeId,
               if(len(ri!employeeId)=0,
               concat("INC-",stripwith(ri!CDT[ri!Index].employeeId,"INC-")+ ri!Index)
               ,concat("INC-",right(year(today()),2),0,0,0,ri!CDT[ri!Index].employeeId)
               )
    )

    Hope this help
Children
No Data