Hey Guys,
I need to relate my Account module record to my custom module existing record base on conditions using controller files.
Any advise or guidance would be greatly appreciated..!!
Thanks.
Hey Guys,
I need to relate my Account module record to my custom module existing record base on conditions using controller files.
Any advise or guidance would be greatly appreciated..!!
Thanks.
There is an API for that, in your instance, from the browser go to:
sugarcrm/rest/v10/help
look for
POST /<module>/:record/link/:link_name/:remote_id
createRelatedLink
Relates an existing record to this module
or
POST /<module>/:record/link/:link_name
createRelatedRecord
Create a single record and relate it to this module
depending on whether you want to link an existing record or create a new record and link it
HTH
FrancescaS
Hi Bhavesh,
In a JS controller you execute something like:
var relatedModel = app.data.createRelatedBean(parentModel, model.id, link)
...
relatedModel.save(null, options);
link-action.js from the OOTB code does this, as well as page.js from the src directory in the
Sidecar Developer Tools: GitHub - sugarcrm/SidecarDevTools: Browser extension for Sugar 7 Sidecar framework development
Thanks Robert Bers
Thanks Robert Bers