Posts

Showing posts from June, 2017

Lightning Design System (SLDS) in Visualforce pages

Salesforce Lightning Design System provides a set of CSS classes and design guidelines that allow you to create user interfaces that are consistent with the Salesforce Lightning Experience.  You can use the Lightning Design System (SLDS) to build Visualforce pages that match the look and feel of the Salesforce mobile app. To use SLDS, it takes some tweaks in your code and a few things to remember. Visualforce Page with SLDS <apex:page applyHtmlTag="false" applyBodyTag="false">     <html lang="en">     <head>         <title>SLDS Example in Visualforce</title>         <apex:slds />     </head>     <body>         <div class="slds-scope">             <div class="slds-grid slds-grid_vertical">                 <div class="slds-col slds-size_1-of-2">  ...

Exposing Apex Methods as SOAP Web Services

By exposing them as SOAP web services, apex methods are available to external applications. To make Apex methods available as SOAP web services, we must declare them within a global Apex class and use the "webservice" keyword. Salesforce will then automatically create a WSDL document for that class, which can be utilized by external applications to access the exposed web services. Example global class MyWebService {     webservice static Id makeContact(String contactLastName, Account a) {         Contact c = new Contact(lastName = contactLastName, AccountId = a.Id);         insert c;         return c.id;     } } To generate the WSDL file for a Salesforce instance, we can simply append "?wsdl" to the instance URL, followed by the path to the Apex class.  For example, the URL should look like https://yourinstance.salesforce.com/services/wsdl/class/MyWebService. Once you have the WSDL file, you can generat...