Hi Everyone,
I want to achieve the following:
- When the user clicks the save&close button on an activity, a custom dialog box will appear
- Based on the values provided in the dialog, the current activity will be closed (the window will also close), and a new activity will be created. The trick part is that the changes on the current activity needs to be submitted before all this happens
I created a function on form save, which prevents the save if the savemode is equal to save and close. Then I display my custom form. The return value of the custom form calls entity save, then it calls a custom AJAX call to close the current activity. If the call succeeds, I close the window.
My problem is that the form does not seem to be saving the values before the AJAX call. Is it possible that the save event happens later on the server than the AJAX call? If there is a better way to achieve this, please let me know. It is a 2011 on-prem deployment btw.
Regards,
Adam