I am having difficulty setting related fields programatically within a popup.
Use Case:
- We have a ‘Relationship’ object which needs to support a reference to one of three other types, specifically ‘Team Member’, ‘Organisation’, or ‘Person’.
- Given my understanding is that custom objects do not support this type of dynamic/polymorphic relationship, our design approach is to have a dummy field called ‘Search Text’, which is rendered in a Skuid field editor using a dynamic render snippet.
- As various events are triggered on the dummy field, the appropriate Id values for related records are set on the underlying row. For example: if an organisation is selected in the ‘Search Text’ field, the dynamic rendering code will set like so:
params.row.cloupra__To_Organisation__c = ui.item.id; params.row.cloupra__To_Organisation__r = {Id: ui.item.id, Name: ui.item.name};
- The actual save is triggered by the "Save/Cancel" button on the popup that contains the field editor. I have intercepted this call, and the object passed to skuid.model.save contains the (apparently) correct values.
Kind Regards,
Dan Arnison