cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Blocking relationships Trigger

hkobrosli
2-Guest

Blocking relationships Trigger

     Hi,

I'm making a trigger that blocks some relationships establishments between items that belong to different projects. I wrote rules that raise the trigger when they are matched.

When a user establish or edit a relationship and the trigger is raised, the script tests if the source and the destination of that relationship belong to the same project. If not, it displays an error.

I have a problem when I edit 2 different types of relationships at the same time (before clicking on "Apply") and one of them should make the trigger raised and the other should not.

The problem is my script tests all the modified relationship fields (I use getDeltaFieldNames() from the LocalTriggerManager.ScriptIssueDeltaBean class).

Is it possible to get in the scipt only the field that raised the trigger ?

Thanks

2 REPLIES 2
KaelLizak
14-Alexandrite
(To:hkobrosli)

Hello Hassan KOBROSLI,

I think what you want to do is have the trigger veto execute if there's at least one violating relationship, rather than if there is at least one legal relationship.

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
KaelLizak
14-Alexandrite
(To:KaelLizak)

Hassan KOBROSLI‌,

Did modifying your trigger to veto on at least one violating relationship help?

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
Top Tags