You need to sign in to do that
Don't have an account?
MaggieSumit
Invalid field ObjectA__cId for SObject ObjectB__c
public void addQuestion(){
lstQuestion.add(new ObjectB__c(ObjectA__cId = Current_obj_Id));
isEdit = true;
}
lstQuestion.add(new ObjectB__c(ObjectA__cId = Current_obj_Id));
isEdit = true;
}
Please make small change in your code.
public void addQuestion(){
lstQuestion.add(new ObjectB__c(ObjectBLookup__c = Current_obj_Id));
isEdit = true;
}
You are using wrong name for lookup. In ObjectB the lookup name for objectA is ObjectBLookup__c. And you are using ObjectA__cId instead of ObjectBLookup__c
Let me know if it helps you out.
Peace.
All Answers
lstQuestion.add(new ObjectB__c(ObjectA__cId = Current_obj_Id));
Bolded statement is wrong.
Use Following sy
lstQuestion.add(new ObjectB__c(ObjectA__c = Current_obj_Id));
OR
lstQuestion.add(new ObjectB__c(ObjectA__c.id = Current_obj_Id));
Thanks.
Please make small change in your code.
public void addQuestion(){
lstQuestion.add(new ObjectB__c(ObjectBLookup__c = Current_obj_Id));
isEdit = true;
}
You are using wrong name for lookup. In ObjectB the lookup name for objectA is ObjectBLookup__c. And you are using ObjectA__cId instead of ObjectBLookup__c
Let me know if it helps you out.
Peace.