You need to sign in to do that
Don't have an account?
Brian Cherry FWI
Above is my class. What I'm trying to accomplish is for the url parameter cid = Professional_Services_Partner_Contract__c for every row that is inserted. I keep getting this error: Error: Compile Error: Initial term of field expression must be a concrete SObject: List<Professional_Services_Partner_Line_Items__c> at line 10 column 9. Can anyone point me in the right direction?
Best,
Brian
Multiple Related List Records Add
public class AddingLineItemsController { public List<Professional_Services_Partner_Line_Items__C> LineItems {get;set;} public Integer rowNum{get;set;} public AddingLineItemsController (){ LineItems = new List<Professional_Services_Partner_Line_Items__c>(); LineItems.add(new Professional_Services_Partner_Line_Items__c()); } public void insertLineItems(){ LineItems.Professional_Services_Partner_Contract__c = ApexPages.currentPage().getParameters().get('cid'); insert LineItems; } public void insertRow(){ LineItems.add(new Professional_Services_Partner_Line_Items__c()); } public void delRow(){ rowNum = Integer.valueOf(apexpages.currentpage().getparameters().get('index')); LineItems.remove(rowNum); } }
Above is my class. What I'm trying to accomplish is for the url parameter cid = Professional_Services_Partner_Contract__c for every row that is inserted. I keep getting this error: Error: Compile Error: Initial term of field expression must be a concrete SObject: List<Professional_Services_Partner_Line_Items__c> at line 10 column 9. Can anyone point me in the right direction?
Best,
Brian
LineItems[0] = new Professional_Services_Partner_Line_Items__C();
LineItems[0].Professional_Services_Partner_Contract__c = ...
For that you might do something like this:
Integer size = LineItems.size();
if (size > 0) {
LineItems[size-1].test_Object__c = ApexPages.currentPage().getParameters().get('cid');
}