Update main form's Lookup value following the completion of a Subform within that same main form

Update main form's Lookup value following the completion of a Subform within that same main form

Hi,

It's quite a simple request but I'm struggling with getting the deluge to work smoothly.

In short, I have a main form (Place_New_Order). Public users will be able to use it.

They have a subform to complete with their contact details etc (name, email, phone, address) in this main form. The subform (CustomerSF) is a sub of another main form, 'Add_Customer.'

In the backend, I have a lookup to this same 'Add_Customer' field - this is what's visible when internal staff use the tool, as opposed to the subform. 

(Might not be the most efficient, but long story short, based on whether the form is completed by internal staff, or public, different fields are shown. Lookup is used for internal staff, subform is used for external public.)

In order for the completion of the main form to run smoothly (due to several workflows holding everything together), I need it so that the completion of the subform for Add_Customer, will:

(1) Compare the email address from the subform completion and see if a 'Customer' record already exists for it; 
(2a) If yes, just update the lookup to the relevant 'Customer' record inside the main form.
(2b) If no, create a new Customer record, and input that into the lookup field (all within the main Place_New_Order form.)

I'm sure this should be doable, but please let me know if what I'm asking is impossible. 

    Access your files securely from anywhere

        All-in-one knowledge management and training platform for your employees and customers.







                              Zoho Developer Community




                                                    • Desk Community Learning Series


                                                    • Digest


                                                    • Functions


                                                    • Meetups


                                                    • Kbase


                                                    • Resources


                                                    • Glossary


                                                    • Desk Marketplace


                                                    • MVP Corner


                                                    • Word of the Day


                                                    • Ask the Experts





                                                              Manage your brands on social media



                                                                    Zoho TeamInbox Resources



                                                                        Zoho CRM Plus Resources

                                                                          Zoho Books Resources


                                                                            Zoho Subscriptions Resources

                                                                              Zoho Projects Resources


                                                                                Zoho Sprints Resources


                                                                                  Qntrl Resources


                                                                                    Zoho Creator 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


                                                                                              Zoho Show Resources

                                                                                                Zoho Writer

                                                                                                Get Started. Write Away!

                                                                                                Writer is a powerful online word processor, designed for collaborative work.

                                                                                                  Zoho CRM コンテンツ



                                                                                                    Nederlandse Hulpbronnen


                                                                                                        ご検討中の方