Workflow not triggering when record is created from function

Workflow not triggering when record is created from function

I have created a custom module (prospects) to copy required information from a lead to the prospect module. The reason for this is that I need to create a dashboard in Analytics to display all leads created in the day, week and month - when a lead is converted to an opportunity the lead is no longer seen by the dashboard. As a work around, everytime a lead is created, I have a workflow to trigger a function to copy the information over.

The problem is that I also need to update the prospect record if the lead is updated. I have created a second workflow and function to write the prospect ID back to the lead. However, the workflow is never triggered when the prospect record is created from the function. If I manually create a prospect and enter a valid LeadId, the lead is updated.

Is there a way to get this to work?

    Access your files securely from anywhere

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


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • 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