Forum Discussion
Former_Member
8 years agoAccelerator III
Looked at the example, but I cannot get it to work.
I created a new method to have a minimal example:
It's added to the Part type:
Here is my part:
However, when I edit it and save it, it still has its permission New Part:
When it should be changed to the permission "Customer", as written in my server event.
And in server event, I also write to file whenever it is executed, which it does when I save the part. So it's definitely being executed. It is being run twice, with these item outputs:
Item newPermission = this.newItem("Permission", "get");
newPermission.setProperty("name", "Customer");
newPermission.apply();
this.setPropertyItem("permission_id", newPermission);
File.AppendAllText("C:\\ArasLogs\\test.txt", this.dom.OuterXml);
return this;
It's added to the Part type:
Here is my part:
However, when I edit it and save it, it still has its permission New Part:
When it should be changed to the permission "Customer", as written in my server event.
And in server event, I also write to file whenever it is executed, which it does when I save the part. So it's definitely being executed. It is being run twice, with these item outputs:
<Item type="Part" typeId="4F1AC04A2B484F3ABA4E20DB63808A88" id="8821D59BCEC540978D2F246A5AD409C0" loadedPartialy="0" isDirty="1" LastModifiedOn="1512374887622" action="update" doGetItem="1"> <config_id keyed_name="TT" type="Part">5F7C0850DF1F4A84B6E03C7B85EFC074</config_id> <created_by_id keyed_name="Super User" type="User">AD30A6D8D3B642F5A2AFED1A4B02BEFA</created_by_id> <created_on>2017-12-04T02:49:42</created_on> <current_state keyed_name="Preliminary" type="Life Cycle State" name="Preliminary">72A2322564FE4193933CFB5339487A06</current_state> <generation>5</generation> <id keyed_name="TT" type="Part">8821D59BCEC540978D2F246A5AD409C0</id> <is_current>1</is_current> <is_released>0</is_released> <keyed_name>TT</keyed_name> <locked_by_id keyed_name="Super User" type="User">AD30A6D8D3B642F5A2AFED1A4B02BEFA</locked_by_id> <major_rev>C</major_rev> <make_buy>Make</make_buy> <modified_by_id keyed_name="Super User" type="User">AD30A6D8D3B642F5A2AFED1A4B02BEFA</modified_by_id> <modified_on>2017-12-04T03:03:28</modified_on> <name>TT123</name> <new_version>0</new_version> <not_lockable>0</not_lockable> <state>Preliminary</state> <unit>EA</unit> <item_number>TT</item_number> <itemtype>4F1AC04A2B484F3ABA4E20DB63808A88</itemtype> <permission_id> <Item isNew="1" isTemp="1" type="Permission" action="get"> <name>Customer</name> </Item> </permission_id> </Item> <Item type="Part" typeId="4F1AC04A2B484F3ABA4E20DB63808A88" id="C919C3C8CAA3405680A35EFBC0B27595" loadedPartialy="0" isDirty="1" LastModifiedOn="1512374887622" action="version" doGetItem="1" oldId="8821D59BCEC540978D2F246A5AD409C0"> <config_id keyed_name="TT" type="Part">5F7C0850DF1F4A84B6E03C7B85EFC074</config_id> <created_by_id keyed_name="Super User" type="User">AD30A6D8D3B642F5A2AFED1A4B02BEFA</created_by_id> <created_on>2017-12-04T02:49:42</created_on> <current_state keyed_name="Preliminary" type="Life Cycle State" name="Preliminary">72A2322564FE4193933CFB5339487A06</current_state> <generation>5</generation> <id keyed_name="TT" type="Part">8821D59BCEC540978D2F246A5AD409C0</id> <is_current>1</is_current> <is_released>0</is_released> <keyed_name>TT</keyed_name> <locked_by_id keyed_name="Super User" type="User">AD30A6D8D3B642F5A2AFED1A4B02BEFA</locked_by_id> <major_rev>C</major_rev> <make_buy>Make</make_buy> <modified_by_id keyed_name="Super User" type="User">AD30A6D8D3B642F5A2AFED1A4B02BEFA</modified_by_id> <modified_on>2017-12-04T03:03:28</modified_on> <name>TT123</name> <new_version>1</new_version> <not_lockable>0</not_lockable> <state>Preliminary</state> <unit>EA</unit> <item_number>TT</item_number> <itemtype>4F1AC04A2B484F3ABA4E20DB63808A88</itemtype> <permission_id> <Item isNew="1" isTemp="1" type="Permission" action="get"> <name>Customer</name> </Item> </permission_id> </Item>Why isn't this working?