Posts

Showing posts with the label Interview Questions: 4

Salesforce Q&A Part 4:

Customisation Q&A Continued: Q)   How can we perform a 'callout' using  javascript button? Ans. Old Way : button logic {!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")} if({!AAA__c.Name}!=Null) {     sforce.apex.execute("MyClass","myMethod",{}"});     alert("This is {!AAA__c.Name}"); } Apex class logic: global class MyClass {     webservice static void myMethod() // you can pass parameters     {          // Do something     } } New Way: Create visualforce button as javascript button is incompatible in SF1 and Lightning. <apex:page standardController="Case" extensions="EscalCase" action="{!caseEscalation}"> <apex:form> <apex:inputHidden value="{!case.OwnerId}"/> </apex:form> </apex:page> Apex: public class EscalCase {     //Apex properties or variables     public Id ow...