Trigger Client Method on Relationship Replace

I have a client method defined to be triggered on an OnInsertRow event for the Part BOM relationship type. This method is not triggered when the user performs a Part BOM replace. The most likely reason for this is, when handling the replace Innovator is just doing an update of the Part BOM item.

The Part BOM itemtype definition only allows OnBeforeNew, OnAfterNew, OnNew and OnShowItem client events. But these events are not triggered when doing a Part BOM replace.

Is there any way to trigger a client method when doing a Part BOM replace?

  • HI Gary,

    interesting discovery! I wasn´t aware of this behavior of 'replace'.

    The answer depends of what you want to achieve with your Method. Is an onAfterUpdate server event not an option? It at least can update something in your relationships when user click save. Or maybe use Properties events?

    There is the alternative client options with onFormPopular Form events to evaluate changes inside relationships, but this option also requires the "Save" by the user.

    If nothing works, even a custom "Replace" button is an option. But this is just a loose collection. It depends on your use case.

  • Angelaip

    Thanks for your suggestions. The primary function of the existing OnInsertRow client method is to prohibit adding certain Parts to certain BOMs. Two simple prohibitions are: to not allow any Part to appear twice on any BOM; and not allow any Part to be added to the BOM of a Part with classification = 'Component'. There are many other, more complex, prohibitions.

    As you mentioned there are several possible approaches using Server methods, but they would require the user to do a Save before Innovator would trigger the method. It is more user friendly to notify the user of any problems as they are entered.

    Utilizing a Property event (such as OnEditStart) for the Part BOM itemtype related_id property may possibly be of use.

    For now we have just disabled the Part BOM Replace button.