Change 'Save As' to use part number sequence instead of adding Copy Of in the part number field?

With Aras V11, SP15:

For the Part Item type, we have a pattern setup that we want all parts to follow this pattern: PRT-##### and we want it restricted to this length (9). This works. 

However, when someone does a 'Save AS' or in an Express ECO chooses to renumber a part.  we get this error "The given value of type String from the data source cannot be converted to type nvarchar of the specified target column." 

This is because we've set the item_number length to equal 9 and Aras is trying to create a new part with the number field set "Copy of PRT-#####".   We can get past the error by setting the item_number length to 20 but we don't want to do this as people can then create parts that don't match our pattern.

Where can we change it so Aras doesn't add the "Copy of" in front of the original part's number:

We'd also ideally like it to just grab the next number in our part number sequence.

I've been hunting through aras methods but can't find where the "Copy of" is being added. 

Anyone know?

Thanks.

Parents
  • Hi m2sawyer

    Use below steps to update part number. (Input is Sequence Name used to generate part part number. I used Simple ECO sequence number for reference. Update and verify)

    Step 1: Create new server method and copy below code

    Step 2: Open Part Item type and add this method under server events (Event : On After Copy)

    Step 3: Save and Unlock the Item type

    Innovator inn = this.getInnovator();
    Aras.Server.Security.Identity plmIdentity = Aras.Server.Security.Identity.GetByName("Aras PLM");
    bool PermissionWasSet = Aras.Server.Security.Permissions.GrantIdentity(plmIdentity);
    try
    {
    string sequence = "Simple ECO";  
    Item newPartItem = inn.newItem(this.getType(), "edit");
    newPartItem.setID(this.getID());
    if (!string.IsNullOrEmpty(sequence))
    {
    string newNumber = inn.getNextSequence(sequence);
    newPartItem.setProperty("item_number", newNumber);
    newPartItem = newPartItem.apply();
    }
    }
    finally
    {
    if (PermissionWasSet) Aras.Server.Security.Permissions.RevokeIdentity(plmIdentity);
    }
    return this;

     

    Thank You

    Gopikrishnan R

  • Ok, I tried adding this method (cavi_part_SaveAs).  When I did a check syntax, it complained about "Missing ";" before statementon line  1" and on lines 2,3,6,7 and 11.

    Is there a formatting issue or something I need to add first?  Note, I'm using Aras V11 SP15.

    When I try to use the method as is I get the error:

    -<SOAP-ENV:Envelope>
    -<SOAP-ENV:Body>
    -<SOAP-ENV:Fault>
     <faultcode>SOAP-ENV:Server</faultcode>
     <faultstring>The method type (JavaScript) specified for cavi_part_SaveAs is not currently supported.</faultstring>
    -<detail>
     <af:legacy_detail>The method type (JavaScript) specified for cavi_part_SaveAs is not currently supported.</af:legacy_detail>
     </detail>
     </SOAP-ENV:Fault>
     </SOAP-ENV:Body>
     </SOAP-ENV:Envelope>
    Thanks for the help.
  • Method type should be C# method

Reply Children
No Data