• Manish Verma 47
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi everyone, I am learning sales force and i want to create a Quiz form. So, I have created 2 static list, one for question and second for option. please see below.

public class Options {
    public integer Id;
    public string Option;
    public Boolean IsAnswer;
    public Integer QuestionId;
}

public class Questions {
    public integer Id;
    public string Question;
}

global with sharing class SurveyBackend
{  
    public List<Questions> questionsList {get;set;}
    public List<Options> optionsList {get;set;}
           
    public SurveyBackend()
    {       
        list<string> questList = new list<String>();
        questList.add('Questions1');
        questList.add('Questions2');
        questList.add('Questions3');
        questList.add('Questions4');
        questList.add('Questions5');
             
        for(integer i=0; i < 5; i++)
        {
            Questions questions =  new Questions();
            questions.Id = i;
            questions.Question = questList[i];
            questionsList.add(questions);
        }
       
        list<string> optList = new list<String>();
        optList.add('Stamp duties');
        optList.add('Excise duties on medical and toilet materials');
        optList.add('Sales tax');
        optList.add('a and b');
               
        for(integer i = 0; i < 5; i++)
        {
            Options options =  new Options();
            options.Id = i;
            options.Option = optList[i];
            options.IsAnswer = true;
            Options.QuestionId =i;
            optionsList.add(options);
        }
    }
}

Like I have added 5 questions in questionsList and 20 options (20/5). I am trying to create but i am facing some issues. So, please anybody can help me to know how to create nested loop on<APEX.Page>.and how to access 'Class type list' on <APEX.Page>.

 
Dear all, I`m new to Apex REST/SOAP web services world and I`m struggling with a project of integration. What I have a API documentation from client which contains cURL examples, fields and sample JSON response. My questions,
1) How should I start and how can I call this API data inside Salesforce? I need ability to pull and push the data into Salesforce.
2) Are there any changes that need to do in external API system or can I call web services directly in Salesforce if I have login ID and Password of API?
3) In integration projects like this, what should be first step? What information will I need from client to start the integration?
 
I have read few articles online on REST but none of the article provide real time examples. Can you Apex Gurus please help? Any help is much appreciated.