Extension Pointers - Simple yet significant pointers #8: CRM variables

Extension Pointers - Simple yet significant pointers #8: CRM variables



Getting and setting CRM variable values in an extension
 
CRM variables come in handy when you need global access to a variable across an entire extension. There may also be a need for user-specific data, which the user must provide at the time of installation. CRM variables come in handy in these situations as well. Let's look at how and where you can get or set the value of a CRM variable in an extension.
  • Get org variable - Fetch the value of an org/CRM variable
  • Set org variable - Set the value of an org/CRM variable 
What are the options available to get or set values for a CRM variable?

1. In a custom function using Deluge tasks: When you need to get or set the value of a CRM variable in a custom function, you can use the Deluge tasks available.
 
 Get org variable - Syntax: 
<Response> = zoho.crm.getOrgVariable("<customVariableName>");
 
➤ Set org variable - Syntax: 
<Response> = zoho.crm.invokeConnector("crm.set", <valueMap Map>);
 
You can refer to this link for more details.
 
2. In widgets: When you need to get or set a CRM variable as part of the widget UI you are designing, then you can use the below syntax.
 
➤ Get org variable - Syntax: 
ZOHO.CRM.API.getOrgVariable("variableNamespace").then(function(data){
console.log(data);
});
 
You can refer to this link for more details.

➤ Set org variable - Syntax: 
var variableMap = { "apiname": "{crm variable API name}", "value": "{value}"};
ZOHO.CRM.CONNECTOR.invokeAPI("crm.set", variableMap);
 
SEE ALSO:
 
 

      Zoho Developer Community








                                Zoho Desk Resources

                                • Desk Community Learning Series


                                • Digest


                                • Functions


                                • Meetups


                                • Kbase


                                • Resources


                                • Glossary


                                • Desk Marketplace


                                • MVP Corner


                                • Word of the Day



                                    Zoho Marketing Automation


                                            Manage your brands on social media



                                                  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 WorkDrive Resources



                                                                      Zoho Campaigns Resources

                                                                        Zoho CRM Resources

                                                                        • CRM Community Learning Series

                                                                          CRM Community Learning Series


                                                                        • Tips

                                                                          Tips

                                                                        • Functions

                                                                          Functions

                                                                        • Meetups

                                                                          Meetups

                                                                        • Kbase

                                                                          Kbase

                                                                        • Resources

                                                                          Resources

                                                                        • Digest

                                                                          Digest

                                                                        • CRM Marketplace

                                                                          CRM Marketplace

                                                                        • MVP Corner

                                                                          MVP Corner







                                                                            Design. Discuss. Deliver.

                                                                            Create visually engaging stories with Zoho Show.

                                                                            Get Started Now