The SugarCRM Community is now "read-only" to prepare for the SugarClub launch on August 3. Please visit
Announcing SugarClub - Are you in? for more information.
How to get another module's field value by using this.model.get ??
I dont know if you can. But you can create beans of the module you want to.
var bean = app.data.createBean('MODULE_NAME', 'ID_OF_RECORD');
hope it helps
those modules are at the same view, one is the record and the other one is subpanel. if it possible?
From which view you want to read the subpanel records?
I think you can get the records in the subpanel from the subpanel-list.js
var field = model.get("field");
that way you will get the model for each row of the subpanel list in that record.
for further detail
we would like to get a field value from one of the subpanel list from a custom module which is within a drawer.
The draw will open with the custom module and the value of the field from one of the subpanel list will show in the custom module within the drawer.
You can create a non-db field via vardefs then you can create an ApiHelper to populate the value of that non-db field.
Go to modules/Conacts/ContactsApiHelper.php that's an example. But instead you would use the formatForApi method
Thanks, but I would like to get the value dynamically, like creating a pointer from another module and get the value of another module each time when I trigger an action.
Any advise? Thanks!!
I didnt know about this.model.get but you can get another module field value in hook logic's quite easy by doing this
$n = new Contacts;
$n->name = $bean->name;
$n->description = $bean->description;
I hope it helps Thankyou M.Umar Akhlaq
Retrieving data ...