I have GridPlus implemented nicely and does the basic editing and saving as it should, what a great plug in!
But... we have a requirement added to create a related record which would link the edited items to a known key value in a related table.
Since both the queryRule and gridsubmitchanges->editModel are kind of rigidly defined, I've been thinking of ways to accomplish adding the record to join the edited rows with the other table.
Can a related action apply to just the 'edits' / is there a way to pass that?
I explored the possibility of a 'tempKey' in the queryRule's queryRecordType, but can't really insert that known key value there. If I could just get the data into the record, then the editModel could do the additional writerecords & sync.
Is there some simple way to accomplish this without having to get heavy handed by maybe writing to another data store to be re-read in the editModel? (so it would know "any records updated from this grid with these record keys must associate the stored key that I just re-read"?
Discussion posts and replies are publicly visible
Use GridPlus's edited records payload (via editModel), pass your known key as a process parameter, and in the same process do two Write Records calls (one for grid edits, one for join rows). No temp datastore needed.
Thanks Shubham!
Can I pass items to the editModel? It seems to only allow constant reference to proc model with no visible way to pass params:
You can’t pass custom params to editModel , so stamp the known key onto each edited row before submit.
Add your known key as a field on each edited row before submit. The process then reads pv!record and runs both Write Records; one for the edited rows, one for the join rows.
Thanks!
I do have that tempKey added as a field on the edited recordtype, just the stamping part into the record is problematic for me because the queryRule seems to choke if I deviate even slightly from a straight up a!queryRecordType. (why I was saying it is all rigidly implemented ).
Wait a moment, I think I was updating the a!queryRecordType results incorrectly. Mea Culpa, this might work. Thanks again Shubham