Salesforce

Salesforce

Email validation using Apex in Salesforce

Visualforce page: <apex:page controller="testController">    <apex:form id="myform">    <apex:pagemessages />    <apex:pageBlock id="myblock">        Email Address: <apex:inputText value="{!email}" id="email"/><br/><br/>        <apex:commandButton value="Click me!" action="{!checkEmail}"/>    </apex:pageBlock>    </apex:form></apex:page> Apex Code: public class testController{    public String email { ....

Salesforce

Calling Apex method from a Custom Button

To call Apex method from Custom Button, follow the below steps 1. Create a custom button and enter the following code Syntax: {!REQUIRESCRIPT("/soap/ajax/12.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/12.0/apex.js")} sforce.apex.execute("Class_Name","Method_Name",{parameter_Name:"value"}); location.reload(true); Code: {!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")} var ....