Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Giving Apex Violation Error When Run SF SCANNER DFA Run Even Apply with Security Keywords In Queries #44

Open
niteshlande opened this issue Feb 7, 2024 · 2 comments
Labels
BUG P2 Malfunctioning Often

Comments

@niteshlande
Copy link

When I Scan My VS Code Local Code with Salesforce Code Analyzer using the Below Command
sf scanner run dfa --format=csv --outfile=CodeAnalyzerDFA.csv --target="./" --projectdir="./" --category="Security"

I Got Salesforce Graph Engine couldn't resolve the parameter passed to [READ] operation with field(s) [Unknown]. Could you confirm that this operation has the necessary FLS checks? Error On Queries Method,
But In Checkmarks Reports it is not showing any error.
I am Scanning this Report For a salesforce Security Check for App Exchange.

My Queries Method:

@AuraEnabled(cacheable=true)
public static List getOrderItemRelatedToOrder(List newOrders) {
Set orderIdSet = new Set();
Set orItemFields = Constants.ORDITM_FIELD_LIST;
for(Order orderRecord : newOrders) {
if (orderRecord.Id != null) {
orderIdSet.add(orderRecord.Id);
}
}
String query =
'SELECT ' +
String.join(new List(orItemFields), ', ') +
' FROM OrderItem WHERE OrderId IN :orderIdSet WITH SECURITY_ENFORCED';
return Database.query(String.escapeSingleQuotes(query));
}

@rmohan20
Copy link

Hi @niteshlande - thanks for reporting. Graph Engine has a known issue where it can't parse String objects constructed with + operator. We'll keep this open and report back when we prioritize and fix this issue.

@rmohan20 rmohan20 added the BUG P2 Malfunctioning Often label Feb 14, 2024
Copy link

git2gus bot commented Feb 14, 2024

This issue has been linked to a new work item: W-15045083

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG P2 Malfunctioning Often
Projects
None yet
Development

No branches or pull requests

2 participants