You need to sign in to do that
Don't have an account?
Shawn Reichner 33
Delete existing Quote Lines when Importing Quote Lines
Hello, I am not sure if this is the correct topic to list this under, but I am certain what I am looking for will ulimately need some custom coding.
What I am being asked to find a potential solution for is for example: An existing quote already has quote lines present. A User wishes to update said quote by "Importing Quote lines" using an import format. When the import is used, they wish to have all existing quote lines be deleted and only the new lines from the import remaining.
Any thoughts on how to possibly achieve this?
Any help would be very much appreciated!
Shawn
What I am being asked to find a potential solution for is for example: An existing quote already has quote lines present. A User wishes to update said quote by "Importing Quote lines" using an import format. When the import is used, they wish to have all existing quote lines be deleted and only the new lines from the import remaining.
Any thoughts on how to possibly achieve this?
Any help would be very much appreciated!
Shawn
You need to follow the below steps:
- Create one new field on Line Items like Is Imported from Wizard.
- Ask the import wizard team to map this field as true for all the records that are imported from wizard.
- Add a after insert trigger, check if this field is true. If Yes, store the id of related Quote in a set.
- Once the loop is completed, deleted all the line items where Id IN: setOfQuoteIds pouplated in #3.
Let me know if you need any more information or help on this.Thanks,
Abhishek Bansal.
Gmail: abhibansal2790@gmail.com
Skype: abhishek.bansal2790
Phone: +917357512102
All Answers
You need to follow the below steps:
- Create one new field on Line Items like Is Imported from Wizard.
- Ask the import wizard team to map this field as true for all the records that are imported from wizard.
- Add a after insert trigger, check if this field is true. If Yes, store the id of related Quote in a set.
- Once the loop is completed, deleted all the line items where Id IN: setOfQuoteIds pouplated in #3.
Let me know if you need any more information or help on this.Thanks,
Abhishek Bansal.
Gmail: abhibansal2790@gmail.com
Skype: abhishek.bansal2790
Phone: +917357512102