function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Stewart McNaughtStewart McNaught 

Using visual workflow to pre-populate object name - add autonumber if duplicated

We are looking at solutions to automate the opportunity names. 

 

The current proposal is a custom button is used to evoke the flow.

- URL HACK - provides current user id, account id

- Flow looks up oppty record types available to user

- Flow looks up account record (contact record if person account via subflow)

- Flow checks to see if record type uses automated names

 

Proposed format is as follows:

[ACCOUNT NAME]-[PRODUCT]-[AMOUNT]-[AUTONUMBER]

 

The autonumber is optional and is only added it the first three variables are already used in a name.

Examples:

JOHN DOE - APPLE PRODUCT - 1000

JOHN DOE - APPLE PRODUCT - 1000 - 2

JOHN DOE - APPLE PRODUCT - 1000 - 3

JOHN DOE - APPLE PRODUCT - 1000 - 4

 

 

Can visual workflow (Cloud Designer) be used to generate the autonumber?

RajaramRajaram

Your best option is to use workflow rules and field update action for this.

Here are your steps:

1. Create a new custom field called "Auto" with the type set to "Auto Number"

2. Create a new workflow rule on the opty record

3. Create a field update to update the name field with something like 

    Account.Name & " - " & Name & " - " & Auto__c

4. Not sure how you are going to get a product though.. if that is always constant, then you use that in the field update formula

 

Hope this helps..