Author Archives: patlatus

VSCode ForceCode

VS Code https://codecracksblog.wordpress.com/2017/10/30/use-visual-studio-code-for-salesforce-developmentide/ Good plugin, need to remember this link

Posted in Uncategorized | Leave a comment

Determine if field is a component of a compound field

Sometimes there is a need to determine if a field is a component of a compound field. For example, compound fields components are not permissionable even though field describe isPermissionable method for them returns true. There might be other cases … Continue reading

Posted in apex, field, SOQL | Leave a comment

Using SFDX to auto login to your organizations.

SFDX provides an interesting way to login automatically to the organization you need. The only disadvantage of this approach is that you would need to reconnect each time when you sandbox organization is refreshed. To authenticate sandbox you need to … Continue reading

Posted in salesforce, sfdx | Leave a comment

Preparing package.xml for custom metadata records and sending email containing it to the current user

Preparing package.xml for custom metadata records and sending email containing it to the current user public class MD { public static String buildPackageXMLForMD(SObjectType mdt, String whereClause){ String mdtName = [ select DeveloperName FROM EntityDefinition where QualifiedAPIName = :mdt.getDescribe().getName() ].DeveloperName; List … Continue reading

Posted in salesforce | Leave a comment

Create package.xml for custom metadata records

Sometimes after creation of custom metadata records there is need to deploy them to other organization or to backup them in sandbox. Today I have written a code to build package.xml for that

Posted in salesforce, Uncategorized | Leave a comment

Debug “Validation Errors While Saving Record(s)” error message when calling Test.loadData()

Sometimes when you use Test.loadData() you might receive some confusing error message saying “Validation Errors While Saving Record(s)”, it is hard to understand what is wrong in data so it is possible to use the following code to debug the problem So … Continue reading

Posted in salesforce | Leave a comment