Posts

Showing posts from July, 2016

Get Longitude and Latitude from the Google Api

Image
Requirement: To get longitude and latitude of address using google api in salesforce. When Account is insert/update if account has shipping address then auto fill latitude and longitude values Soloution >> You need to hit google api call. it is free you can call it easily Note>>1)  Add end point URL in Remote site setting SetUp>> remoteSiteSetting>> AddURL:   https://maps.googleapis.com 2) Add two fields as a text type on Account object one is longitude  and othe is latitude  Longitude >> Longitude__c Latitude >> Latitude__c Step 1>> Need to Write trigger on Account Object You need to write two class and one trigger Class 1 /* This class is using for quering Billing address and call Google Map api and find the lattitue and long from API */ public  class AccountGetBillingAdress {   // toCheckFutueCall varibale is a boolean variable if it has alreday exist     private static Boolean toCheckFutueCall = false;

Open Service Console tab and Salesforce Classic using JavaScript on Custom Button in Salesforce

Requirement: Need to create a custom button on detail page, when click on it open in new tab in service console apps and salesforce classic Solutions: if (typeof(srcSelf) == 'function') {  // This is for Console app srcSelf('URL&isdtp=vw');  }  else {  // This is for salesforce classic window.open('URL');  } Notes: isdtp=vw : this is hide sidebar in consolse app URL  = '/500/e?CF00NN0000001i1d6={!MergeFieldAPINAME}&CF00NN0000001i1d6_lkid={!MergeFieldAPINAME}&ent=Case' In case of any issue please feel free call to me Thanks, Sumit Shukla skypeID : shuklasumit1 sumitshukla.mca@gmail.com Mob: 9711055997

Case Assignment Using Apex Code

Requirement: When Case will insert using apex code assignment check box should be true. Solution: List<Case> lstofCase = new List<Case>(); Case objCase = new Case();   ObjCase.status="New"; lstofCase.add(ObjCase); Insert lstofCase;  Database.DMLOptions dmo = new Database.DMLOptions();   dmo.assignmentRuleHeader.useDefaultRule = true;    system.debug(' dmo.assignmentRuleHeader.useDefaultRule***'+ dmo.assignmentRuleHeader.useDefaultRule);  Database.update(lstofCase, dmo);   Thanks, Sumit Shukla mob: 9711055997 skypeID: shuklasumit1 email ID: sumitshukla.mca@gmail.com