Skip to main content
9 events
when toggle format what by license comment
Oct 30, 2017 at 21:16 comment added cropredy cool - glad you figured it out
Oct 30, 2017 at 20:15 vote accept Nate Briggs
Oct 30, 2017 at 20:15 answer added Nate Briggs timeline score: 1
Oct 30, 2017 at 20:13 comment added Nate Briggs I actually figured it out. We have a process that runs after I insert the QuoteLineItems, and because of the order in which I updated the opportunity with the quote id and inserted the QuoteLineItems, the line items were getting deleted because the opportunity didn't have a synced quote. I'll make an answer and choose it real quick.
Oct 30, 2017 at 16:23 comment added cropredy Since you are cloning the Opportunity but not OpportunityLineitems, is it possible that after cloning the Quote and QuoteLineItems that you have a process that runs later in time that copies the cloned Oppo's line items to the cloned quote's line items? -- and since the cloned Oppo has no line items, it wipes out the cloned quote's line items
Oct 30, 2017 at 15:46 comment added Nate Briggs I updated the code to include a try catch and a savepoint rollback, but it's not throwing anything. The page loads normally, and it takes me to the cloned Opportunity with the cloned Quote, but without any cloned QuoteLineItems even though the debug logs state that the QuoteLineItems cloned and inserted successfully.
Oct 27, 2017 at 0:07 answer added David Cheng timeline score: 0
Oct 27, 2017 at 0:03 comment added cropredy You are masking the error - (1) wrap your DML logic in try-catch; (2) before trying, set a savepoint; in the catch, if an error, do a rollback; (3) in the catch, generate an apexPages.Message, return null and be sure you have <apex:pageMessages> on your VF page
Oct 26, 2017 at 20:16 history asked Nate Briggs CC BY-SA 3.0