BP error : TwC: Validate data displayed in form is fetched using record level security. Dangerous API FormListItem used.

Hi,

We are getting this BP error “TwC: Validate data displayed in form is fetched using record level security. Dangerous API FormListItem used.” in a class.

Can you pls help me solving this error.

Regards

Sindhu

Is that a custom class?
Please see this, msdn.microsoft.com/…/aa625308.aspx

yes it is a custom class and we have already implemented the option which was suggested in the above link but still no luck.

Can you show the code?

perm = new ExecutePermission();
perm.assert();
formListItem = new FormListItem(conPeek(fieldIdList, i), imageListAppl_Query.image(#ImageField));
CodeAccessPermission::revertAssert();

Add this comment to turn off the BP error,
//BP Deviation documented
formListItem = new FormListItem(conPeek(fieldIdList, i), imageListAppl_Query.image(#ImageField));

we have tried this option too, but still this error persists

It says that you’re fetching the data in a way that doesn’t automatically apply record-level security, therefore you should review it and either apply RLS in your code, or explicitly state that you don’t want to use it. Then you can suppress the warning.

If possible, please show us the total method (where you are getting these BP errors).