Skip to main content
Preyanka Ghosh a posé une question dans #Apex
Hi  

I am facing issue while try to assign a value in an array that was declared in WSDL2Apex class. The array was declare like below in WSDL2Apex class

public testtempuriOrg.question[] question;

where question is another class and have some string variable declared. But when i try to assign the question value in testtempuriOrg.question[] from another class I get the error message "System.NullPointerException: Attempt to de-reference a null object"

Please help want need to do...

Thanks
1 réponse
  1. 4 août 2016, 07:16

    Try this 

    // First you have to populate question

    YourOtherClass.Queston q = new YourOtherClass.Question();

    // Create Array of Question

    List<YourOtherClass.Queston> qList = new List<YourOtherClass.Question>();

    // Add Item into list

    qList.add(q);

    // Assign it to your variable

    // I guess testtempuriOrg and YourOtherClass might be same

    testtempuriOrg.Question[] question = new List<testtempuriOrg.Question>();

    question = qList;

     
0/9000