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

    Zoho Marketing Automation
            • Sticky Posts

            • Authtoken Deprecation for Zoho Inventory APIs

              UPDATE (7 July 2021): We've extended the deadline to 30 August 2021 for converting Authtokens to OAuth.  Hello everyone,   The usage of Authtokens to authenticate API calls is being deprecated on 30 August 2021 across Zoho's Finance suite of products,
            • ZOHO Inventory - Early Access

              https://twitter.com/zoho/status/646715717849493504

            Zoho Pagesense Resources

              Zoho SalesIQ Resources



                    Zoho TeamInbox Resources

                      Zoho DataPrep Resources



                        Zoho CRM Plus Resources

                          Zoho Books Resources


                            Zoho Subscriptions Resources

                              Zoho Desk Resources

                                Zoho Projects Resources


                                  Zoho Sprints Resources


                                    Qntrl Resources


                                      Zoho Creator Resources


                                        Zoho WorkDrive Resources




                                            Zoho Campaigns Resources

                                              Zoho CRM Resources

                                                      Design. Discuss. Deliver.

                                                      Create visually engaging stories with Zoho Show.

                                                      Get Started Now