Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
can't execute freed script
er_anant
Hi All,
I am using a callserver method on save event through form api.
but when I click on save it throws "can't execute freed script" error.
Did anyone facede this error ever.
Please help me out in resolving this error.
regards
Kumar Anant
Find more posts tagged with
Comments
Meena25
Hi,
Try making the value you fetch from the server as a String, where ever you call (fetchedValue.toString()). I guess this would help.
er_anant
Its done .
initially I was using callserver on onsavevalid.
I changed the event to onforminit and it started working.
TheYann
Yeah don't forget callserver are asynchronous, when the call is made, the process keeps going!
So be careful when you use a combination of callserver and save event !
er_anant
so what is the correct way to use callserver with onsave event.
TheYann
We had a similar need and what we did was to bypass most of the saving logic.
Basically the onSave event will tell you if the window must be closed once the file has been saved.
Then you have the onSaveValid event which does the call server and returns false, the false will tell FormAPI that something went wrong and will stop the save mechanism, when actually nothing is wrong, we just want to bypass the automatic process.
Then the called script when done calls a custom function which handles the end of the onSaveValid event, sets some values, does some cleaning up, and closes the window if need be.
I don't know if this is a viable solution or just a hack but it does work alright for us.
I hope this helps!