Tool for Manage, Configure and Run Background Jobs

Following is a free tool for managing background jobs.


Some advantages of the tools:

-Easily monitor the jobs progress, failure, reprocess

-Priorities jobs, chain many jobs in sequence, schedule job for specific date/time, schedule job with almost any interval (minutes/hours/days)

-Avoid reaching flex queue/total schedule jobs limit

-Simple-medium complexity logic can be set up from the UI without any code.

-For complex logic write apex with specific interface and schedule it for the same queue


In AppExchange: https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3u00000PuKbREAV


Demos:







For writing apex code to be running with the manager, should implement the interface IRunAsyncJobBatch.
See example:
 global with sharing class ApexJobDemo implements mba_services.IRunAsyncJobBatch, Database.Batchable<SObject>{  
      public mba_services__Async_Job__c asyncJob;  
      global Id run(mba_services__Async_Job__c relatedJob){  
           return Database.executeBatch(new BatchExecuteMarkerActions(relatedJob), batchSize);  
      }  
      public ApexJobDemo(){}  
      public ApexJobDemo (mba_services__Async_Job__c relatedJob){  
           asyncJob = relatedJob;  
      }  
      global Database.QueryLocator start(Database.BatchableContext bc){  
           //return query locator  
      }  
      global void execute(Database.BatchableContext bc, list<sObject> scope){  
           //run some logic  
      }  
      global void finish(Database.BatchableContext bc){  
           //run finish logic  
           //close the job  
           mba_services.AsyncJobServices.closeAsyncJob(asyncJob.Id, true, 'Process Compelted', null);  
      }  
 }  


After having the class it can be queued into the manager either manually by creating new Async Job record, or with code:

mba_utils.AsyncJobServices.addAsyncJob (
		'Custom Job Title', 'Batch', 'DemoJobDemo', 'High', null, null);






Custom Buttons in Lightning Input Rich Text


How often have you wanted to use a standard component but discovered that it only met a portion of the requirements, giving you only two options: use the standard component as is and ignore the additional requirements, or create a similar component yourself from scratch, which takes more time.

There is a good possibility that this won't happen with the lightning-input-rich-text component, as it provide a very high flexibility. First, by attributes, such as the option for removing standard buttons, and then we also have the ability to add our own custom buttons inside the toolbar. 


To add a custom button inside rich text component all we need to add inside the standard lightning-rich-text element is:

1.lightning-rich-text-toolbar-button-group

2.lightning-rich-text-toolbar-button - per each button that you need

In the example that follows, I've disabled all but one of the default buttons (text format), and I've added a custom icon for adding merge field. 


<lightning-input-rich-text 
        value={richTextValue} 
        onchange={contentAddedHandler} 
        disabled-categories="FORMAT_BODY,ALIGN_TEXT,INSERT_CONTENT,REMOVE_FORMATTING">

        <lightning-rich-text-toolbar-button-group 
            slot="toolbar" 
            aria-label="Template Button Group">
            <lightning-rich-text-toolbar-button
                icon-name="utility:merge_field"
                icon-alternative-text="Add Merge Field" 
                onclick={addMergeField}>
            </lightning-rich-text-toolbar-button>
            
        </lightning-rich-text-toolbar-button-group>
    </lightning-input-rich-text>


Although the complexity of such an addition depends on the buttons we add and their logic, adopting this strategy allows us to avoid having to create such a component from scratch, which saves us a lot of time and work. We can use the standard component and incorporate our own special logic.


Full code in git: https://github.com/liron50/input-rich-text-demo



Retire of Permission on Profiles

If you are working as a Salesforce admin/developer you've probably heard somewhere that Salesforce is planning to make a significant cha...