• Ravali RP
  • NEWBIE
  • 20 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I have custom object called 'Mall'. Once users have selected the Malls, there would be a button on the top right that says "Add to Account".
When the user clicks the button, it will ask them to select an account (they will be able to search accounts). Once they select an Account, there will be a button that says 'Add'. 
When they click add, the Malls that they selected on the list view would be added to the selected account they chose. 





How can I achieve this functionality in Lightening ?User-added image
hi everyone,

I am calling an API with Authtoken in header :
        String resp = 'response : ';
        HttpRequest req = new HttpRequest();
        JSONGenerator gen = JSON.createGenerator(false);
        JSONGenerator gen = JSON.createGenerator(false);
  		String  url = 'http://api.xxxxx.com/xx/xxx/xxx';
        
        	req.setEndpoint(url);
			String reqJSON;
                        gen.writeStartObject();
                        gen.writeStringField ('transaction_id', txnID);
                        gen.writeEndObject();
                        
                        // Get the JSON string.
                        reqJSON = gen.getAsString();        
	        req.setBody(reqJSON);
			req.setEndpoint (url);
	        req.setHeader('Authorization', 'Token xxxxxxxxxxxxxxxxxxxxxxxx');
        
                        req.setMethod ('GET');
                        req.setHeader('Content-Type', 'application/json');
                        req.setHeader('Accept', 'application/json');
                        req.setBody(reqJSON);
                        req.setTimeout(60000);
                      // Get response

        httpResponse res = new http().send(req);
		resp = resp + ' : ' + res.getBody() + ' - '  + res.toString();
	    ApexPages.addMessage(new ApexPages.Message( ApexPages.Severity.info,resp));
but the output i am able to see is this 
response : : - System.HttpResponse[Status=Moved Permanently, StatusCode=301]
​what may be the issue here ,
  • I have checked the API , its working fine on Postman and other platform.
  • I have added the api url on Remote Sites.
Is there any thing else i am missing here ?