Posts

How to populate maximum time string repeat in record /Child Record - Similar Rollup summary Max function.

Hi Rowdies, This is a Sample code for displaying maximum time repeat string in child records like Invoice and Invoice line. <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9744265961313227"      crossorigin="anonymous"></script> Set<String> strSetTaxCode = new Set<String>();  for (custom__c obc : [SELECT  Id , customfield__c, customfield2__c FROM custom__c ]){             if(String.isNotBlank(oinvline.customfield__c)){                 lstTaxCode.add(oinvline.customfield__c);             }  } for (string settemp : lstTaxCode){      strSetTaxCode.add(settemp); }         for(String str: strSetTaxCode){     Integer countofChar = 0;      for(String strl: lstTaxCode ){                 i...

How to Refresh Page using Lightning Web Component

 eval("$A.get('e.force:refreshView').fire();");

How to delete files from using Apex in salesforce

list < ContentDocument > lstCntDocsToDelete = new list< ContentDocument >(); for ( ContentDocumentLink iterator : [ SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = '1234567890123456' ]) { lstCntDocsToDelete . add( new ContentDocument ( Id = iterator . ContentDocumentId )); } if ( ! lstCntDocsToDelete . isEmpty() && lstCntDocsToDelete != null ) { Database . delete(lstCntDocsToDelete, false ); Database . emptyRecycleBin(lstCntDocsToDelete); }  

Use BatchApexErrorEvent Triggers to Monitor ISV Applications With Example (Salesforce Spring ’21 Release)

Include BatchApexErrorEvent triggers in your managed package to monitor the health of batch jobs and take necessary corrective action without any post-installation steps. Where:  This change applies to Lightning Experience and Salesforce Classic. How:  The BatchApexErrorEvent object represents a platform event associated with a failing batch Apex execution. To fire this platform event, a batch Apex class declaration must implement the  Database.RaisesPlatformEvents  interface. A  BatchApexErrorEvent  platform event is fired when a batch Apex job encounters an unhandled exception. For more details, see  Firing Platform Events from Batch Apex  in the  Apex Developer Guide . The BatchApexErrorEvent object represents a platform event associated with a batch Apex class. This object is available in API version 44.0 and later. If the  start ,  execute , or  finish  method of a batch Apex job encounters an unhandled exception, a...