How to modify/get custom relate field in record.js

Hi All

How to get custom relate field id in record.js

i have one contact relate field & one account relate field on case recordview  so when i have select one contact

1. how to get that contact ID. ??

2. how to modify / Set Account relate field based on Contact selected.. ??

and How to get Selected Contact Bean for fetching other contact details. ??

Ajay Kumar

Parents
  • cont_id = this.model.get('contacts_cases_1contacts_ida');

           

            var ContactBean = SUGAR.App.data.createBean('Contacts', {id:cont_id}); 

            ContactBean.fetch({'success':function () { 

                  designation = ContactBean.get('title'); 

                  comp_type  = ContactBean.get('type_of_account_c');

               

                  acc_id = ContactBean.get('account_id');

                  acc_name = ContactBean.get('account_name');

                model.set('sup_desgn_c',designation);

                model.set('company_type_c',comp_type);

                model.set('account_id',acc_id);

                model.set('account_name',acc_name);

              

           }});

  • Thanks, I was doing similar with TaxRates in Quotes 7.9. I was thinking that setting the id would be enough, but I now see the name (and any other properties being pulled through such as taxrate_value) need to be returned.

Reply Children
No Data