Save mutiple EditRecords widget for the same table record.

Save mutiple EditRecords widget for the same table record.

  
I have many tabs and in each one I have a EditRecord widget for the same table record, how do I save the changes in these EditRecords widget for the same table record?
Tarcisio Ribeiro wrote:
I have many tabs and in each one I have a EditRecord widget for the same table record, how do I save the changes in these EditRecords widget for the same table record?
 
 Hello Tarcisio,

I'm not sure if I understand it. But let's say... you have one Record var as source of multiple Edit Records, and each Edit Record have diferent attributes from the Record, and you have one button that must save all the info that is spread across Edit Records.

If this is your case, you some ways to do it, I'll show you 2.
  • You can have an auxiliary Record in the save action, and then assign it attribute by attribute from the Edit Records.
  • The other ways is the same principle but instead of having one more variable is to assign the attributes from others Edit Records to a main one, example:
    you have EditRecord_1, EditRecord_2 and EditRecord_3, you can assign to EditRecord_1 the filled attributes in EditRecord_2 and EditRecord_3.
Then in the save action use the aux Record var or the "main" Edit Record.

lets us know if that's it!

regards,
Miguel
Miguel Antunes wrote:
 
 Hello Tarcisio,

I'm not sure if I understand it. But let's say... you have one Record var as source of multiple Edit Records, and each Edit Record have diferent attributes from the Record, and you have one button that must save all the info that is spread across Edit Records.

If this is your case, you some ways to do it, I'll show you 2.
  • You can have an auxiliary Record in the save action, and then assign it attribute by attribute from the Edit Records.
  • The other ways is the same principle but instead of having one more variable is to assign the attributes from others Edit Records to a main one, example:
    you have EditRecord_1, EditRecord_2 and EditRecord_3, you can assign to EditRecord_1 the filled attributes in EditRecord_2 and EditRecord_3.
Then in the save action use the aux Record var or the "main" Edit Record.

lets us know if that's it!

regards,
Miguel
 
 Miguel,

Tarcisio is using tabs ... and probably wants to have the validations on all tabs working as well.
Then theres is only one way to do it ... in the overall save action validate all editrecords before you can assign to EditRecord_1 the filled attributes in EditRecord_2 and EditRecord_3 and do the CreateorUpdate function to the database
Hi,

If there is just 1 save button ouside the tabs, then you can use only EditRecord_1 in all the controls (as parent edit record and as source for the inputs).
Also the buttons should have the Parent Edit record set to EditRecord_1.
The other edit records will just serve as page layout.

If there are buttons in multiple tabs ...then you probably have to go as Joop sugested.


On a side note, validations on hidden (not selected) tabs is kinda tricky, since they won't focus automatically with client side validations.

Regards,
João Rosado
what is an 'auxiliary record' i have the problem describe above and i need it fixed , your solutions sounds like i would work. please get back to me!


Hello Delson,

The auxiliary record would be a Local Variable on the Save Action, with datatype=Record and Record Definition = your table. You can then use an Assign action to copy the values from the EditRecord widgets to this local variable (copy each value from the EditRecord widget that shows that value on screen).

After this, use the LocalVariableRecord as the input (Source) of your table update action.

Hope this helps.
Best regards,
Pedro Vieira