• Er. Prashant Veer Singh
  • NEWBIE
  • 4 Points
  • Member since 2017
  • Salesforce Developer

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies
I am trying error in below code:

string access_token;
string tweets;
String keyencoded = EncodingUtil.urlEncode('CYXp886M6g04xwouOHLYg4UJf','UTF-8');
    String secretkeyencoded = EncodingUtil.urlEncode('5qC4A3JZDF8you0VtKx95AJqROlXi2oihTkJgVNNsv8pVQ2cjT', 'UTF-8');
    String sFinal = keyencoded + ':' + secretkeyencoded;
    Blob headerValue = Blob.valueOf(sFinal);
    HttpRequest req = new HttpRequest();
    req.setEndpoint('https://api.twitter.com/oauth2/token');
    req.setMethod('POST');
    String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
    req.setHeader('Authorization', authorizationHeader);
    req.setBody('grant_type=client_credentials');
    Http http = new Http();
    HTTPResponse res = http.send(req);

    JSONParser parser = JSON.createParser(res.getBody());
    while(parser.nextToken() != null)
    {
        if(parser.getCurrentToken() == JSONToken.FIELD_NAME)
        {
            String fieldName = parser.getText();
            parser.nextToken();
            if(fieldName == 'access_token')
            {
                access_token = parser.getText();
            }

        }
    }
    
    Http http1 =new Http();
    HttpRequest request=new HttpRequest();
    request.setEndpoint('https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=virendersehwag');
    request.setMethod('GET');
    string authorizationHeader1 ='Bearer'+access_token;
    request.setHeader('Authorization',authorizationHeader1);
    HTTPResponse response=http1.send(request);

    if(response.getStatusCode()==200)
    {
    Map<string,object>results=(Map<string, Object>)JSON.deserializeUntyped(response.getBody());
    List<object>a=(List<object>)results.get('text');
    system.debug(results);
    system.debug(a);
    }  
string access_token;

String keyencoded = EncodingUtil.urlEncode('CYXp886M6g04xwouOHLYg4UJf','UTF-8');
    String secretkeyencoded = EncodingUtil.urlEncode('5qC4A3JZDF8you0VtKx95AJqROlXi2oihTkJgVNNsv8pVQ2cjT', 'UTF-8');
    String sFinal = keyencoded + ':' + secretkeyencoded;
    Blob headerValue = Blob.valueOf(sFinal);
    HttpRequest req = new HttpRequest();
    req.setEndpoint('https://api.twitter.com/oauth2/token');
    req.setMethod('POST');
    String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
    req.setHeader('Authorization', authorizationHeader);
    req.setBody('grant_type=client_credentials');
    Http http = new Http();
    HTTPResponse res = http.send(req);

    JSONParser parser = JSON.createParser(res.getBody());
    while(parser.nextToken() != null)
    {
        if(parser.getCurrentToken() == JSONToken.FIELD_NAME)
        {
            String fieldName = parser.getText();
            parser.nextToken();
            if(fieldName == 'access_token')
            {
                access_token = parser.getText();
            }

        }
    }
    
    Http http1 =new Http();
    HttpRequest request=new HttpRequest();
    request.setEndpoint('https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=virendersehwag');
    request.setMethod('GET');
    string authorizationHeader1 ='Bearer'+access_token;
    request.setHeader('Authorization',authorizationHeader1);
    HTTPResponse response=http1.send(request);
    if(response.getStatusCode()==200)
    {
    Map<string,object>results=(Map<string, Object>)JSON.deserializeUntyped(response.getBody());
    List<object>a=(List<object>)results.get('text');
    system.debug(results);
    
    }
AJAX Toolkit Shell

Features: autocompletion of property names with Tab, multiline input with Shift+Enter, input history with Up/Down
Values and functions: ans, print(string), props(object), blink(node), clear(), load(scriptURL), scope(object)
While trying to push code using SFDX. I am getting below error. Please help if any one faced this error.


WARNING: apiVersion configuration overridden at 44.0
PROJECT PATH ERROR
──────────── ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
N/A An object 'OrgComparer' of type LightningComponentBundle was named in package.xml, but was not found in zipped directory
02:26:12.128 sfdx force:source:push ended with exit code 1
Hi all,
We created a community and we need users to have the link send when they asked to change a password/forgot password to be active more than one click.
So we checked this checkbox on the profil of our users : "Don't immediately expire links in forgot password emails".
This checkbox generated an intermediate page call "change password interstitial" (ForgotPasswordInterstitial). We need to customize this page so the design fits the one we set in our community. But we can't find it, either in the builder or in the visualforce pages for the community. 
Does someone knows how we can customize this page ?
thanks
 
Hi,

We have a need to call a queueable apex class from a trigger after insert. Would it be possible to do the following below as we need to also do chaining? We need to perform updates to different objects in consecutive order so wanted to use a queue. 
trigger SomeTrigger on CustomObject__c (after insert) {
       System.enqueuejob(new  QueueClass1(Trigger.new))
}

public class QueueClass1 implements Queueable {
              private List<CustomOBject__c> objs;
              
              public QueueClass1(List<CustomObject> recs) {
                            this.objs = recs;
              }
              
               public void execute(QueueableContext queCont) {
                            //execute some logic on objs list
                            //perform update

                          //call second queueable apex job
                         System.enqueueJob(new QueueClass2(recs));
               }

}

public class QueueClass2 implements Queueable {
              private List<CustomOBject__c> objs;
              
              public QueueClass2(List<CustomObject> recs) {
                            this.objs = recs;
              }
              
               public void execute(QueueableContext queCont) {
                            //execute other logic on objs list
                            //create records for another objects
                            List<Account> acnts; //acnts list is populated based on logic executed in the "other logic"
                             insert acnts;
               }

}

 
  • April 03, 2017
  • Like
  • 0
We recently inactivated the previous system admin but am now noticing some APEX Jobs that are failing. They are all related to managed packages for the NPSP. How can I replace his name with mine so the jobs continue to run as would rather not keep is ID active. 
I need to reconfigure my Single Sign On settings because our company is being split into two, and we will no longer have access to the current ADFS server.

I am a Salesforce adminstrator and know nothing about Single Sign On settings; the new ADFS server is being set up by an IT engineer who knows nothing about Salesforce (and, it appears, not a huge amount about ADFS!). The IT person who set up our current ADFS server has moved on, but sent a link to a Developer Forum article on SSO configuration with ADFS - we have followed this, and a very good Youtube video as much as we can.

Although we have copied the old settings, both in Salesforce and on the ADFS server, we cannot get Single Sign On to work in our testing Sandbox.  Salesforce does not even seem to register that we have tried to log in using SSO (yes, i have edited My Domain page to allow ADFS login). The browser message received is a blank screen saying 'This page can't be displayed' with the URL the same as that we have provided on the SSO page for the Identity Provider Login URL.

1) Are there any known issues / qwerks about configuring SSO in a sandbox?
2) Do i need a new 'Request Signing Certificate' in my sandbox as we are currently using one duplicated from Production which contains the Production org ID number rather than the Sandbox org ID
3) Or do you think the problem lies in our setup of ADFS, in which case can you provide a suggestion what we might have missed?

Any help would be much appreciated. Thank you.
Hi All,

Can anyone please let me know how Salesforce Community User Authentication using username and password can be done using REST API?