User Defined Script on Close

Is there a way to trigger a User Defined Script when a Sales Order is closed without any changes being made to it?

  • 0

    Not currently, only the ones that you can select during UDS Maintenance.

    You could attempt to use a post read event to store the current record key in a storage variable, refer to the script object's SetStorageVar and GetStorageVar methods. Then you can compare the saved record key in the post read and UI post exit events. In the post read, if the saved record key doesn't match the current record key, then you changed records, in the UI post exit, the task was closed so no need to check current record.

    Any business object that inherits SY_Maint will inherit the RecordChanged property which you could store into a storage variable during a pre/post write event and retrieve it in the post read event in a Entry/Maintenance task to determine whether or not the store record key's record was modified. You may or may not need to identify whether the record was modified so you don't have to use this.