StratusForms icon indicating copy to clipboard operation
StratusForms copied to clipboard

Linked tables

Open btroop202 opened this issue 6 years ago • 2 comments

Was wondering if anyone built a form that pulled data from two lists. I will use an example of a customer list, then another list that has an address shipping list. So a customer could have 1 to N different shipping address. I was able by using a workflow that when an entry was created in table A, create a shell in table B. But want to be able to have a page with two forms pulling the data from both tables.

Thanks, Darrin

btroop202 avatar Aug 09 '18 16:08 btroop202

This COULD be accomplished with some javascript trickery... you can specify in your init function which query string variable is the id for the given list. So you could theoretically have to query string vars and call init twice with each var. then on Submit you'd need to call the save function twice.. once for each form. would probably want to kick off the save of the second form in the completefunc of the first call.

mrackley avatar Aug 09 '18 16:08 mrackley

This is a major factor of why I enjoy using StratusForms as a base for a solution, as I can just extend.

A closely related scenario I've implemented is this awesome commenting solution, I hooked it all up using the formID, and a new comment and reply would save independently to saving the form itself.

https://github.com/sprtus/spcomments

No reason why you couldn't duplicate the Save/Submit function, with the save button calling the SaveAddress function, which would have no page refresh/redirect and once completed it calls the SaveForm function, saving the main form itself and redirecting only then.

warwickbuilds avatar Aug 13 '18 13:08 warwickbuilds