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

APPLICATION - PRODUCT ENGINEERING - Assign sequence to subclasses

Charlatat - Tuesday, August 30, 2011 2:01 PM:

I believe its possible to have separate sequences assigned to subclasses. Is this correct? If so, I'm having troubles finding where to define that...



Brian - Thursday, September 1, 2011 7:26 AM:

Hi Charlatat,

I don't think there is a "configuration" that you can set to allow this.

I assume you want a sequence for the "item_number" for say a Part.

You can set the Item_number property as "string" and "not required". Then create a server event to be fired onBeforeAdd.

Read the classification "this.getProperty("classification","");"

and then call "getNextSequence("sequence name")  from the innovator item and assign it to "item_number" before returning from the method.

Hope this helps,

Brian.



Ronan - Tuesday, September 6, 2011 9:02 AM:

Brian's right, this is not "out-of-the box" functionality, but is very easy to do with a small OnBeforeAdd method. I have C# code that does just what he described, here it is.

            Innovator inn = this.getInnovator();
            string thisClassification = this.getProperty("classification");
            if (thisClassification == "Foo")
            {
                string newNumber = inn.getNextSequence("PartFoo");
                this.setProperty("item_number", newNumber);
            }
            return this;

 

?
Ronan Jouchet - PLM Consultant, Processia Solutions