Stored system.vars.$file in format control

In my HPSM v. 9.30 I use some logic in format control where i call doSave() of another file. So after calling i get different $file and my validation going crazy.

And I think what if i stored my $file befor doSave and restor them after?

  • This is pretty vague. I'm not sure if you're asking a question or just wanting a discussion, but you may be performing the wrong function in JS.

    doUpdate() is the way to save a record in JS without invoking the Doc Engine.

    doAction("save") is the way to save a record in JS with invoking the Doc Engine (and thereby including things such as notifications, validation, etc.). Note: The "save" part of doAction("save") is defined in the State for the record in question; so therefore you can use doAction("") to call whichever action is available in that State.

    system.vars.$file should work in formatctrl; you may be having issues because it's trying to execute doSave(), which it doesn't understand.

    You also need to be sure that you have declared the other table, declared a working query, and that the query actually found the record(s) for which you are looking.

    These are just some thoughts based on your post. If you want to elaborate and/or provide some screenshots, feel free.

  • My appologise, of course i mean doAction("save").

    Unfourtnatly I can't use doUpdate(), because it rise error like "trigger cancelled the update operation" (i don't know how it looks in englsh).

    My primary aim is update data in different table when i save Interaction.

  • OK, so the JS we are discussing is in a formatctrl, is that correct?

    Do you know which trigger is failing? Are there any helpful prints in the log? If there are any snippets of code which get printed to the log or the message tray, you can use those snippets to search for triggers if you don't know the trigger which fails. If you can't find the trigger, it might be helpful to turn off all triggers for the table your JS is updating, then turn them on one by one to see which one fails.

  • OK, so the JS we are discussing is in a formatctrl, is that correct?

    Yes

    Do you know which trigger is failing? Are there any helpful prints in the log?

    No, error message has no trigger name.

    it might be helpful to turn off all triggers

    How can I do this? The triggers Is in the left side on picture? How can I off them?

    But the main problem is that error arise spontaneously, not in every save.

  • OK, so the JS we are discussing is in a formatctrl, is that correct?

    Yes

    Do you know which trigger is failing? Are there any helpful prints in the log?

    No, error message has no trigger name.

    it might be helpful to turn off all triggers

    How can I do this? The triggers Is in the left side on picture? How can I off them?

    But the main problem is that error arise spontaneously, not in every save.

  • Verified Answer

    The triggers are stored in the triggers table. The triggers which are executing will have the name of your table in the table.name field. You can go through all of them and set the table.name field to "<table>OFF" - that will disable them from executing. Then try your JS with doUpdate(). If the JS works, then one by one you can set the triggers back to "<table>" and try the JS again. Eventually, you'll find the trigger which is failing, and then you can take steps to troubleshoot that trigger.

  • Finally I found a debasing trigger. It's name 'baseline.compliance.device' and call 'trigger.config.baseline' application.

    And I have no idea what is it.