We have a sample test class for covering the constructor in salesforce. Kindly see the below code. Controller:- public class MyAccountClass { //Class Constructor public MyAccountClass(ApexPages.StandardController controller) { //Do...
Try the below:- Get Recordtype Id by Name:- Id devRecordTypeId= Schema.SObjectType.Account.getRecordTypeInfosByName().get(‘Development’).getRecordTypeId(); Here, ‘Development’ is the record type’s name. You shuld use ‘someone’. Also, you will have to specify your...
Add Additional fields in the Web to Lead form without regenerating, 1.Generating the HTML code from Web to Lead 2.Incorporate the new HTML into your web site 3.Adding fields via...
We can show the Apex Page Messages. Apex Class: public class Messages{ public MessagesController(){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.FATAL,'Enter Account name')); ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'This is not valid')); ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'It should be correct format'));...
To find whether the record creation Date is Weekday or Weekend it would be simple formula., CASE (MOD ( CreatedDate – DATE (1900, 1, 7), 7), 0, “Weekend”, 6,...
We already have the function deep clone to clone the fields. It has been done via SOQL query(i.e selected fields only cloned). We need a dynamic clone of the...
If we want to show the popup message by clicking the button, Then Click “ok” redirect to another Page and “Cancel” reloads the same page on Javascript. if (confirm(‘Are...
Standard Page URL and Lightning page URL both are totally different. If we want to redirect the page to lightning just given the URL like the below, (‘/one/one.app?source=aloha#/sObject/{!sobject.Id}/view’) ...
Sometimes, We have strucked in a script like drag and drop, here is the simple and easy code. Use below code to achieve this process. <apex:page > <html lang=”en”>...
This is pretty simple, You can either upload Bootstrap as a static resource or, as I personally do, link to CDN. Bootstrap uses MaxCDN, so all you’d need to do is...
I have faced this problem and struck how can I display superscript based on the date field. Finally, I got a good solution, I want to share with you. The...
We want to validate the phone field that it should have 10 digits only and the last name should have text only so how to use the extension. I...