Salesforce Certificate

Tuesday, 28 July 2015

Oracle-to-Salesforce Integration (Lightning Connect) - A Step by Step Guide



Below are the seven steps to integrate Salesforce with Oracle using Lightning Connect

  1. Sign up for a DataDirect Cloud trial
  2. Download & Install On-Premise Connector
  3. Create a Data Source
  4. Configure & Test Connection
  5. Configure Schema
  6. Configure & Validate External Data Source in SFDC
  7. Sync External Data Source in SFDC


Step 1. Sign up for a DataDirect Cloud trial


Step 2. Download & Install On-Premise Connector
  • Click on “Connect Data” button under Data Direct Cloud section
  • Now Click on “Downloads” option from side bar and Select your driver based on your operating system.



Step 3. Create a Data Source
  • Click on “Connect Data” button under Data Direct Cloud section
  • Now Click on “Data Sources” option from side bar and Select “Oracle”.




Step 4. Configure & Test Connection


  • After all configuration click on “Test Connection” button.


Step 5. Configure  Schema
  • After the successful connection click on “Odata” tab for configuration of schema.
  • Now click on “Configure Schema” button.
  • Here you will find the dropdown which contains schema of oracle EBS database.
  • You can select multiple oracle database tables from this schema and connect it to salesforce. 
  • Select your Schema. ex. XXSCHEMA.
  • Select Oracle database table & save it. ex. XXTABLENAME.


 Step 6. Configure & Validate External Data Source in SFDC
  • From the Salesforce.com developer account, click on Setup > Develop > External Data Sources
  • Click on “New External Data Source”.
  • Configure the data source using the url as follows replacing “Oracle_with_EBS” with your DataDirect Cloud data source name
    URL: https://service.datadirectcloud.com/api/odata/Oracle_with_EBS
  • For DataDirect Cloud, authenticate using Basic Authentication. Under the Authentication section, change “Identity Type” to: “Per User” or “Named Principal”; and “Authentication Protocol” to: “Password Authentication”. Then enter your DataDirect Cloud credentials.
  • Click on “Save”
  • After successful configuration of data source you have to validate it using “Validate and Sync” button.



Step 7. Sync External Data Source in SFDC
  • After successful validation of data source you have to sync selected oracle database table which are treat as external objects in SFDC using click on “Sync” button.
  • These objects will have API Name appended with __x to indicate an external object; and the fields will be appended with __c similar to other custom fields.



 Here you can see your Oracle data in Salesforce
  • Create new Custom Object Tab for newly created external object.
  • Give field-level-security to visible to system administrator profile for all the fields of external object.


Limitation :- All the data which we are fatching at Salesforce side are in "Read-Only" mode.

  •  Feel free to email me on "hiteshpatel.aspl@gmail.com" if you have any question on this.

Thursday, 19 February 2015

New Features in Mobile SDK 3.1




SmartSync Library Feature (Unified SmartSync API for native and hybrid apps)


With the use of Unified SmartSync Framework we can easily store the data locally using the Cordova’s smartSync plugins and APIS. With the use of following two methods.this will provide us the ability to store objects locally and sync them to the cloud.
  1. syncUp()
  2. syncDown()

Authentication Feature

Salesforce Mobile SDK 3.1 have flows to initiate authentication with an enterprise certificate.

Note: The above features are supported only in iOS7+ and Android Lollipop (API 21) and above.


CocoaPods for iOS

Now, we have the ability to consume the Salesforce Mobile SDK through CocoaPods, which makes dependency management a chore of the past. It’s now easier than ever before to insert Salesforce Mobile SDK modules into an existing app or evolve a new app with other third party libraries.

Gradle for Native Android Apps :

Android Studio and the Gradle build system are now fully supported for native apps. Gradle support for hybrid apps will arrive after the next Cordova update.

GitHub Repos


Android: https://github.com/forcedotcom/SalesforceMobileSDK-Android/tree/master/native/SampleApps/SmartSyncExplorer

Hybrid App : https://developer.salesforce.com/blogs/engineering/2014/11/cross-platform-apps-salesforce-mobile-sdk-web-components.html

Reference Links:



https://developer.salesforce.com/blogs/engineering/2015/02/salesforce-mobile-sdk-3-1-unified-app-architecture-brings-unparalleled-flexibility.html

https://developer.salesforce.com/page/Building_Native_iOS_Apps_With_the_Salesforce_Mobile_SDK_3.1


Friday, 17 January 2014

Add years in salesforce standard & custom date field on Visualforce Page

In salesforce calender widget we can't able to select previous years from UI. but sometimes in business it's very important to select that.

Add below Javascript code in your visualforce page to add years in salesforce standard & custom date field

Javascript:

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<span id="hideThisHomePageComp"></span>
  <script type="text/javascript">
  $j = jQuery.noConflict();
   $j(document).ready(function() {                   var startYear=1900;                   var endYear=2024;                   var htmlStr='';                  if(startYear<endYear){
                                 for(i=startYear;i<endYear+1;i++){
                                                 htmlStr += "<option value=\""+i+"\">"+i+"</option>";
                                 }
                                 $j('#calYearPicker').html(htmlStr);
                  }
   $j('#sidebarDiv #hideThisHomePageComp').parent().parent().hide();
                  }  );
  </script>
 so your visualforce Page will be look like this.

Visualforce Page:
<apex:page standardController="Contact" id="mypage">
  <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<span id="hideThisHomePageComp"></span>
  <script type="text/javascript">
  $j = jQuery.noConflict();
   $j(document).ready(function() {                   var startYear=1900;                   var endYear=2024;                   var htmlStr='';                  if(startYear<endYear){
                                 for(i=startYear;i<endYear+1;i++){
                                                 htmlStr += "<option value=\""+i+"\">"+i+"</option>";
                                 }
                                 $j('#calYearPicker').html(htmlStr);
                  }
   $j('#sidebarDiv #hideThisHomePageComp').parent().parent().hide();
                  }  );
  </script>

    <apex:form >  
        Date: <apex:inputField value="{!contact.birthdate}" id="demo" onfocus="DatePicker.pickDate(false, this , false);"/>  
    </apex:form>
</apex:page>


Wednesday, 15 January 2014

Enable inline editing after Overriding Standard Buttons of Salesforce Object

Whenever we override Standard Buttons ("EditDelete") of any object in sales force then inline editing of that object records has been removed. we can't able to do inline Editing from view page of that particular object record.

Solution:
To Enable inline editing layouts, we have to do the following steps.

Step 1:
Create one custom visualforce page with following code.

<apex:page id="CaseDetail" StandardController="YoursObjectAPIName" 
tabStyle="YoursObjectAPIName" sidebar="true" >
    <apex:detail inlineEdit="true" relatedList="true"/>
</apex:page>

Note: In above code you have to Put API name of your Salesforce object.

Step 2:
Override your Standard button of Object("View") with custom visualforce page which we have developed in above step.

Tuesday, 14 January 2014

Use calendar widget without Current date link In Visualforce Page


Add following CSS Stylesheet in visualforce page to remove Current date link from input field.

CSS Stylesheet:
<style>
        span.dateInput span.dateFormat{
        display:none;
    }
</style>

Friday, 12 July 2013

Conditionally Override "New" (Salesforce Standard button) as per Record Type Selection

Override "New" (Salesforce Standard button) as per RecordType Selection

Following is the snippet of anonymous code which will help you to override Salesforce standard "New" button as per RecordType selected by user.

Here is the example for Overriding standard "New" button of Account Object(Any sObject) as per RecordType Selection.

Step 1:
Override your Standard button of Account Object("New") with custom visualforce page to which you want to redirect page.

Step 2:
Create one Custom Label with Name = "Custom_page_rectype". Put here your custom recordtype value (hard coded) For which you want to override conditionally.

Step 3:
Put action attribute in your visualforce page's <apex:page> tag as below.

Visualforce Page:
<apex:page standardController="Account" extensions="extCtrlRecordtyperedirect"
action="{!if(strRecTypeName==$Label.Custom_page_rectype,null,
URLFOR($Action.Account.Edit,
$ObjectType.Account,null,true))}">

This is Your custom visualforce Page

</apex:page>

Apex Class: 
public class extCtrlRecordtyperedirect{ 
     Public string strRecTypeName {get; set; }
     public extCtrlRecordtyperedirect(ApexPages.StandardController controller) {
          strRecTypeid = apexpages.currentpage().getparameters().get('RecordType');
          if(strRecTypeid !=  null){
            Schema.DescribeSObjectResult d = Schema.SObjectType.Account;
            Map<Id,Schema.RecordTypeInfo> rtMapById = d.getRecordTypeInfosById();
            strRecTypeName = rtMapById.get(strRecTypeid).getName();
        }
}

Schedule Apex to run Every 24 HOUR


Schedule Class To - Run at Every 24 HOUR Everyday..

Following is the snippet of anonymous code which will help you to schedule your apex Job to run Every HOUR.

Write below code in "Developer Console" to schedule class for every One Hour Everyday.


Apex Code:
ScheduleclassEveryhour objschclass = new ScheduleclassEveryhour ();
string strSeconds = '0';
string strMinutes = '0';
string strHours = '0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23';

string strDay_of_month = '*';
string strMonth = '*';
string strDay_of_week = '?';

String sch = strSeconds + ' ' + strMinutes + ' ' + strHours + ' ' + strDay_of_month + ' ' + strMonth + ' ' + strDay_of_week;
system.schedule('ScheduleclassEveryhour', sch, objschclass);