Results 1 to 4 of 4

Thread: How to create an account number automatically

  1. #1
    ptemplin7 is offline Sugar Community Member
    Join Date
    Jun 2007
    Location
    Puget Sound Washington
    Posts
    380

    Question How to create an account number automatically

    Sugar 5.0a
    CentOS 5
    php 5.1
    Apache 2.X
    Mysql 5

    Hi All,

    I know the basic logic and could probably do this in C but my php is rather rusty and frankly I don't have the time to waste if someone out there already basically has this implemented!

    What I want to do is to have sugar create a account number for me using the format YYMM### where YY is 08 for 2008, MM is 01 for January, (These are easy!) and ### is a growing number for accounts/leads for the month. We would like to have the opportunities for an account and the account name have this number at the start of the name. The rest of the name will have the last,first of the customer, the Opportunities will have something similar.

    I suppose I could read the accounts file and determine the next number to assign but is there an easier way to do this. We would prefer to only assign the number once the lead is converted or if there is an account added. Thus the account name filed in the leads module will likely be ignored.

    If someone has the php code to do this or something similar that would be great. I would save me lots of agony and allow me to concentrate on getting this application up for the office.

    Thanks for any help or suggestions,
    Paris

  2. #2
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: How to create an account number automatically

    Sounds like a SalesForce calculated field...
    I had the same problem and solved it like described in this thread
    For details you should search for "logic hooks" in sugarcrm wiki too.

    have fun
    hk

  3. #3
    ptemplin7 is offline Sugar Community Member
    Join Date
    Jun 2007
    Location
    Puget Sound Washington
    Posts
    380

    Talking Re: How to create an account number automatically

    Thanks,

    I'll check those out. Tried to search but didn't find anything.
    Company does not currently have official numbering system (actually 1/2 doesn't!) Trying to organize things and also eliminate a field or too that keeps track of how long they have been a customer (hence the year and month!).

    thanks again,
    Paris

  4. #4
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: How to create an account number automatically

    The stored procedure only can work if there is an initial line.

    At last I added one initial line to table config with values ('kuske', 'offer_number', '1').

    Do not forget this line !

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Create new Account with new Contact?
    By GameboyRMH in forum Help
    Replies: 0
    Last Post: 2008-01-07, 05:19 PM
  2. Automatically associate a Lead to an Account
    By bjs3 in forum General Discussion
    Replies: 0
    Last Post: 2007-07-17, 11:27 AM
  3. Replies: 2
    Last Post: 2007-04-09, 07:11 PM
  4. Replies: 1
    Last Post: 2006-12-04, 01:34 PM
  5. Automatically Link Lead to Account
    By cmarcus in forum Feature Requests
    Replies: 2
    Last Post: 2006-03-20, 02:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •