This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error trying to edit object during BeforeSetObjectPermission event handling

Hello.

I have a following task: "if there were added a specific usergroups to permissions of object then to clear a field of this object."

I created an eventhandler for event BeforeSetObjectPermissions, it is successfully triggering on adding of usergroups, but I am unable to clear the fields of object. Looks like it is not allowed to make changes in objects during BeforeSetObjectPermissions event handling. I am receiving the error "Operation not allowed. Script is being executed for the object "48". (0x80040834)" at the row with CheckOut or SetProperty function.

Is there any way to solve this problem?

Thank you!

  • You are correct.  If there's no metadata/file change then BeforeCheckInChangesFinalize will not fire.

    I can think of a possible approach, but not using VBScript.

    Using the Vault Application Framework you could have a task queue.  In your BeforeSetObjectPermissions (or AfterSetObjectPermissions) you would add a task into the queue saying that this object needs to be modified.  Your code would react to this task needing to be done, check out the object, make the changes, then check it in.

    Regards,

    Craig.