Hi folks
Hope you're all well?
Got a trigger question for you.
We use an asset builder with a dynamic root node selector to enable our less experienced users to create data records (for our courses) and save them into three different folders - One we'll call Other. Another called Health and another called Business. We link the data record in two places. One in a top level courses folder (which is the version the public see) and another into one of the three folders they choose (which is what the course editors see in the admin layer).
The problem we have is that occasionally they save their courses into the wrong folder.
So, to allow them to "move" the course into the right folder, I've set up a trigger that fires when a certain metadata field is updated. It then checks whether the asset (in this case a data record) is in the "Other" Folder. If it is, and the metadata field (in this case College) contains the word "Health" it creates a new link into the Health folder.
That part works fine.
But the last action of the trigger which is to remove the link from the Other folder isn't working. I've tried a few options including using the Current Asset (Asset id) parameter. But no joy.
What we end up with is three linked versions of the data record – one linked into the courses folder which is fine. One linked into the health folder that is also fine but the existing third linked asset is still there in the Other Folder.
Any ideas?
Thanks
Darren
Why not use a Link Manager page here? It seems like it would be a much more fool proof solution.
Good idea Nic! Thanks!