• RPK
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 4
    Replies
Is there any to determine which object was created or updated and which fields were changed?

Any SOQL query or something? When user updates the record and clicks Save, immediately that query or code should fire and return me the Object name and corresponding fields which were changed.

I don't want to use Triggers because I want to implement this on all objects.
  • March 01, 2018
  • Like
  • 0
Is there any way to detect which object got changed? For example, if I added a new record in Customer, a trigger should fire and return me the newly added field values. It should return to an APEX class?

The problem with trigger is that it is limited to one object. I want to create a global trigger type of something. It should fire anytime a new insert finishes on any object.
  • February 27, 2018
  • Like
  • 0
I want to create a trigger when a new record is inserted. When this trigger is fired, it should create an XML file of that record.
  • February 27, 2018
  • Like
  • 0
When a new customer record or lead is created, I want to create an XML of this data and pass to an APEX class.

This APEX class should invoke an already consumed external REST API and pass this XML as parameter to that API.

Any sample?
  • February 27, 2018
  • Like
  • 0
My requirement is:
  1. I want to consume an external API in Salesforce.
  2. When a new record is created or updated, the data should be converted to XML.
  3. This XML should be passed to external API endpoint as parameter.
Please help.
  • February 26, 2018
  • Like
  • 0
I have a small requirement and I am new to Salesforce.
Whenever any new record is added in Salesforce or updated, the changes should be passed to my .NET API as XML data.

I want to know how to create an XML is Salesforce of the updated data and how to invoke the consumed API?
 
  • February 26, 2018
  • Like
  • 0
I want to insert XML data from .NET to Salesforce. Anyhelp on this?
As XML can be anything, under which Custom Object this data gets saved in Salesforce?
  • February 26, 2018
  • Like
  • 0
I created a ASP.NET webAPI which should retrieve sample data like sales lead, customer information etc. from Salesforce. I have created developer account which probably has some sample data.

I referred to the code in Force.com and modified as below. It is connecting but now I want to query for sales lead and any other information.
How to modify the query in the below code:
HttpClient authClient = new HttpClient();
            HttpClient queryClient = new HttpClient();

            //set OAuth key and secret variables
            string sfdcConsumerKey = client_id;
            string sfdcConsumerSecret = client_secret;

            //set to Force.com user account that has API access enabled
            string sfdcUserName = username;
            string sfdcPassword = password;
            string sfdcToken = "<My Token>";

            //create login password value
            string loginPassword = sfdcPassword + sfdcToken;

            HttpContent content = new FormUrlEncodedContent(new Dictionary<string,string>
                  {
                     {"grant_type","password"},
                     {"client_id",sfdcConsumerKey},
                     {"client_secret",sfdcConsumerSecret},
                     {"username",sfdcUserName},
                     {"password",loginPassword}
                   }
            );

            //HttpResponseMessage message1 = await authClient.PostAsync(authorization_url, content);
            HttpResponseMessage message = await authClient.PostAsync("https://login.salesforce.com/services/oauth2/token", content);

            string responseString = await message.Content.ReadAsStringAsync();

            JObject obj = JObject.Parse(responseString);
            oauthToken = (string)obj["access_token"];
            serviceUrl = (string)obj["instance_url"];


            // Get Records
            //QUERY: Retrieve records of type "account"
            string restQuery = serviceUrl + "services/data/v25.0/query?q=SELECT+name+from+Account";

            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, restQuery);

            //add token to header
            request.Headers.Add("Authorization", "Bearer " + oauthToken);

            //return JSON to the caller
            request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

            //call endpoint async
            HttpResponseMessage response = await queryClient.SendAsync(request);

            string result = await response.Content.ReadAsStringAsync();

As of now it is set to retrieve records of type 'Account'. How to modify the query to get other lead results?

 
  • February 25, 2018
  • Like
  • 0
I am trying to create a middleware between SAP and Salesforce. It is a .NET RESTful service. 

If SAP desires any data, it will pass parameters to my .NET API which in turn will query Salesforce for the same. It should fetch the data and return as XML to SAP.

My first step is to build a webAPI and fetch sample data (about 10-20 rows) from Salesforce developer account.

I referred to Salesforce documentation on how to setup Remote Access for external applications which uses oAuth. The Remote Access documentation page looks a bit obsolete.

I want to know whether I need to enable Remote Access first in Salesforce and expose endpoints for my .NET Service to consume it? Where can I find updated Remote Access oAuth documentation for interacting with the .NET webAPI?
  • February 24, 2018
  • Like
  • 0
Is there any to determine which object was created or updated and which fields were changed?

Any SOQL query or something? When user updates the record and clicks Save, immediately that query or code should fire and return me the Object name and corresponding fields which were changed.

I don't want to use Triggers because I want to implement this on all objects.
  • March 01, 2018
  • Like
  • 0
I want to create a trigger when a new record is inserted. When this trigger is fired, it should create an XML file of that record.
  • February 27, 2018
  • Like
  • 0
I created a ASP.NET webAPI which should retrieve sample data like sales lead, customer information etc. from Salesforce. I have created developer account which probably has some sample data.

I referred to the code in Force.com and modified as below. It is connecting but now I want to query for sales lead and any other information.
How to modify the query in the below code:
HttpClient authClient = new HttpClient();
            HttpClient queryClient = new HttpClient();

            //set OAuth key and secret variables
            string sfdcConsumerKey = client_id;
            string sfdcConsumerSecret = client_secret;

            //set to Force.com user account that has API access enabled
            string sfdcUserName = username;
            string sfdcPassword = password;
            string sfdcToken = "<My Token>";

            //create login password value
            string loginPassword = sfdcPassword + sfdcToken;

            HttpContent content = new FormUrlEncodedContent(new Dictionary<string,string>
                  {
                     {"grant_type","password"},
                     {"client_id",sfdcConsumerKey},
                     {"client_secret",sfdcConsumerSecret},
                     {"username",sfdcUserName},
                     {"password",loginPassword}
                   }
            );

            //HttpResponseMessage message1 = await authClient.PostAsync(authorization_url, content);
            HttpResponseMessage message = await authClient.PostAsync("https://login.salesforce.com/services/oauth2/token", content);

            string responseString = await message.Content.ReadAsStringAsync();

            JObject obj = JObject.Parse(responseString);
            oauthToken = (string)obj["access_token"];
            serviceUrl = (string)obj["instance_url"];


            // Get Records
            //QUERY: Retrieve records of type "account"
            string restQuery = serviceUrl + "services/data/v25.0/query?q=SELECT+name+from+Account";

            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, restQuery);

            //add token to header
            request.Headers.Add("Authorization", "Bearer " + oauthToken);

            //return JSON to the caller
            request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

            //call endpoint async
            HttpResponseMessage response = await queryClient.SendAsync(request);

            string result = await response.Content.ReadAsStringAsync();

As of now it is set to retrieve records of type 'Account'. How to modify the query to get other lead results?

 
  • February 25, 2018
  • Like
  • 0