pluggable widget change association

0
Hi, Is it possible in pluggable widgets to change the association of an object? Like in a list selecting an object and change the association of another object to the selected one? What I have now is that I can select the object, it gives me an ID in console, but I don’t know how to set the main objects association to the object with that ID. Kind regards, Steven Keersmaekers
asked
1 answers
2

I had the same challenge before. I think this part is really missing in the Pluggable Widgets API still. What I did was, based on the GUID you get from the datasource in the pluggable widget, retrieve the full MxObject via a call to the Client API. For this you need to load the Client API library into the widget. Can be done easily via npm. 

Once you get the MxObject you can use add/removeReference functions to achieve what you need.
 

Not sure if there is a better solution out there, but this one is guaranteed to work!

answered