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

DEVELOPERS FORUM - How to order parts on BOM relationship by item_number

[email protected] - Thursday, August 13, 2015 8:10 AM:

Hi

Do any of you have an idea how to order parts on the BOM relationship by item_number.

A lot of our users requests BOMs sorted by item_number. I have tried changing  "Order By" attribute on sort_order (sequence) property on the Part BOM reationship to "2". On the Part itemtype I have checked that "Order By" attribute on the property item_number is set to "1". 

I would assume above settings would make the Part BOM relationship order by item_number but it doesn't seem to work that way.

 

Any idears?
We are on Aras10 SP4. 

 

Kind Regards
Henrik Olesen
Kamstrup A/S
Denmark 



Dave_Rollinson - Wednesday, August 19, 2015 5:13 AM:

Hennrik

You could add a Server Event to ItemType "Part BOM" as "OnBeforeGet" to modify the "sort_order" attribute.

C# code for the Method would be:

this.setAttribute("sort_order","item_number");
return this;

This will then change the sort order for any search of Part BOM Items.

 



[email protected] - Wednesday, August 19, 2015 8:13 AM:

Hi Dave

Thank you for your reply.

 

I have tried creating a server event and added it as OnBeforeGet og Part BOM itemtype just as you described but it doesn't change anything. 

Even if I press refresh on the form or push the search button the BOM is still not sorted.

Do you have any suggestions?

We are running Aras10SP4.

 

 



Dave_Rollinson - Thursday, August 20, 2015 4:00 AM:

Henrik

I tested in V11 SP2 and it worked; but after your comment I also tested in 10 SP4 and it didn't work.

I will follow up with a test in 10 SP5 if that helps.

A workaround could be to use a Server Event to re-write the "sort_order" property for all "Part BOM" Items for a Part ("OnAfterAdd" and "OnAfterUpdate" for the Part ItemType).

 

 

 

 

 



[email protected] - Thursday, August 20, 2015 5:27 AM:

Hi Dave

Thank you very much for you effort. I appreciate that. 

We have just upgraded our environments to SP5 and ufortunately it doesn't seem to work in Aras 10 SP5 neither. I have just tested.

I'm a novice concerning coding and I'm only capable of cypy pasting code and making small modifications to existing methods so I'm not really sure I understand your workaround. Neither will be able to create the code by myself. 

I will probably raise this to Aras as a support issue since I guess it must be a system bug.

Regards

Henrik