Hi,
Trying to find the best solution for a couple of days, but i haven't found any solutions for my problem.
What im trying to do is to make an asynchronous call (get and update a value) before saving the item.
At first I tried doing it afterwards with a workflow, but the value is stored in the parent site, which is inaccessible in workflows.
What i did (in short, works fine)
PreSaveAction -> call function1
PreSaveAction -> return false;
function1 -> onsucceed call function2
function2 -> update value in textbox
function2-> $("input[value='Opslaan']").click(); (=save button)
which triggers PreSaveAction -> returns true; -> item stored twice
When I disable the jQuery click function call and just press the button twice it works fine. When I trigger the click function with jQuery it saves the items twice. (While function1 and function2 are only called once)
This is all SharePoint Online, so no other coding solutions available.
Anyone a good idea how to call a async function before posting the form?
Kind regards,
Lennard