• About
  • Contact me!

Salesforce Everywhere

~ Blog on Salesforce Dev and admin stuff

Salesforce Everywhere

Author Archives: Mani

Visual Flow Text Templates: Rich Text Formatting issue

01 Tuesday Mar 2016

Posted by Mani in Salesforce Configuration

≈ Leave a comment

Has anyone faced this issue before in Flows? I have faced it today and you can click on “This issue Affects me” button, if you think so.

https://success.salesforce.com/issues_view?id=a1p300000008XFtAAM

Tip#19 – Using workbench to execute APEX

10 Wednesday Feb 2016

Posted by Mani in Apex, Uncategorized

≈ 2 Comments

Tags

Salesforce Tips

Today, I was working on a requirement which queries public group and sends an email to the users(group members) with an attachment from the custom object record and it was implemented using APEX code. I wanted to test using Execute Anonymous option in Developer Console before I call the code using process builder. When I tried executing it in Developer Console, it was throwing Sending Request – Execution Failed error. I could not figure out the reason for it, but I realised that using workbench to execute Anonymous APEX code is better than Dev Console since your code, results are displayed in the same page and you can set the log level too.

Steps to execute APEX in Workbench:

a. Login to https://workbench.developerforce.com
b. Select Sandbox or Production(obviously, we will test the code in Sandbox first)
c. Then system will ask you to login to Salesforce
d. Once logged in, select “Apex Execute” in Jump to option
e. Paste your code in the text box and click on Execute button.
f. System will show the results on the same page. You can select the appropriate Log category and Log level too.

In the future post, I will write about creating a flow to query the public group based on the name and send an email to the group members(role based members).

Tip#18 Get Salesforce instance in Apex

09 Tuesday Feb 2016

Posted by Mani in Apex, Uncategorized

≈ Leave a comment

Tags

Salesforce Tips

Recently, I worked on a requirement where in I had to send an email by using APEX and I had to prepare the HTML body within APEX itself. As part of it, there has to be a clickable link in the email which should take the user to the Salesforce record after clicking on it and we should not hardcode the URL in the code.

So, here is the code below to get the logged in user’s URL and concatenate it with the Salesforce record ID:

String u=System.Url.getSalesforceBaseURL().toExternalForm();//this returns the base URL of the Salesforce instance as String.
String ufinal=u+’/’+POId;//POId is the variable that holds Id of the custom object record.

or you can write the above code in one line:

String ufinal = URL.getSalesforceBaseUrl().toExternalForm() + ‘/’ + POId;

New custom domain

08 Friday Jan 2016

Posted by Mani in Uncategorized

≈ Leave a comment

Since I am on vacation now, I didn’t get chance to write posts and I have got a new custom domain for the blog. It is sfdceverywhere.com, don’t worry getintosalesforce.wordpress.com will still work and you will be redirected to the new site.

I will be coming up with more posts on Salesforce topics once I am back from vacation(during 3rd week of Jan). Until then, bye and take care!

Tip#17 – Accessing “User License” field on User Object

07 Monday Dec 2015

Posted by Mani in Salesforce Configuration

≈ Leave a comment

Tags

UserLicense

If you want to access User license field which determines the type of license that user is on(ex: Salesforce, Salesforce Platform etc), you can access it in apex  as follows:

User.Profile.UserLicense.Name

Suppose, you want to create a validation rule in User object to make a custom field mandatory based on the license, it could be as follows,substitute Customfield with the actual field name(API name):

AND(ISNEW(),ISBLANK(Customfield), OR(Profile.UserLicense.Name=’Salesforce’,Profile.UserLicense.Name=’Salesforce Platform’)

Salesforce Admin Certification(WI16)

04 Friday Dec 2015

Posted by Mani in Salesforce admin exam, Uncategorized

≈ 39 Comments

Tags

salesforce admin certification

I cleared my Salesforce Admin certification(WI16) last week and here are few tips from my side to prepare for the exam:

  1. I used salesforce-qa document, which I got it when I googled to find out the study materials for the exam and it covers the topics given in the study guide (except SalesforceA and Salesforce1, interestingly I didn’t get any questions from those topics).
  2. Then, I started going through the questions given in the site from Part 1-Part 10 and there are about 1000 questions. I didn’t get majority of these questions on my exam though from these dumps, it has helped me to understand the nature of questions that can be asked for the exam. I have got around 20 questions from these dumps.
  3. After finishing the exam, I found out this Admin-201-Certified-Administrator-notes which is gud too.

Here is the study guide and let me know if you have any questions about the exam.

P.S: Recently, I have gone through this post http://www.merivisblog.com/study-salesforce-admin-exam/ and thought of sharing it, as it could be useful to pass the exam.

There is a nice article by Ben on how to pass your Salesforce certification and here is the link

Update lookup field using Process Flow

01 Tuesday Dec 2015

Posted by Mani in Uncategorized

≈ Leave a comment

I have updated the post(Update lookup field using Process) with the additional information. Please find the link below.

Source: Update lookup field using Process Flow

Flow creates duplicate records during bulk update!

24 Tuesday Nov 2015

Posted by Mani in Salesforce Configuration

≈ Leave a comment

Tags

Duplicate records, Flow

I faced a strange issue w.r.t Flows which was creating Duplicate records when I did bulk update of records. Details are as follows.

We have a custom object Rate Card which stores information related to rates(Currency fields) based on the service and the account(master detail relationship between Account and Rate Card). Let’s say for physiotherapy service and the account (let’s say ‘HomeCare’), we capture several rate fields(Daily Rate, Half-a-day Rate, Hourly Rate etc). Also, we have Validated flag and once the record is validated(by checking the flag), we trigger a flow(below screenshot) from the process and it will create Pricebook, Product and Pricebook entry records since we want to create Opportunity and Opportunity Product from the Rate Card record.

flow screenshot

Each Pricebook corresponds to an account and Products which will be the services(e.g. Physiotherapy) that we provide to the account.

First step in the flow is to check if the pricebook exists and if it exists, create the product. If it doesn’t exist, create the pricebook and create the product.

Then, create a Pricebook Entry record for Standard Pricebook and a Pricebook Entry record for custom pricebook(associate the pricebook and product created in previous steps).

This works absolutely fine when I validate Rate Card records manually one by one in UI. But, we have around 500+Rate Card records for which we need to create Pricebook, Product and Pricebook Entry records. So, I went ahead and used dataloader.io to update Validated flag and unfortunately, flow created duplicate Pricebook records and this issue happens only for the account which has more than one Rate Card.

When I investigated further, I could find this link https://developer.salesforce.com/forums/ForumsMain?id=906F0000000ArtkIAC which highlights the same issue.

When I checked the logs, it looks like the flow runs in parallel for all the records that I updated so the first step Lookup Pricebook did not find the Pricebook for the  updated records, hence created duplicate entries.

Then, I found a workaround by extracting the accounts which has more than one Rate Card. From the list, make sure that I extracted Rate Card records which has unique account ids and update the Validated flag.  System created Pricebook, Products and Pricebook Entry as expected without any duplicates.Then, updated the Validated flag for the rest of the records and system created Pricebook, Products and Pricebook Entry records.

Has anyone else faced this issue before? Is it a known issue and if so, is there an idea for it in Salesforce Success community? Please let me know your comments.

 

Tip#16 – Overriding Standard New button

10 Tuesday Nov 2015

Posted by Mani in Visualforce

≈ 1 Comment

Tags

Alert on new button, Override New button, Visualforce

Suppose, you have created a flow which will create Opportunity and this process is invoked by a custom button (Create Opportunity) on the Account object. In this case, you might want to override New button available in Opportunity tab(Recent records) with the Visualforce page and clicking on it, should throw an error message saying that Opportunity can be created by clicking on Create Opportunity button in Account record.

Also, provide a back button in the VF page and code for the same is given below:


<apex:page standardController="Opportunity">
<p>You cannot create an opportunity from here, instead click on Create Opportunity button by going to Account Detail page.</p>
<apex:form>
<apex:commandbutton action="{!cancel}" value="Return" rerender=""/>
</apex:form>
</apex:page>

Tip# 15 – Matching Rule

27 Tuesday Oct 2015

Posted by Mani in Salesforce Configuration

≈ Leave a comment

Tags

duplicate management, matching rule, matching rule criteria

Recently, I have got chance to work in Matching rule for Account, Contact and a custom object.
Have a look at these videos to get an introduction about Duplicate Management and Matching rules:
http://salesforce.vidyard.com/watch/PdYJPLbTqiI-kCXlWrr32w

Few points to note:

a. A matching rule can have only one lookup relationship field.
b. We cannot have a Date field in the matching criteria. Work around is to have a text field which has the date in text format and use it in the Matching Criteria. Suppose, you have a DOB field and to use it in the criteria, create a text field which will hold the date in text format. You can have a workflow to update this field when DOB is not empty(use TEXT() function).
c. We cannot have multi select field in the matching criteria.

Please let us know your comments.

P.S: When you use TEXT function, Dates are returned in the form of YYYY-MM-DD, that is, a four-digit year and two-digit month and day.

← Older posts
Newer posts →

Blog Stats

  • 144,702 hits

Archives

Recent Posts: Salesforce Everywhere

Einstein GPT

How to get field values on onLoad in lightning-record-edit-form in LWC?

Using Dynamic Actions

How to check if the logged in user is a Guest user or not in APEX class?

How to Close Quick action in LWC

Connect with me

  • View @manibalan_s’s profile on Twitter
  • LinkedIn

Enter your email address and click on Follow us (below) to follow this blog and receive notifications of new posts by email.

Website Powered by WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
    • Salesforce Everywhere
    • Already have a WordPress.com account? Log in now.
    • Salesforce Everywhere
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar