You need to sign in to do that
Don't have an account?
How can i remove duplicate product in my code?
My requirement is
I have 3 product in one object and 6 serial number in another object.. serial number related to product.. Datas are p1 -> s1,s2 p2 ->s3,s4 p3->s5,s6.. In my UI have 2 page block table.. 1st page block table I enter serial number s1,s2,s3 ... my 2nd pageblock wil display p1 and p2 ... but its display p1,p1 and p2.. duplicate value display.. How can I resolve this issue? my code is..
public void productadd (){
for(integer i=0;i<AssetAddList.size();i++ ){
ProductList = [select id,Product_Number__c,Product_Number__r.name,Serial_Number__c from Equipment_Master__c where Serial_Number__c =: AssetAddList[i].Serial_Number__c ];
serialIncConfigsItem[i].Product_Number__c = ProductList.Product_Number__c;
}
AssetAddlist - > Enter serial number page block table
serialIncConfigsItem -> display product
How can i remove duplicate product in my code?
Hi,
Could you please try below code snippet:-
Let me know if you still see issue.
Happy to help you!
All Answers
Hi,
Could you please try below code snippet:-
Let me know if you still see issue.
Happy to help you!
Thank u lot.. working fine
data display
pno
1
2
3
null
null
4
5
I want to display
1
2
3
4
5
Hi,
I did some modification, could you please try below code snippet:-
Let me know if you still have any issue.
Happy to help you!
Did it help you!
Thanks working fine now
I think query inside the for loop.. too many soql 101 error
Hi,
To solve this, we have to bulkify the query. Let me know if you need help on this.
In the meanwhile, if above modification regarding getting rid off 'NULL' elements helped you, could you please be kind enought to give me KUDOS for that.
Happy to help you!
bulify the quert means?????????
Hi,
Bulkify means, enable your code to handle bulk records and still don't hit governor limits. Do you want any help on this?
how can i enable?
Give me sometime, I will modify existing code so that you can use it.
Hey,
Could you please send me your complete trigger so that I can bulkify the whole trigger.