• 1 reply
  • Latest Post - ‏2012-07-27T05:02:09Z by babinag
10 Posts

Pinned topic Post proc script is not working when post save is enabled

‏2012-07-26T09:55:43Z |

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
Updated on 2012-07-27T05:02:09Z at 2012-07-27T05:02:09Z by babinag
  • babinag
    91 Posts

    Re: Post proc script is not working when post save is enabled

    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);;