String attachmentLinks = '';
if(!commAttList.isEmpty()){ Database.insert(commAttList,false);
} return attachmentLinks;
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityString attachmentLinks = '';
if(!commAttList.isEmpty()){ Database.insert(commAttList,false);
} return attachmentLinks;
If you are building a managed package, or operating in a context where FLS and CRUD enforcement is required, which seems to be the case because you are using a static analyzer that enforces it, you must write code to validate the user's permission to perform DML operations and to access specific schema elements.
The approach to doing so in Apex is covered well in this Trailhead module, part of a longer trail that is well worth taking on building secure applications on the Salesforce platform.