Hello,
I have a quite complicated form where the user enters data. Many things happen before saving and after saving the form. I use several form php plugin which are hooked on different time.
I have difficults with the last thing on the form (php plugin set onAfterProcess) which is creating a pdf report and save file on the server. The pdf is then transferred to the company document system.
The procedure is as follows:
1. Creating and saving pdf - works
2. Receiving bearer token - works
3. Upload pdf to document system - works
4. Get response from document system server - works
5. Save response data to db (same form row id)
6. Open new tab with link we received in response - not works
Open new tab in php plugin is mission imposible so I try to work around. I was create js fabrik.form.submit.end which call ajax to get link and open new tab.
Sometimes I get link and open new tab but in most casses not. I assume the problem is time and triggering events. To create and save two(2) pdf pages takes 2-3 seconds then upload to document system also takes 2-3 seconds. BTW in js code I set timeout 2-3 sec befor calling ajax.
Will be better if I set to onBeforeProcess? ...or any other solution?
Thanks
I have a quite complicated form where the user enters data. Many things happen before saving and after saving the form. I use several form php plugin which are hooked on different time.
I have difficults with the last thing on the form (php plugin set onAfterProcess) which is creating a pdf report and save file on the server. The pdf is then transferred to the company document system.
The procedure is as follows:
1. Creating and saving pdf - works
2. Receiving bearer token - works
3. Upload pdf to document system - works
4. Get response from document system server - works
5. Save response data to db (same form row id)
6. Open new tab with link we received in response - not works
Open new tab in php plugin is mission imposible so I try to work around. I was create js fabrik.form.submit.end which call ajax to get link and open new tab.
Sometimes I get link and open new tab but in most casses not. I assume the problem is time and triggering events. To create and save two(2) pdf pages takes 2-3 seconds then upload to document system also takes 2-3 seconds. BTW in js code I set timeout 2-3 sec befor calling ajax.
Will be better if I set to onBeforeProcess? ...or any other solution?
Thanks