Method Community

 

Update field

Last post 11-20-2014 8:27 AM by Method_Greg. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-14-2014 11:03 AM

    Update field

    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

  • 11-17-2014 9:20 AM In reply to

    Re: Update field

    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.

    Greg

    Greg Bilous
    Community Support Specialist
    Method Integration
    g.bilous@method.me
    Toll Free: 1.888.925.6238
    Local and overseas: 416.847.0400 ex.756
    Fax: 416.640.6027
  • 11-17-2014 1:31 PM In reply to

    Re: Update field

    If I do this and something goes wrong when I ran the actions, can I undo it or go back ?

  • 11-20-2014 8:27 AM In reply to

    Re: Update field

    Hello Marcelo,

       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.

    Greg

    Greg Bilous
    Community Support Specialist
    Method Integration
    g.bilous@method.me
    Toll Free: 1.888.925.6238
    Local and overseas: 416.847.0400 ex.756
    Fax: 416.640.6027
Page 1 of 1 (4 items)