A trigger to remove links when a metadata field is changed


(Gjboyd7) #1

We have created a trigger which creates news item links in a different root node of the site, when a select metadata field is changed on the news item. The metadata field is a select of departments, depending on the department selected a link is created under that departmental news section. We got this part working ok.

We now need to create a trigger when the metadata field is changed, if the department is no longer selected, remove the link asset. (see attached screenshot of the trigger)

Can anyone advise what we are doing wrong in configuring this trigger to perform the removal of the link?


(Bart Banda) #2

Hard to say.

Does the trigger actually fire but the action just doesn’t complete properly?

As in, you’ve got your Trigger Event and Condition configured correctly, but the Action is just not doing the right thing?

One thing to consider is if the news items are directly linked under the 96004 News root node, if they are, then the removal trigger action won’t work as they need to be 2 levels below that root node.
Confusing, I know, hence this: https://squizmap.squiz.net/matrix/7752 \


(Gjboyd7) #3

Thanks. Cannot access the squizmap link.

We are unsure at what stage the trigger is failing, there appears to be no feedback or logs on this. How do you find that out in Matrix?

The news items are directly linked under #96004 root node. Why do they need to be 2 levels below #96004 node?


(Bart Banda) #4

If there are no logs of the trigger firing at all, then the problem is in the trigger event. When the trigger fires you should see something in the system logs telling you that the trigger fired.

It’s just how that trigger action was designed when it was made, not sure why. You could try setting the root node higher if you can. But seeing as you are not seeing and trigger firing events in the logs, you would also need to make sure you’ve got your event set up properly. Also try and run a Trigger Batch to try and fire off the trigger as a test.