0

For the sake of simplicity, here is a test script that I would like to run during the Initialize step of an object launch point

mbo.setValue('CCIPERSONGROUP', 'TEST')

It sets the value properly, but does not save it. It saves properly when the object is saved (via the Update step of the object launch point), but not during Initialize.

Is there a way to get mbos to save on Initialize?

Don Boots
  • 2,028
  • 2
  • 18
  • 26
  • 1
    Is the problem that the setValue does not appear on the screen? Or you really want to commit two changes to each time to a record? – Sun Feb 16 '15 at 17:42
  • I would like to commit the changes. The script would be checking if it met a particular criteria before making the change so it wouldn't be attempting to commit every record every single time. – Don Boots Feb 16 '15 at 18:10
  • None of my script examples save automatically. Maybe this link will help? http://maximosolutions.blogspot.com/2014/06/saving-changes-using-automation-script.html - Saving Changes using Automation Script? If we are trying use mbo.save() which is a protected method. Instead of that try to use Mboset.save(). – Sun Feb 16 '15 at 18:49
  • If you save on initialize you will be setting yourself up for "refresh" errors, "Someone else has changed the record. Refresh and try again." But it won't have been someone else. It will have been your script. So, maybe you need an escalation to set that attribute on records for which the condition is true. Experience shows it is tempting, while holding the autoscripting hammer, to see every problem as a nail, but some problems are best solved other ways. – Preacher Jul 24 '19 at 14:39

1 Answers1

1

If you save on initialize you will be setting yourself up for "refresh" errors, "Someone else has changed the record. Refresh and try again." But it won't have been someone else. It will have been your script. So, saving during initialize is a bad idea, unless you get an independent MboSet (from MXServer, not from mbo) against a completely different record than the one that is being initialized.

Maybe you need an escalation to set that attribute on records for which the condition is true.

Preacher
  • 2,127
  • 1
  • 11
  • 25