I have a field called "customer sort order" is a number.
I want to update this field by adding a 0 to all the records.
For example is sort order is 2 it will change to 20 , if it is 3 it will change to 30 and so on.
How would I do something like that
Hello Marcelo, You can do it. First, you need a have a screen that displays all the records you want to update in a grid. For my example I chose Invoices. Next, create a button that will have actions that will update the sort order field for the records in the grid. Here is an explanation of the actions.
1. Start Loop Through Grid - A Basic loop that takes you through each record in the grid individually. It has a corresponding End Loop Through Grid.
2. Basic Math Calculation - While in the loop, you retain the individual record you are on. Here, I take the SortOrder value for the record the loop is on and multilpy it by 10 to get the extra 0.
3. Update Filed in Table - I have the value I need but it is not yet in the table. I need to update the actual table record which is what I am doing with this action.
Basic Math Calculation
Update Field in Table Action
This should work for all the transactions. I did run into an issue where one transaction would not save and the loop stopped. You may run into this problem and have to update a transaction manually and re-run the actions if it can't save on the Update Field In Table transaction. Just watch out you don't run the action twice on the same records or you will get two zeros.
If I do this and something goes wrong when I ran the actions, can I undo it or go back ?
There is no undo or going back. It's why there are no mass update actions on default screens. What you can do is export the table with the data. If something goes wrong, you can do an import update to revert data back. Also, do tests on a couple of records first before you do all the records. There is an option just to do checked records. You can also get help from a Method Partner or Method Professional Services.