Tag Archives: code

Salesforce: Impossible to invoke Lightning or Visualforce actions in Apex Code

When I saw QuickAction class and QuickAction.QuickActionRequest object I assumed that it supports Lightning and Visualforce actions, however, in fact, it doesn’t. I created two actions. Lightning Action on Account and called it LA and Visualforce action on Account and called it VA. When … Continue reading

Posted in Actions, lightning, salesforce, Uncategorized, visualforce | Tagged , , , , , , | Leave a comment

Google Code Jam Competition: 677 of 24292 tried to solve all the problems

Around 677 contestants of 24292 from all over the world tried to submit solutions to all problems. Around 20 contestans from Ukraine tried to submit solutions to all problems Google Code Jam Qualification Round Preliminary Leadership Board (top 110)

Posted in competition | Tagged , , , , , , , , , , , , , | Leave a comment

Salesforce: use Apex Code to grant permissions to custom object and fields

List<Id> profilePermissionsSetIds = [ select id, Profile.UserLicense.Name from PermissionSet where IsOwnedByProfile = true and Profile.UserLicense.Name = ‘Salesforce’]; List<ObjectPermissions> objPermissions = new List<ObjectPermissions>(); for ( String pId: profilePermissionsSetIds ) { objPermissions.add( new ObjectPermissions ( SObjectType = ‘Custom_Object__c’, ParentId = pId, PermissionsRead … Continue reading

Posted in Administration, apex, Profile, salesforce, Uncategorized | Tagged , , , , , , , , , | Leave a comment

Salesforce Apex Code to identify formula fields containing hyperlinks

This is Salesforce Apex Code to identify formula fields containing hyperlinks String s = ”; String x = ”; Map<String, Schema.SObjectType> globalMap = Schema.getGlobalDescribe(); for ( String key: globalMap.keySet() ) { Map<String, Schema.SObjectField> fieldsMap = globalMap.get( key ).getDescribe().fields.getMap(); for ( … Continue reading

Posted in apex, field, Uncategorized | Tagged , , , , , , , , , , , , , | Leave a comment

Salesforce: how to check if profile is custom or standard by code

When I needed to grant access to some object to all profiles I understood how is it possible to  profile is custom or standard by code   public static Boolean isStandardProfile( String profileName ) { List<PermissionSet> ps = [ select id … Continue reading

Posted in Profile, salesforce, User Management | Tagged , , , , | Leave a comment

Manual Share of records through SOAP Webservices: Partner WSDL or Enterprise WSDL or Custom Code

Recently I was writing about solution to bug in new FF managed package which breaks S2S connection which required change in account trigger logic to automatically share that account or those accounts being updated to partner organization. Now I would … Continue reading

Posted in apex, S2S, SOAP, Webservices, WSDL | Tagged , , , , , , | 1 Comment

Salesforce: Schedule schedulable job or batchable for next minute from anonymous apex script

Sometimes we have to check Schedulable Job or Batchable job execution when scheduled. Also we don’t want to wait until specific date or time happened (assume on production your Schedulable or Batchable job should be scheduled to 1 a.m. of last … Continue reading

Posted in apex, batch, job, Posts in English, schedulable | Tagged , , , , , , , , , , , | Leave a comment