I need some help.
I want to fetch the parent account from the account module.
In Potential module, I have created a custom link which redirect me to zoho creator.
In zoho creator, I have created a function in which i had passed potential id from crm and based on it i am fetching account id and account information from this account id. In Account module, I have parent account field which is lookup of account module. A account can belongs to one parent account but a parent account can belongs to multiple account.
I want to fetch all the account name which is belonging to a Parent account and display them in dropdown in zoho creator. Please tell me how can i do this.
map default.fetchParentAccount(int potential_id)
{
accinfo=map();
crmResp = zoho.crm.getRecordById("Potentials",input.potential_id);
//info crmResp;
accid=crmResp.get("ACCOUNTID");
resp = zoho.crm.getRecordById(("Accounts"),accid.toLong());
//info resp;
acc_name=resp.get(("Account Name"));
parent_account_id=resp.get("PARENTACCOUNTID");
parent_account = zoho.crm.getRecordById(("Accounts"),input.parent_account_id.toLong());
//parent_account = zoho.crm.getrelatedrecords("Accounts","Accounts",input.potential_id.toString());
info parent_account;
accountid=parent_account.get("ACCOUNTID");
account_name=parent_account.get("Account Name");
accinfo.put("ACCOUNTID",accountid);
accinfo.put("ACCOUNTNAME",account_name);
return accinfo;
}
It always show one record.