• Nigel Reed
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Is Upsert available in Azure Logic Apps? I can only see the following.

The app has retrived records that need to be inserted or updated.

The Update record requires  Record Id, which is not available in the data that I have.

I am not sure how to perform logic to see if I need to update or Insert.
Many thanks for any help provided

SalesForce Actions
Hi guys

I'm trying to authenticate REST API with BizTalk through following article
https://developer.salesforce.com/page/Calling_the_Force.com_REST_API_from_BizTalk_Server

and I'm getting Session expired or invalid exception
<Error><errorCode>INVALID_SESSION_ID</errorCode><message>Session expired or invalid</message></Error>
 
Any help would be appreciated.
Thanks
Hi All,
I am getting Session invalid or session expires error when i am caaling one saleforce org from another salesforce org.
here my code for callout.

String content = '{"Name": "Some acoount", "Phone":"9742882954"}';
     HttpRequest req = new HttpRequest();
     req.setEndpoint('https://ap1.salesforce.com/services/apexrest/Accountacc');
     req.setMethod('POST');
     
     String username = 'sarvesh01@gmail.com';
     String password = 'parvati@3';
 
     Blob headerValue = Blob.valueOf(username + ':' + password);
     String authorizationHeader = 'BASIC ' +
     EncodingUtil.base64Encode(headerValue);
     req.SetBody(content);
     req.setHeader('Content-Type', 'application/json; charset=utf-8');
     req.setHeader('Authorization', authorizationHeader);
     req.setHeader('Authorization', 'OAuth '+UserInfo.getSessionId());    
     Http http = new Http();
     HTTPResponse res = http.send(req);
     System.debug(res.getBody());


my rest class in another salesforce org.
@RestResource(urlMapping='/Accountacc/*')  
 global with sharing class callAccount {  
  
  @HttpPost  
   global static String doPost() {  
         
     RestRequest request = RestContext.request;  
     RestResponse response = RestContext.response;  
     String jSONRequestBody=request.requestBody.toString().trim();  
     Account accObj = (Account)JSON.deserializeStrict(jSONRequestBody,Account.class);  
     insert accObj;  
     return accObj.Id;  
   }  
  @HttpGet  
   global static Account doGet() {  
   
     RestRequest request = RestContext.request;  
     RestResponse response = RestContext.response;  
     String accountId = request.requestURI.substring(request.requestURI.lastIndexOf('/')+1);  
     Account acc= [SELECT Id, Name, Phone, Website FROM Account WHERE Id = :accountId];  
     return acc;  
   }  
 }


Can any one help me out please........
Thanks,
sarvesh.