Pass connection to use for a function as a parameter
Hello,
I basically have a custom function that does some CRM queries on a specific Lead ID. I basically call in my custom function:
- zoho.crm.searchRecords(....., "THE_CRM_CONNECTION_TO_USE")
Since i have a production environment and several sandboxes to test things on and i would like to reuse those functions everywhere I tried to pass in instead of the connection string a variable that i would get as a parameter to the function. Every time i tried to do that upon hitting the save function button i get an error telling me that the connection i provided doesn't exist "although i haven't specified it yet as it will be specified with the function would run. Here is an example:
- // this works when i pass in the predefined connection string literally.
void function test_dynamic_connection(int id) { zoho.crm.getRecordById("Leads", id, Map(), "MY_PREDEFINED_CRM_CONNECTION");
}
// This doesn't work when i pass it dynamically
void function test_dynamic_connection(int id, string connection) { zoho.crm.getRecordById("Leads", id, Map(), connection);
}
My question would be if there is a way to pass the connection dynamically so i can share my custom functions between different sandboxes ( each with it's own connection) or not.
Thanks in advance.
Regards,
K. Mansour
Access your files securely from anywhere
Zoho Developer Community
Deliver unforgettable customer experiences
Deliver unforgettable customer experiences
New to Zoho Marketing Plus?
Everything you need to run your marketing
New to Zoho Marketing Plus?
Everything you need to run your marketing
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho TeamInbox Resources
Zoho DataPrep Resources
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Qntrl Resources
Zoho Creator Resources
Zoho Campaigns Resources
Zoho CRM Resources
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.