Hi,
I need to have custom search in “Add invitees” section based on company selected in the “related to” field. For my scenario, I need Accounts_contacts table to get the list of contacts associated with the selected company.
On doing a workaround, I’m able to pass the parent id of the company to the Ajax call (json_server.php) successfully.
But I’m struck in altering the modules passed to the search query, by default code
if(form.search_last_name.value!=''){conditions[conditions.length]={"name":"last_name","op":"starts_with","value":form.search_last_name.value}}
if(form.search_email.value!=''){conditions[conditions.length]={"name":"email1","op":"starts_with","value":form.search_email.value}}
var query={"modules":["Users","Contacts","Leads"],"group":"and","field_list":['id','full_name','email1','phone_work'],"conditions":conditions};
global_request_registry[req_count]=[this,'display'];
req_id=global_rpcClient.call_method('query',query);
If I add var query={“modules”:[“Users”,“Contacts”,“Leads”, “Accounts_contacts”] like this, I’m getting error because there is no module called “Accounts_contacts”.
Please suggest some solution on how to get only contacts that are associated with the selected company.
Thanks