Posts

Showing posts with the label VF

Salesforce Fact #811 | Careful with map with null value in VF page

Image
We need to be careful while accessing map in VF page. If any of the value in the map needs to be null, we should use '' instead of NULL, else it will throw the error: Map key <corresponding key> not found in map. Attached are the screenshots.

Salesforce Fact #756 | Show approval details in VF email template

Image
Suppose we have a requirement to show the approver name, approved/rejected status and the comments in the visualforce email template which is associated to the final approval/rejection action. We can create an apex controller, VF component to implement this and refer the same in the email template. Reference:  https://gist.github.com/douglascayers/46bb1e92be9909d60fee Attached are the screenshots.

Salesforce Fact #612 | VF: access apex data in JS methods

Image
We can access data from apex controller in JS methods in vf page. Attached are the screenshots.

Salesforce Fact #556 | Conditional rendering in p tag

Image
Unlike VF page, we can apply conditional rendering in <p> tag in LWC.  The below VF code will behave as: However the LWC code willl work properly:

Salesforce Fact #547 | VF email template restriction

In VF email template, the messaging:htmlEmailBody and messaging:plainTextEmailBody tags can appear only once within a template. So, if we need to render some content in the email template dynamically, we can put conditional rendering on the content inside these tags.

Salesforce Fact #1 | VF page load

Image
The order of invocation of constructor, getter and action method when a visualforce page is loaded is as follows: constructor -> action method -> getter Attached are the screenshots. (Please excuse the apex class and VF page names)