For my application initially I started with post save script. But for the validation I need to use the post proc script. So I enabled both the post proc & post save script. But I found that my post proc script is not getting called but post save is working fine. So I cleared the cache and performed my testing but the result is same.
For testing I disabled the post save and enabled only the post proc but in that case also the post proc is not getting called. I do not understand wether both the script can be enabled simultaneously. Any idea?
Thanks in advance
Pinned topic Post proc script is not working when post save is enabled
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-07-27T05:02:09Z at 2012-07-27T05:02:09Z by babinag
babinag 270004R93B91 Posts
Re: Post proc script is not working when post save is enabled2012-07-27T05:02:09ZThis is the accepted answer. This is the accepted answer.Hi KunalD.
Sometimes postprocess or postsave scripts are not applied when set by UI, i do not know why.
Try this code in scriptSandBox:
Context ctx = PIMContextFactory.getCurrentContext(); Catalog catalog = ctx.getCatalogManager().getCatalog( "yourCat"); DocstoreManager docMgr = ctx.getDocstoreManager(); Document pSave = docMgr.getDocument( "/scripts/catalog/YourPostSave"); Document pProc = docMgr.getDocument( "/scripts/catalog/YourPostProcess"); catalog.setPostScript(pProc); catalog.setPostSaveScript(pSave); catalog.save();