Tuesday, April 7, 2015

Geolocation Custom Field In Salesforce

The geolocation custom field allows you to create a field that identifies a location by its latitude and longitude. You can then use the geolocation field with the DISTANCE and GEOLOCATION formula functions to calculate distances between locations.

I would like to show you how we can update Geolocation field in Salesforce. It's slightly different from other fields, see it below:

Object Name: MyObject
Field Name: Geolocation__c;

To update Geolocation__c use below steps:

MyObject myObj = new MyObject(id=oid);
//here lat is a string
myObj.Geolocation__latitude__s = Decimal.valueOf(lat);
//here lng is a string
                myObj.Geolocation__longitude__s = Decimal.valueOf(lng);
update myObj;

Thanks.

Monday, March 30, 2015

How to upgrade User License for community user?

Solution# Admin needs to follow below steps to do so:


  • Open user details page for the user you want to change the user license
  • Open the contact associated with that User
  • Select "Manage External User" drop down button on Contact detail page
  • Select "Disable Customer User"
  • Then again select "Enable Customer User" option.
  • It will redirect to user edit page wherein license field would be auto populated.


Hope this will help.

Wednesday, June 12, 2013

Step by step procedure to Encrypt ( PGP encryption) a file using Boomi ETL tool

If you want to encrypt any text file using PGP encryption in Boomi, then use the below steps to achieve your requirement:

Step 1. In the start shape read a text file from Disk, create a connection and Operation for Disk connector.



Step 2. Drag Data Process component in the canvas, just after the start shape and then select below option in Data Process component:


Step 3. Now if you want to keep the same file name in target folder as in source folder, then drag and drop the Set Properties component in the canvas after Data Process component with the below configuration.


Step 4. At the last create a Disk connector which will save the encrypted file to your local folder. 

Complete process would look like this:





Note: Initially I was getting below error message in Data Processing step:

Unable to store data, error copying stream.; Caused by: failed encrypting; Caused by: exception encrypting session key; Caused by: Illegal key size or default parameters 

If you are also receiving same error message, then I would recommend you to go through below link, it will help you to resolve this issue:

http://stackoverflow.com/questions/6481627/java-security-illegal-key-size-or-default-parameters

You would need to replace Local_policy.jar and US_Export_policy.jar files from your system with the 
jar files included in the JCE Policy Files. Once you successfully replace the jar files in your system, then Unlimited Strength Cryptography under your Atom become true: 

Manage->Atom Management->Select your atom from Environments section on left side of the screen-> Atom Startup Properties->Unlimited Strength Cryptography -> Should be TRUE, if False you will receive the error.


Wednesday, February 8, 2012

Scheduling Talend job


You can schedule the Talend job by TIS (one of the commercial editions) or by using Windows scheduler. With the commercial edition, the entire job runs from the server and if you use Windows scheduler it will execute the job only when the system in which TOS is installed, is running.


I am going to tell you the steps to schedule it using Windows scheduler:


1. Right click on a job, select 'Export Job Scripts'


2. Give the location for the .zip content of the job and Select 'Finish'.


3. Extract all the contents of the .zip file, it must contain a .bat file. 


4. (Win XP) Goto Start->All Programs->Accessories->System Tools->Scheduled Tasks->Add Scheduled Task


5. In the 'Scheduled Task Wizard' select 'Browse'. Find the .bat file of the Job in the extracted folder. Assign a name to the schedule.


6. Enter credentials for system password, schedule time etc.


7. It will execute the .bat file in the schedule time period.


I hope the above steps would help you.

Link child record with the respective parent record in Target org. using Talend.


Whild migrating the child records from one Salesforce org.(OrgA) to another(OrgB) I was facing hard time to link the child record with the respective parent record in target org.(OrgB). Because when you create new record in Salesforce it will create it with the unique Id in target Org.(OrgB).


I though this would be the common scenario while migrating data from one Org. to another. So, I am going to provide you the step by step process to link the child record with the respective parent record:


1. First thing you need to do is to create a custom field say ExternalIdField on Account object in target org.(OrgB) and select the External ID check box.


2. Follow the steps which I have provided in my previous post to make the connection between source org. to target org. 


3. We use tMap to create the mapping between the org.'s, double click on it and link the id field of Account(OrgA) to the ExtenalIdField custom field on target org.(OrgB).


4. Run the job, it will migrate account records from OrgA to OrgB.


5. Next time when you do the same for child records say Contact records; first fetch the child records(tSalesforceInput) from OrgA and Parent record (tSalesforceInput) from OrgB.(Select id, ExternalIdField__c from Account).


6. Drag the tMap and tSalesforceOutput(OrgB) component into the designer view.


7. Now double click on tMap componet, it will open the new window, on the left hand side you must be seeing two table(Contact (OrgA) and Account(OrgB) tables), 
drag the look up field of Contact into ExternalIdField of Account, in this way you have link the lookup field of Contact(OrgA) with the ExternalIdField(OrgB).


8. After that, drag the id field of Account(OrgB) to the Account lookup field on Contact(OrgB) on the right side of the tMap component, in this way you are inserting the Account(OrgB) id into the lookup field of Contact(OrgB).


9. Now just run the job, it will insert the contact record and will link it with the parent record as well in the target org.(OrgB).


I hope this will help you.

Friday, February 3, 2012

Integrate Salesforce Using Talend



I came across with a requirement in which I have to migrate conditional data from one Salesforce org. to another. So I explore Talend ETL tool to do the task and I found this tool a really very easy and helpful tool to migrate the data. I am going to tell you the steps by steps process:

1. You can download Talend Open Studio for Data Integration from http://www.talend.com/download_form.php?cont=gen&src=HomePage

2. First you need to create a Job in the IDE

3. On the left hand side under Repository section -> Job Designs-> Right click->Create Job

4. Create saleforce connection, Repository section -> Metadata->Salesforce-> Right click->Create Saleforce connection

5. Source Org.A
Enter the name of the connection(say MySaleforceSourceOrg)
Enter login credentials and click on Check Login button, it should show Connection successful
A salesforce connection with the name MySaleforceSourceOrg should be created now right click on it and Retrieve Saleforce Module
Now select the account and click finish
  
6. Do same steps for Target org.B (MySaleforceTargetOrg)as well 
  
7. Till now you have created the Job and salesforce connection for source and target org.

Talend provide standard components that we can use to fetch or insert data into Salesforce.com. 

Ex:- tSalesforceInput : Allows to extract data from a Salesforce DB based on a query.
 tSalesforceOutput :- Allows to write data into a Salesforce DB.
 
8. Now we need to link source org (MySaleforceSourceOrg ) connection to target org. connection (MySaleforceTargetOrg.)

9. Open MySaleforceSourceOrg connection and drag the account module into the job designer panel, and select tSalesforceInput component from the pop-up window.

10. Open MySaleforceTargetOrg connection and drag the account module into the job designer panel, and select tSalesforceOutput component. 

11. Search for tMap component on the right side under Palette section.

12. Drag tMap  component in between tSalesforceInput and tSalesforceOutput component into the designer panel.

13. Right click on tSalesforceInput  component ->Row->Main and drop it into tMap.

14. Right click on tMap->Row->Main and drop it into tSalesforceOutput component

Now both the connection and tMap are in the designer panel. Right click on tSaleforceInput  component in the designer panel and select setting, it will automatically filled the username and password section. Now check the "Manual input of SOQL query" section. and write "Select id, name from Account limit 10".
Select tSaleforceOutput, right click on it and click on setting. It will open the component section and select the Action as insert.

At the last select the Run(Job) tab adjacent to component section. finally click on Run button and you are done.

It will send the source account record from Saleforce OrgA to Salesforce OrgB.