You need to sign in to do that
Don't have an account?
Edward chan
Need more details of the event
Hi,
Do you have more details to this method/event
products.add
which does appear below, from the Merchandise tutorial of Developer force?
public DisplayMerchandise[] getProducts() {
if (products == null) {
products = new DisplayMerchandise[]{};
for (Merchandise__c item :
[SELECT id, name, description__c, price__c
FROM Merchandise__c
WHERE Total_Inventory__c > 0]) {
products.add(new DisplayMerchandise(item));
}
}
return products;
}
Many Thanks & Best Regards,
Edward Chan
add() is a list method. In the above code sample, products is defined as List/Array of DisplayMerchandise type.
The statement
products.add(new DisplayMerchandise(item));
is adding elements to the list products. For more details on this method
Click the link
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_list.htm
Cheers!
The same you can find in salesforce pdf as well.
Search of 'List Methods' in salesforce_apex_language_reference.pdf
Hope it works!