Value is empty and 'get' function cannot be applied Line Number:11
Hi Everyone,
I wrote a custom code to check if leads are referred and to check if the client who referred the lead exist, i had used single line field to check who is the client who has referred. everything was working fine with the code after i used a lookup field to auto search the client and then the code started giving issue, it gives all the details proper but it doesn't function and gives the issue "value is empty", below is my code, please check and let me know.
- get_records = zoho.crm.getRecords("Leads");
- get_client_records = zoho.crm.getRecords("Contacts");
- sum = 0;
- for each all_records in get_records
- {
- get_lead_name = all_records.get("Full_Name");
- // this checks if the lead has been affiliated by existing client//
- get_affiliate_status = all_records.get("Affiliate");
- get_affiliate_data = all_records.get("Affiliate_Name");
- get_affiliate_name = get_affiliate_data.get("name");
- get_affiliate_id = get_affiliate_data.get("id");
-
-
- if(get_affiliate_status=="Yes")
- {
- // info get_lead_name;
- info get_affiliate_name;
- if(get_affiliate_name == "shivani pandey")
- {
- info get_lead_name;
-
- sum = sum + get_lead_name.size();
- check_Contact = "shivani pandey";
- convert_contact = check_Contact.toList(" ");
- first_contact_name = convert_contact.get(0);
- last_contact_name = convert_contact.get(1);
- criteria_check_first_name = "(First_Name:equals:" + first_contact_name + ")";
- criteria_check_last_name = "(Last_Name:equals:" + last_contact_name + ")";
- search_contact = zoho.crm.searchRecords("Contacts",criteria_check_first_name + criteria_check_last_name);
-
- for each client_id in get_client_records
- {
- if(search_contact.isEmpty())
- {
- info "not empty";
- }
- else
- {
-
- client_first_name = client_id.get("First_Name");
- client_last_name = client_id.get("Last_Name");
- // info client_first_name.size();
- if(client_first_name = "shivani" && client_last_name == "pandey")
- {
- contact_id = client_id.get("id");
-
- }
- }
- }
- }
- }
- }