Friday, April 13, 2018

Dynamic URL for Email Templates

In some cases, you need to add dymanic URL to Visualforce Email template to Open link regardless of Salesforce Org. To put URL dynamically use following code:


<a href="{!LEFT($CurrentPage.URL,FIND('/',$CurrentPage.URL,9))}{!relatedTo.Quote__r.id}">{!relatedTo.Quote__r.QuoteNumber}</a>


Thursday, April 12, 2018

Google Calendar Integration part 2


Create Custom settings:
Client id:
Client Secret: URL Token:
https://developers.google.com/identity/protocols/OAuth2InstalledApp
URL EventInsert:
https://developers.google.com/calendar/v3/reference/events/insert
URL Calendars, URL Calendars:
https://developers.google.com/calendar/v3/reference/calendars

Wednesday, April 11, 2018

Google Calendar Intergration part 1


This article describes how to create a Google Calendar on the Contact app. To create an Opportunity associated with Contact, an Google Calendar event is created. To delete or update Opportunity event will be deleted or updated.
1) Create project in Google Developer Console.
2) Create Credentials:
API key:
OAuth 2.0 client IDs:
Google console project created.

Multiple Organizaton

1) Create Role hierarchy for each organization.
2) Make all custom and standard objects Private to make inaccessible to users from another organization.
3) Created new Account Record Type - Organization. Create new Records with this record Type for all organizations.
4) For Reports create custom field "Organization" on Opportunity and "Company" on User. Here we write down the organization name to which the user belongs. The value entered in the field must match the account name for the corresponding organization.
5) Create trigger which will fill out "Organization" field on Opportunity regard of User's Company.