How do I write custom function to delete a sales order's line item if the line item meets a certain criteria?

How do I write custom function to delete a sales order's line item if the line item meets a certain criteria?

Hello, 

We recently started using an add-on app with our Shopify, called Bundleup. This app is a game changer for us.  It runs an unbundling feature that unbundles any bundled item on an order. The bundle item (which for us is a Kit) is removed from the order and the constituents of the bundle are added.  However, when the sales order is created in Zoho, the constituents AND the bundle item are on the order. 

I am not sure why the removed item shows up on the sales order.  I do not think it has to do with the timing of the sync that occurs.  

So, I would like to create a custom function that triggers upon the creation of a sales order.  Then, if any of the items on the order meet the criteria (Bundle Item) it gets removed from the sales order.  I need this to execute before our other custom function that invoices the sales order.  

Look forward to hearing a solution that will help us to resolve this issue. 

Thanks!
Amanda

    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