1

We have a rather typical requirement at a first glance - just to make bunch of records from external mysql database available in clients' sf orgs. And we are giving a short to SF External Object as an out-of-the-box solution for such use case.

The challenge here is that for each specific client's org we need to make available only a subset of records from that mysql table. We may say that we have 'orgId' column in that mysql table, and requirement is to let org see only its own records.

Is there any way to achieve this still with the help of external objects? Filtering objects on SF org side is not an option for us, cause it's sensitive data and they should not be accessible for other orgs at all, except the specified one.

Any help would be appreciated.

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 orgId filter.

| improve this answer | |
  • We are using Skyvia, but there is no way to define filtering there. Any examples of better oData providers, which supports such kind of filtering? – wesaw Aug 19 '19 at 20:18
  • Try Mulesoft + plugin. You'll be essentially implementing this filter yourself on top of their plugin. The other solution is to create a bunch of views in MySQL. How dynamic or material of a view is needed would depend on your data/data model...but this might be an easier option, lots of choices there. – identigral Aug 19 '19 at 20:26
  • 1
    Thought about views in MySQL as one of the first idea. Unfortunately, clients are adding/removing orgs periodically, so it would be not very convenient to go every time and create new view for each new org. Will take a look in Mulesoft option, thanks. – wesaw Aug 19 '19 at 20:30
0

You have to go all custom. Provide no Acess to that External object on profile level. Create custom lightning components for the view and in apex add proper filter to show the data that you want.

This might just outway the benefit of using lightning connect in the first place.

There might be another way. Lightning connect uses Odata protocol, if you can set up a Middleware in between that will add filter on the fly and then select the rows that you want for your org.

Anywho, there seems to be steep development before you can proceed with this solution.

| improve this answer | |
  • Based on our security requirement, it's not acceptable for data to make it to client org if they are not intended for that org. That's why it's too late to filter data at Lightnign UI level etc. – wesaw Aug 19 '19 at 20:21
  • Filters from soql get applied to mysql database so there is no way rows arr coming to sf except standard ui. Thats why I said you have to go custom – Pranay Jaiswal Aug 19 '19 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.