• Dileep Singhal 18
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I have simply override NEW button of custom object by a lightning component bundle. On that component have added few control to take input from user. When i run this component into lightning app the background color comes as a white while the same i run on the button Action then background color become sky blue. I wanted to know is there any workaround/setting available through which i can control backgound color when page run on button action. Actually i want background as white for the whole screen

Your help will be appreciated.



 
Hi,
I am trying to call api using executeAPI method. The response is jobid. Now, I am checking whether the job is completed or not using checkStatus method continuously in while loop. It will take around 5 min to complete the job.
 
Public class PageController{

        public static String getMethod(String instance_url,String token){
        Http http = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(instance_url);
        req.setMethod('GET');
        req.setHeader('Authorization', 'Bearer '+token);

        HTTPResponse res = http.send(req);
        String json1 = res.getBody();
        return json1;        
    }

    public static void executeAPI(String token){ 
    String instance_url = 'https://api'; 
    String json1 = getMethod(instance_url, token); 
    return json1;
 }

      public static void checkStatus(String jobid,String token){
        String instance_url = 'https://api/job/status/'+jobid;
        String json1 = getMethod(instance_url, token);
        Map<String, Object> data1 = (Map<String, Object>) JSON.deserializeUntyped(json1);
        while(data1.get('isFinished') == False)
        {
           json1 = getMethod(instance_url, token);
           data1 = (Map<String, Object>) JSON.deserializeUntyped(json1);
        }
        System.debug('Success');
    }

    public static void mainFunction(){
      token = 'avdndbdn'
      String json1 = executeAPI(token)
      Map<String, Object> data1 = (Map<String, Object>) JSON.deserializeUntyped(json1);

     checkStatus(data1.get('JobId'),token)
     }

}

But, I am getting "System.LimitException: Too many callouts: 101 in API Call" error. Please help me.

Thanks and Regards,
Diwakar G
I have a lightning component that implements lightning:actionOverride how do I get the recordId of the parent when the action is triggered from a related list?