Posts

  Do you Know, we can do most of the configuration of salesforce through Apex code also.  In this post, I will demonstrate how we can create a picklist and update the picklist value.  Step 1 : Create an apex class with the name MetadataService.apx. Paste the following code.                 https://github.com/financialforcedev/apex-mdapi/blob/master/apex-                 mdapi/src/classes/MetadataService.cls Step 2 :  Create another class with name metautil.apx public class MetadataUtil {           private static final Integer METADATA_API_VERSION =  Integer.valueOf(new MetadataService.MetadataPort().endpoint_x.substringAfterLast('/'));          /* public static String fetchUserSessionId(){ String sessionId = ''; PageReference reportPage = Page.SessionId; String vfContent = reportPage.getContent().toString(); Integer startP = vfContent.indexOf('Start_Of_Session_Id') + 'Start_Of_Session_Id'.length(), endP = vfContent.indexOf('End_Of_Session_Id'); s