You need to sign in to do that
Don't have an account?
venkateshyadav1243
Trigger for preventing the duplicate records
Hi,
I have one opportunity for one opportunity i can add multiple products.
in my products i have one field descrption,for some products have descrption was same.
ex : for one opportunity i added 15 products in this 15 products,5 have descption "XXX"
5 have descption "yyy"
5 have descption "zzz"
i have one preview pdf button in my opportunity for showing the all products details,
right now am fetching all the 15 products descrption in my pdf.
i want show only 1 xxx,1 yyy,1 zzz, in preview pdf
Regards
Hi,
try like this, may be you are fetching all descriptions from all products under the opportunity record, so use the GroupBy in your query it will give distinct description values........
Hi,
Go step by step.
Fetch the record of current opportunity from opportunityLineItem , and this data may be helpful for you and
and group by Description using apex code the show the data in vf page, in page level show renderas="pdf"
Hi Venkat,
I hope this link helps you!
http://salesforcegirl.blogspot.in/2012/02/apex-trigger-to-prevent-duplicate.html
http://starrforce.com/2012/05/preventing-salesforce-duplicates/
Please accept my answer as a solution if my solution was helpful. This will make it available to others as a proper answer. If you felt that I went above and beyond please give me Kudos by clicking on on the star icon.
Thanks,
Cool Sfdc