Hello,
I have a record type with n number of values. The serial number is also saved.
For eg, there is an editable grid. with the serial number as 1,2,3,4. Now i can delete any row and hence the serial number should get updated.
How to do this in saveinto of that delete button?
I tried using foreach, but im doing some syntax error. Can you tell me any alternative?
Discussion posts and replies are publicly visible
We trade tips for details in this community. Do you have anything to offer? Error messages? Code snippets?
If the serial numbers are not sitting in the DB, then simply use fv!index instead of the serial numbers.
And if it does sit in the DB, then you will have to update all the rows that come after the one you deleted. For this, you will have to use a loop. Adding a sample code snippet below...
Yes i need the looping. Can you share the snippet?
Something like this
a!localVariables( local!outerIndex: fv!index, a!forEach( items: enumerate(count(local!data)-fv!index), expression: a!update( data: local!data[fv!index], index: "serialNumber", value: local!outerIndex+fv!item ) ) )
Need for recordtype. The data is in record type.
You can change that. No code will be 100% according to the usecase here. Just make the necessary changes in the data and the property and it should work
This worked:
a!save(ri!record['recordtype!record.maintenanceScheduleTypeId'], (enumerate(count(ri!record))+1) )