unable to remove revenue lines using groovy
Summary:
We want to delete revenue line using groovy scripting when a new revenue line is added for the same Opportunity.
Scenario is: For example we have an Opportunity and it has 3 revenue lines where Product Groups as "A, B @& C" and we have custom field called "Group Number" with blank value.
Later when user added one more revenue line with Product Group as "A" and at this time user updated "Group Number" as "1234". we want to delete the existing revenue line where the "Product Group" is "A" and "Group Number" is blank.
We added below script at "AfterTransactionPosted " at "Opportunity Revenue"