Posts

How to process List of records in xml formate in Salesforce Apex

 Dom.Document doc= new Dom.Document(); // created Document object doc.load(xml); //xml is xml fromated string  Dom.XmlNode root= doc.getRootElement(); for(Dom.XmlNode orderNode : root.getChildElement()){  //we are loading list of records on by one in for loop // asume we are loading list of orders.   Order orderRec= new Order();   For(Dom.XmlNode fieldNode : orderNode.getChildElement())    { //here we are getting each and  field is all object  String field1Name= fieldNode.getName();  String field1Value= fieldNode.getText();  if(field1Name == order id && field1Value == "send"){   //create updated account }

How to display flag in salesforce record detail page -

1.) Create a formiula field to dispaly image 2) field return type is text 3) formula as --------> IF(ISPICKVAL(fieldapiname,"field value"), IMAGE("/img/samples/flag_green.gif","Green Flag"), IMAGE("/img/samples/flag_red.gif", "Red Flag")) 4) if  feild value is "field value" then it will display green flag or it will display red flag.

task object - related(whatid) field add lookup to other object record

 In task object - related field - if we would like to have any standard and custom object record as lookup  then we need to do  0. enter into setup  1. go to that custom or standard object -  2. click on edit object button 3. select the check box - " Allow Activities"

flow true value

 {!$GlobalConstant.True}

LWC Datatable CSS Styling - column heading color change - data cell colur change on dynamic

 lwc data table heading  color change example https://techdicer.com/lwc-datatable-css-styling/

Developer productivity tools

  1.LWC Short Keys VS Code Extension for  #Salesforce 2. pmd

Formula To Calculate The Number Of Days Between Two Dates While Excluding Weekends

  However it’ll not exclude the HOLIDAYS, Because each org has its own holidays based on region /country. Hence salesforce don’t have knowledge about list of holidays. CASE(MOD( StartDate__c – DATE(1985,6,24),7),    0 , CASE( MOD( EndDate__c – StartDate__c ,7),1,2,2,3,3,4,4,5,5,5,6,5,1),    1 , CASE( MOD( EndDate__c – StartDate__c ,7),1,2,2,3,3,4,4,4,5,4,6,5,1),    2 , CASE( MOD( EndDate__c – StartDate__c ,7),1,2,2,3,3,3,4,3,5,4,6,5,1),    3 , CASE( MOD( EndDate__c – StartDate__c ,7),1,2,2,2,3,2,4,3,5,4,6,5,1),    4 , CASE( MOD( EndDate__c – StartDate__c ,7),1,1,2,1,3,2,4,3,5,4,6,5,1),    5 , CASE( MOD( EndDate__c – StartDate__c ,7),1,0,2,1,3,2,4,3,5,4,6,5,0),    6 , CASE( MOD( EndDate__c – StartDate__c ,7),1,1,2,2,3,3,4,4,5,5,6,5,0),    999)    +    (FLOOR(( EndDate__c – StartDate__c )/7)*5)  Steps to create: Create a formula fi...