You need to sign in to do that
Don't have an account?
how to using set Remove duplicate values for this code?
public List<Equipment_Master__c> ProductList{ get; set;}
public List<Equipment_Master__c> ProductListadd{ get; set;}
Set<Equipment_Master__c> setEquipment = new Set<Equipment_Master__c>();
List<Equipment_Master__c> productresults;
public pagereference productadd (){
for(integer i=0;i<AssetAddList.size();i++ ){
ProductList = [select Product_Number__c from Equipment_Master__c where Serial_Number__c =: AssetAddList[i].Serial_Number__c];
setEquipment.add(ProductList[i].Product_Number__c);
ProductListadd.add(setEquipment); -- How can i add a product list value in productlistadd?
}
}
public List<Equipment_Master__c> getproductresults(){
return ProductListadd;
}
<apex:pageBlockTable value="{!productresults}" var="pro">
<apex:column headerValue="Product Number">
<apex:inputField value="{!pro.id}"/>
</apex:column>
</apex:pageBlockTable>
ProductList - 1,1,2,3,4,5,2,4,2,3,2,4 - using set I want to distinct value
o/p - 1,2 3,4,5
Hi Diya,
Based upon content of your controller, I have made some changes and following controller should give you desired result:-
Also, your part of VF page may look like:-
Hope it will help you!
Happy to help you!
Regards,
Digamber Prasad