Skip to main content The Trailblazer Community will be unavailable from 2/1/2025 to 2/2/2025. Please plan your activities accordingly.
    public void addQuestion(){

        lstQuestion.add(new ObjectB__c(ObjectA__cId = Current_obj_Id));

       

        isEdit = true;

    

        } 

User-added image

User-added image
2 answers
  1. May 13, 2016, 5:14 AM
    Hi Sumit

    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.
Loading
0/9000