<Item type="Part" action="edit" id="50B48766A923456ABE4FE28A74 157D09" doGetItem="0" version="0"> <production_state>Preliminary</production_state> </Item>Based on the (custom) production_state property, I calculate a new permission in the method, and I add it to the Item object before returning it from the server method. The result looks as follows:
<Item type="Part" action="edit" id="50B48766A923456ABE4FE28A74 157D09" doGetItem="0" version="0"> <production_state>Preliminary</production_state> <permission_id keyed_name="Permission" type="Permission">82F4810F7FC641339A2B667BA8EF0596</permission_id> </Item>The essential things in my method are:
Item item = this; Item newPermisson = GetNewPermission(); string newPermissionId = newPermission.getID(); item.setProperty("permission_id", newPermissionId); item.setPropertyAttribute("permission_id", "keyed_name", "Permission"); item.setPropertyAttribute("permission_id", "type", "Permission"); return item;When I set the permission property, I get the error as shown earlier. However, if I comment these lines out, it stops to throw the error message, so it's definitely something wrong in how I specify the new permission. How would you go about to update the permission for a Part when it is updated? Furthermore, how do I also make it so that my method is called when the Part is promoted to another state in its life cycle? When a Part changes state in its life cycle, its state and permission properties are updated, but that does apparently not count as an update on the Part type, which means that onBeforeUpdate is never called. What's the proper way to implement this?