Page 1 of 1
Execute Javascript function on parent form
Posted: 23 Mar 2019
by Douglenator83
Hallo,
i got an issue and i hope you can help me. I Want to execute a function called "calculate()" after changes on an related-items list in the parent form.
Is this possible? What is the trigger for this?
Re: Execute Javascript function on parent form
Posted: 25 Mar 2019
by Nikita Kurguzov
Dear Douglenator,
Unfortunately, Related Items uses default SharePoint List View, and only has default scripts available. Thus there are no specific scripts for change event, at least as far as we are aware. You might be able to detect some changes, depending on how you edit items, for example, some code could be launched from Child's dialog on save. You can also detect when new items are added or old ones removed by adding an interval timer and regularly checking length of Related Items.
Alternatively, you can try using a Workflow, though these changes won't be available on the form right away.
In our new product for Modern UI -
Plumsail Forms, we did manage to add an event for List or Library control changes, but that's because we've had to build it from the ground up.