Method Community

 

Enter Value into Field on Grid

Last post 04-17-2014 12:44 PM by Anonymous. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 04-16-2014 5:58 AM

    Enter Value into Field on Grid

    Hello,

    How could I enter a value retrieved from a table into a grid row?

    I'm trying to use "Enter Value into Field on Screen" action, between a Grid Loop, retrieving the value from a table.

    Thank you.

    Greetings

  • 04-16-2014 3:58 PM In reply to

    Re: Enter Value into Field on Grid

    Hi Francisco,

    This is a bit of a loaded question without having some context in to what exactly you are attempting to do.  Any chance you can give me this scenario, or even better maybe a screenshot of your setup.  Off-hand I am not sure this is possible, however I would have to attempt to recreate a simple version of what you are doing to answer this.

    Also, where is your action set for the table loop, is it from within the Grid or is it happening outside your grid?  One more question, when you are going through this process, are we only updating 1 value at a time, or could there be times where you have to update more than 1 record in the grid?

    -Ben

  • 04-17-2014 3:13 AM In reply to

    Re: Enter Value into Field on Grid

    Ok!

    That's the basic idea;

    * Table with fields

     - Num 1 (3, 4, 2, 3, 4, 5)

     - Num 2 (3, 3, 4, 5, 5, 9)

     - Res (empty)

    * A grid with this 3 fields (RecordID, Num1, Num2, Res)

    * Button with

    - Start Loop throught the grid, 

     - Retrieve value of field Num1 from table where the RecordID = Value from row RecordID, put in a Action Result arNum1

     - Retrieve value of field Num2 from table where the RecordID = Value from row RecordID, put in a Action Result arNum2

     - Basic Math arNum1 + arNum2 = arRes

    - Enter Value into Field on Screen, Grid.Res with the Action Result arRes

     - End Loop

     - Refresh the Grid


    The issue is that nothing happends

  • 04-17-2014 8:44 AM In reply to

    Re: Enter Value into Field on Grid

    That is great Franscisco, thanks for that additional info, I believe I have something to work with now.  Give me a bit to set something up and I will see what the issue is.  Off-hand I am wondering if this might be something do with needing to create your Action Results OUTSIDE your loop, at least your arRes actionResult. 

    -Ben

  • 04-17-2014 10:45 AM In reply to

    Re: Enter Value into Field on Grid

    Hi Franscisco,

    I just finished setting something similar to your scenario up in my Account, I got this to work, so I will share my details.

    First, here is a screenshot of my screen of the successful update after pushing the LoopGrid button, the Res field in the grid was blank before:

    Here is a screenshot from the Screen Designer of my Action Set for the LoopGrid button, note the 'arRes' action result was created outside the loop, all I did was add it here, but used the "Type In" option, then left the value blank.

    Next, is a screenshot of the "Retrieve Value from Table" action for one of the AR_Num values, just do the same action for the other field(s):

    Do your Math calculation next, take AR_Num1 and ADD it with AR_Num2, and save it to the Action Result Name of the 1st Action Result you created outside your loop, in my case 'arRes'.

    Once you have this arRes value, the last step in the loop would be to "Update Field in Table",  add this value to the 'res' field in your grid, make sure to Update this where RecordID  = Value From Row RecordID.

    Note, if you don't create the empty action result before your loop, then you will only be able to update the last value in your grid.  Please let me know if this helped, or if you have any more questions.

    -Ben

  • 04-17-2014 11:09 AM In reply to

    Re: Enter Value into Field on Grid

    Thank you for your quick and complete Reply.

    What can I do if I don't want to Update the field on the table and only put in the Field of the grid without saving it?

  • 04-17-2014 12:44 PM In reply to

    Re: Enter Value into Field on Grid

    Francisco,

    I am afraid I am not too sure this is possible, I tested this quickly using the "Update field in Table" action, and choosing my res field from my grid.  The issue was that I only get a value for my first row (althought it was at least the correct value), there could be some tweaking to get this to work, however I won't be able to look at this until Monday.  I have given you some good info to help you get going on this and point you in the right direction.

    One thing to note, if you are updating the value to the field in your grid, you need to make sure that your Grid is "editable", if it isn't then no value will get add to the grid.  Also, with my one value that got added to the grid, it was not actually saved as you requested, only if you click the "Update" button at the bottom of the grid.

    -Ben

Page 1 of 1 (7 items)