4

I could have users request a token every rest call and store them within the class and not within the custom setting You can take the advantages of both approaches. Set up your callout so you can use a token from within memory. If you need to update your setting, move that DML to the end of your transaction. Pseudo-code: String token = MySetting__c....


4

I've written a custom authprovider which I've shared "as-is" on Github. It implements both the Client Credentials and JWT Bearer variant (without a certificate). Feel free to fork from it. https://github.com/bobbywhitesfdc/ApigeeAuthProvider


2

There is huge difference between using flat file imports and Marketing Cloud Connector for Sales/Service Cloud. Flat file imports are good for batch imports, and are usually not real time. If you have a normalised data model, you will either need to have a file/Data Extension, or first denormalise into a single file and then normalise the data. You can work ...


2

Well, the solution was trivial. I was trying to use default login endpoint, turns out I should have been using my org's domain. So getting UserInfo is as simple as sending a GET request to: https://my-org-name.my.salesforce.com/services/oauth2/userinfo With either Authorization: Bearer TOKEN header or access_token=TOKEN GET param. Edit: well another ...


2

Did You enable it to external Data Source as well? To include an external object in SOSL and Salesforce searches, enable search on both the external object and the external data source. https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_sosl_limits_external_objects.htm


2

These examples were the most helpful for me (examples of SF Connect custom adapters for various web services including GitHub, Google Drive, and so on): https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connector_examples.htm?search_text=github When the platform calls the DataSource.Connection class's query method, the parameter ...


2

After contacting Salesforce Support, the Actual outcome presented in the above question is the expected functionality of how Salesforce Connect behaves when trying to view a single record. Since this isn't compliant with the standard OData specification on retrieving a single record, it is definitely something to keep in mind when designing an OData ...


1

External objects in Salesforce require an OData interface to the external data source. MySQL does not natively support OData, you need OData-speaking middleware that sits between SF and MySQL. There are commercial and OSS oData providers/libraries that help with this. Pick an OData provider that will let you define an OData service endpoint that includes the ...


1

You can create instances of the Connection classes and call method on it. Be sure to return a mock response for the API call in getResponse(). code: //sync StackOverflowDataSourceConnection conn = StackOverflowDataSourceConnection(null); conn.sync(); //query DataSource.QueryContext context = new DataSource.QueryContext(); context.tableSelection = new ...


1

Well, if you want to bypass the mandatory PageReference, you could redirect directly to the callback url created in your Auth Provider, example: global PageReference initiate(Map<string,string> authProviderConfiguration, String stateToPropagate) { new PageReference('https://....my.salesforce.com/services/authcallback/YOURAUTHPROVIDER?state=' + ...


1

Salesforce Premier Support has stated: The Custom Auth provider set up in Salesforce would not allow you to enter client credentials and login. The two posts below also confirm this: Custom Auth Provider usage for unattended OAuth flow Named Credentials and support for the OAuth2 Client Credentials Grant Type and alternatives As a solution to the ...


1

First, the OData model is a protocol; it expects to be able to call sub-resources of the specified URL and get specific responses back. For example, $metadata returns a list of objects/fields available in the resource. There's examples of doing this on this trailhead. OData doesn't work on static files, unless you have all the files in a specific format. ...


1

I had the same issue before and was able to resolve by going to the Lightning App Builder and creating a record page for the external object which I then added to my app. I think I also has to assign the page as the org default (or at least to my profile).


1

I found my error and resolved it. I was missing the appropriate "Capability Enum" (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_enum_DataSource_Capability.htm) value in the getCapabilities() method in my DataSource.Provider. So I went from override global List<DataSource.Capability> getCapabilities() { List<...


Only top voted, non community-wiki answers of a minimum length are eligible