You need to sign in to do that
Don't have an account?
Rupali Pophaliya
FLS checking for Dynamic SOQL string
Hi,
In our one of appexchange app, we have exposed REST webservice. Here, user just passes the SOQL string to our expose REST API and in the form of response we are returning records.
As this is a part of appexchange, so its mandatory to do FLS checking, but as per our application scope SOQL string is generating outside Salesforce and user just passes SOQL string to my Salesforce Webservice, so I am wondering how we can do FLS checking for dynamic SOQL string.
Thanks,
Rupali
In our one of appexchange app, we have exposed REST webservice. Here, user just passes the SOQL string to our expose REST API and in the form of response we are returning records.
As this is a part of appexchange, so its mandatory to do FLS checking, but as per our application scope SOQL string is generating outside Salesforce and user just passes SOQL string to my Salesforce Webservice, so I am wondering how we can do FLS checking for dynamic SOQL string.
Thanks,
Rupali
Otherwise you may need to parse out the fields from the SOQL query. That could be difficult depending on the complexity of the query.
Thanks for your reply.
Do you mean we have to take fields and object as JSON input and generate query in Salesforce webservice? If yes, then we have handle many things, so are as below:
a) Relation/nested query
b) Where clause condition, it can be inner outer
c) OFFSET and LIMIT part
etc.
For above implementation its require long time, it would be great if you have any reference / blog where I can refer query generation.
Thanks,
Rupali
I don't have any explictiy examples of doing this other than fairly trivial. I did find the apex-commons soql-builder (http://apex-commons.github.io/query/soql-builder/).
yes I am agree with Daniel, as it will be very trick if you want to parse the simple SOQL string from the user. As he can use any field which even will not exist in the ORG.
Better to give him a screen to build a SOQL query there you can show him all the meta data as like in Workbench.
Thanks,
Arun