Forum Discussion

m2sawyer's avatar
m2sawyer
Ideator I
6 years ago
Solved

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, w...
  • Gopikrishnan's avatar
    6 years ago

    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