• Tony Tuan
  • NEWBIE
  • 0 Points
  • Member since 2012
  • Salesforce Technical Lead
  • Sqware Peg


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

It appears that if you have a master detail, the currency of the detail objects is NOT determined by the parent... Anyone has an easy solution for it? It seems strange to me that this wasn't standard behaviour.

Am getting the following error in POST http method.

 

Error: CSRF token validation failed and System.HttpResponse[Status=Forbidden, StatusCode=403]"|0x43de18c1

 

I have two http request, 1. GET and 2. POST. Please review my code below and let me know where am missing.

 

GET:

    Http h = new Http();
    // Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
    HttpRequest req = new HttpRequest();
    req.setHeader('Content-Type', 'application/atom+xml');    
    req.setHeader('x-csrf-token', 'fetch');
    req.setHeader('Authorization', 'BASIC ' + EncodingUtil.base64Encode(Blob.valueOf('username:pasword')));
    req.setMethod('GET');
    req.setEndpoint(url1);
    HttpResponse res = h.send(req);


POST: Using the above response and passing the CSRF token to my POST method,


        req.setHeader('Content-Type', 'application/atom+xml');
        req.setHeader('X-CSRF-Token',maptoken.get('x-csrf-token'));   
        req.setHeader('Authorization', 'BASIC ' + EncodingUtil.base64Encode(Blob.valueOf('username:pasword')));
        req.setMethod('POST');
        req.setEndpoint(url2);     
        req.setBody('xml hard coded');
        HttpResponse ires = h.send(req);

  • November 27, 2012
  • Like
  • 0

Hi All,

 

What is the best way to deploy profiles from a sandbox to production, when the profiles in production changed since the last refresh & profiles in sandbox gained additional settings since the refresh?

How to 'add up' to prod without overwriting the existing settings?

 

Thanks in Advance