E9.1 Store Newly Entered Grid Values

FrankCLT

Well Known Member
Hello All,

I have a situation where I need to store newly entered grid values....for example, user opens an application and the grid is populated with 5 entries (from a table), the user then enters 3 additional grid entries and modifies an existing row. How can I capture the 3 new entries and the updated row for processing later in the application like after clicking the OK button? I would rather not use a work file.

Thank you in advance,
FrankCLT
 
Add a new grid column EV01, hide it. Populate this with a N for old records (I think you can do it in grid record is fetched event), for new record keep this as blanks. You can then use this flag value to identify if its a new record or old record.
 
That is exactly what I did. I use a date for records added or modified. Thank you....
 
HI, glad you have it working, but E1 forms handle that anyway. What form type did you chose?

Look at UDC P0004A W0004AI (headlerless detail) for example
pick a UDC you dont use (12 FM is my favourite) It will allow you to change one and add another on the same OK click
 
Well then I think your form would naturally just do that by default. They're quite smart
 
Hi Johnd,

What do you mean "naturally do that by default" ?

Thank you,
FrankCLT
 
Hi Johnd,

What do you mean "naturally do that by default" ?

Thank you,
FrankCLT


As in if you click find on those forms and you bring back say 5 records....

If you update 2 of them and add 3 more, when you click OK the form works out for itself which lines it will update and then add/insert. You don't need to give it any assistance in doing so
 
That is exactly what I did. I use a date for records added or modified. Thank you....
You can also try to make use of "Add to DB before" (gets executed for new records) and "Update to DB Before" (gets executed for existing records) events. This will avoid adding new column to figure old or new record.
 
I think I see what is meant. So, for example, if I were to be needing to add new grid or modified records to a work table, I could have had code in the add and update that would insert to the work table if what was being added or modified didn't already exist (in our situation)?

Thanks,
FrankCLT
 
I just tried what I mentioned above, and it worked just fine. Thanks for pointing out what was already available.

FrankCLT
 
I think I see what is meant. So, for example, if I were to be needing to add new grid or modified records to a work table, I could have had code in the add and update that would insert to the work table if what was being added or modified didn't already exist (in our situation)?

Thanks,
FrankCLT
Correct. Both these grid events can be used

AddGridRecordtoDB-Before is used to insert anything new you enter in your grid
UpdateGridRecordtoDB-Before is used to update anything you changed in your grid

 
Back
Top