• About
  • Contact me!

Salesforce Everywhere

~ Blog on Salesforce Dev and admin stuff

Salesforce Everywhere

Tag Archives: 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#7: Adding Hyperlink in the flow

16 Wednesday Sep 2015

Posted by Mani in Flow, Salesforce Configuration

≈ 16 Comments

Tags

Adding Hyperlink in the flow, Flow

UPDATE:

Thanks Evan for your comments!!

In more recent versions of Flow, you can simply have your URL point to /{!RecordId} and Salesforce will correctly navigate to the record. Obviously, RecordId variable in the flow should hold the Id of the record. I did a quick check on this in my Dev edition org and it worked.

Here is how you can do it in the new flow builder:

Create a screen element with the Display text as Link(or whatever you name the text) and give the hyperlink as /{!RecId} where RecId is the flow variable which holds the Id of the created record or the Id of the record to be navigated to, after the user clicks on the Display text(Link). Screenshot is given below for your reference:

Link screenshot2

How to achieve this in Old Flow Builder:

For example, there is a flow which gets inputs from user and creates a RateCard(Custom object) record, if it doesn’t exist in the system. Once created, it should show the URL(clickable) of the record created.

This is possible by editing the screen(which is the last step in the flow) and the Display text field there is a little button which shows T(marked in yellow colour in the screenshot below) with what looks like a selection box around it. Type the text you want (View the RateCard record here). Highlight it, and in one of the fields that showed up you can put in the url,something like https://cs5.salesforce.com/{!RateCardIdcreated}

Adding Hyperlink in the Flow

Clickable link
P.S: RateCardIdcreated holds the Id of the RateCard record created.

Please let me know your comments.

Blog Stats

  • 111,809 hits

Archives

Recent Posts: Salesforce Everywhere

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

Lightning component to filter Products and display results in lightning data table

Connect with me

  • View @manibalan_s’s profile on Twitter
  • LinkedIn

Developer links

  • Salesforce Developer website
  • Salesforce Success Community

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.

  • Follow Following
    • Salesforce Everywhere
    • Already have a WordPress.com account? Log in now.
    • Salesforce Everywhere
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar