Popup in Salesforce
Below is the simple example for popup in salesforce Visualforce page: <apex:page controller="popup"> <style type="text/css"> .popup { ....
Below is the simple example for popup in salesforce Visualforce page: <apex:page controller="popup"> <style type="text/css"> .popup { ....
Sample Code: String tempStr = '[email protected]'; if ( Pattern.matches( '[a-zA-Z0-9._-]+@[a-zA-Z]+.[a-zA-Z]{2,4}', tempStr ) ) { System.debug( 'Regex Matched' ); } else { System.debug( 'Regex Pattern not Matched' ); } Output:
Sample Code: Trigger: trigger AccountTrigger on Account ( before insert ) { for ( Account acct : trigger.new ) { if ( acct.Name == 'Test Account' ) acct.Description = 'Test'; ....
To write/develop a unit-test/test class for Salesforce Apex Triggers, then in the Test Class, we have to do the DML operations based on the events used in the Apex Trigger. ....
window.onload or action attribute in apex:page can be used as OnLoad function in Salesforce Visualforce page. Method 1(Calling Javascript): <script type = "text/javascript"> window.onload=function() { alert("Hi"); }; </script> Method 2(Calling ....
getChildRelationships() can be used to retrieve all the related or child objects of an object in Salesforce Apex. Sample code: Schema.DescribeSObjectResult objResult = Account.SObjectType.getDescribe(); List < Schema.ChildRelationship > objRelationships = ....
In order to use apex code to submit the record for Approval process, we have to first create Approval process in Create --> Workflow & Approvals. Sample code: void ....
Sample Code: Visualforce Page: <apex:page controller="SampleVisualforcePageController" id="pg"> <apex:form id="frm"> <apex:messages/> <apex:pageblock id="AccountsList" title="Accounts List" > <apex:pageBlocktable value="{!listAccounts}" var="acc" > <apex:column title="Select" > <apex:inputCheckbox value="{!acc.selectedBool}"> </apex:inputCheckbox> </apex:column> <apex:column value="{!acc.objAccount.Name}"/> </apex:pageBlocktable> <apex:pageblockButtons ....
PageReference can be used to navigate from the current page to a different page using Salesforce Apex. The below code is used to open new page 'AddAllBlog' from current page. ....
The below simple code is used to convert String to Date data type using Apex Sample Code: String todate = '12/27/2013'; Date dt = Date.parse( todate ); System.debug(' Parsed Date is ' + dt ); Output: