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 - enable/disable relationship buttons

Stje_Cro - Tuesday, May 10, 2011 5:39 AM:

Hi,

i need to enable or disable some buttons on Part page TABs (for example new relationship on Part BOM TAB) on Part page load.

Can someone give me an advice?

Thank you

Stjepan



Brian - Tuesday, May 10, 2011 8:00 AM:

Hi Stejpan,

The toolbars on the relationship tabs are not available to program methods. The system determines when they are enabled/disabled.

If you are trying to stop people from adding relationships you can respond to the Relationship Type Grid Events.

Open Part BOM Relationship Type. Select the "Grids" tab. Add a method to the Grid that responds to the "onRowInsert" method.

If you want to stop people from adding a new row (relationship) just return false from the method.

Hope this helps,

Brian.



Stje_Cro - Wednesday, May 11, 2011 2:56 AM:

hi brian,

yes, this could help me.
thank you

I have tried to use your method but it don't works.
I have added to the Grid Event TAB a method, that contains only  "return false;", into the Part BOM Relationship Type . As Event i have choosed onInsertRow.

If I try to add a new element to the BOM of an article, the element will be added to BOM.
whit this method i don't see any change from previous situation without the new method.

 

THX Stjepan



Brian - Wednesday, May 11, 2011 6:20 AM:

My apologies Stjepan,

You can "return false;" from the "onBeforeNew" client event of the Relationship Item Type (not the Relationship type).

If you want to reject the add from the onRowInsert you can use the code in this post:  http://www.aras.comhttp://www.aras.com/Community/forums/p/546/1559.aspx#1559

Or if you want to use the permissions model to prevent the user adding then you can use the approach in this post:  http://www.aras.comhttp://www.aras.com/Community/forums/p/815/2412.aspx#2412

Cheers,

Brian.



Stje_Cro - Friday, May 13, 2011 7:49 AM:

Thank you Brian for your answer.

The methods that you suggest me are very useful for some cases but don't solve all thing into my issue.

For my issue the best solution will be have control above Lock/Unlock Tabs or enabled/disable relationship tab toolbar buttons.

It is impossible lock an tab through an method or it is not raccomanded operation?

 

Thank you

Stjepan Puseljic



Stje_Cro - Friday, May 13, 2011 9:03 AM:

i have solved
thank you very much for your support



rrt - Tuesday, March 1, 2016 12:52 AM:

hiii Stje_Cro

how you solve this problem , please give me solution

i want to disable add new relationshio button when one row is inserted into relationship

thanks in advance