• laxman.g1.3964314255283564E12
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Hello friends, hope u will help me. I want to write a trigger for autonumber field which will start from 1, as day begines. Normally autonumber field is keep on incresing daily. But i dont want that, it should start from 1 as day begins. Help me writing trigger for this.
Hi, this Laxman, my question is , i want to create autonumber with date. that autonumber should change whenever the date changes. i.e autonumber should start with one as the day starts. Is that possible in salesforce. Please guide me.

We have ONE object with 3 different record types:

 

1. Purchase Orders (PO)

2. Invoices (Inv)

3. Official Receipts (OR)

 

There are three different operating branches that uses these, example as below:

 

1. New York

2. Sydney

3. Paris

 

We want to have different auto-numbers for these 3 different record types for these 3 different branches. Example as follows:

 

NY-PO-1001

NY-PO-1002

SYD-PO-1001

SYD-PO-1002

PA-PO-1001

PA-PO-1002

NY-Inv-1001

NY-Inv-1002

SYD-Inv-1001

SYD-Inv-1002

PA-Inv-1001

PA-Inv-1002

NY-OR-1001

NY-OR-1002

SYD-OR-1001

SYD-OR-1002

PA-OR-1001

PA-OR-1002

 

Using Auto-Numbers in Salesforce produces the result below, which we DO NOT WANT:

 

NY-PO-1001

NY-PO-1002

SYD-PO-1003

SYD-PO-1004

PA-PO-1005

PA-PO-1006

NY-Inv-1007

NY-Inv-1008

SYD-Inv-1009

SYD-Inv-1010

PA-Inv-1011

PA-Inv-1012

NY-OR-1013

NY-OR-1014

SYD-OR-1015

SYD-OR-1016

PA-OR-1017

PA-OR-1018

 

What is the solution without APEX or triggers for this?

 

If there is no standard solution in Salesforce, what do we need to do for APEX / Triggers to resolve the above?