Skip to main content

Posts

Showing posts from 2022

Trick to Populate Email formula field in Email Alert in Salesforce

 As we know, formula field is not acceptable in Email Alert although the type is email . So there a hack to get away from it. I forgot where I read this info, credit to that developer. We have run some unit test and so far it works. The drawback ; you may get error during deployment so you need to do it manually. So it may cost in maintenance section if you need to change email alert. But if email alert is seldom change, it might be worth especially the email actually derived from the parent object. For example if the email field is at Account level but you need to create email alert at Opportunity. It's quite costly if you need create field update to populate Opportunity with Account email field while actually you can just read using formula from Opportunity. Here are the steps : 1) Create formula field at Opportunity ; data type is text (I forgot to check why I don't use email)  2) In the email alert , at Recipient select one user  3) Once select , right Click Inspect Element

Part 1 : Too many soql in Real Life

I have encountered a lot of question about Too Many SOQL limit in Salesforce before in different companies. Honestly I don't feel it is fun work however while working on them I gain a lot of knowledge depending on how I  plan to fix it and increase some confidence level because , hey you read trigger and code line by line, review any component such as Process Builder, Flow. Looking closely to any possible holes and  understand it and try to figure out the most effective way to deliver eat. So at last, I writing this entry as I got so many misunderstood about Too many soql limit. Some thought it is so complex and the rest of them thought it's so simple until it being treated as miscellanous. This is how we started... imagine that you travel to somewhere, maybe far away to the mountain with very great car that have spacious space (uhmm of course the car space have limit, spacious does not mean you can put everything inside. You need to put your item in your car. So you put maybe

Checking API for Salesforce Platform API Versions 7.0 through 20.0 Retirement using Workbench

 The guideline on Salesforce Platform API Versions 7.0 through 20.0 Retirement  can be referred here . In this entry, I would like to share how I check REST/SOAP log so that I can check the API version. Note : To view log file , you need a licence to Event Monitoring. This is alternative of Salesforce Event Log File Browser as some companies may block the URL .We can use Workbench to view the log file. Run the SOQL , you can use any tool to run SOQL. Developer Console should works also. SELECT Id,LogFile, EventType, CreatedDate FROM EventLogFile WHERE EventType IN ( 'API' , 'RestApi' , 'ApiTotalUsage' ) Login to Salesforce Workbench > Go to utilities > Choose REST Explorer and paste the LogFile URL that returns from above query and click Execute. It should something like below. Note that the yellow highlight is something that we need to alert because it's going to retire. To make it easy to read, just copy from EVENT_TYPE until at the end of the