locked
PreCreate does not get calles when promoting quote to salesorder RRS feed

  • Question

  •  

    I have written some code that adds an autonumbering to my salesorders. When I add a salesorder, it works like a charm, but when I promote a quote to a salesorder, there is no autonumber....

     

    Anyone a suggestion on how to get autonumbers working for a salesorder when the PreCreate event does not get fired?

     

    Friday, September 28, 2007 8:03 AM

Answers

  • The workaround I use is to use a workflow rule with a workflow .Net assembly. Not as elegant, but it gets the issue that callouts don't fire in all circumstances

     

    Friday, September 28, 2007 8:23 AM
    Moderator

All replies

  • The workaround I use is to use a workflow rule with a workflow .Net assembly. Not as elegant, but it gets the issue that callouts don't fire in all circumstances

     

    Friday, September 28, 2007 8:23 AM
    Moderator
  •  

    And then fire on the event "Create"?  (I have dutch workflows, the options are: Manual, assign, create, state change)

     

    Same goes for sales order to invoice, by the way.

     

    Friday, September 28, 2007 8:36 AM
  • Hi,

    Yes, it needs to be on Create event in workflow.

     

    Anothe option can be writing a webservice to generate autonumber and than using it in onLoad of the entity's form.

     

    Friday, September 28, 2007 9:54 AM
    Moderator
  • Such a webservice sounds as a bad practise to me:

    • What if two individuals try to create a salesorder at the same time
    • or if the webservice remembers what numbers has been given: what if not all forms are actually saved?

    It's crucial that the autonumber has no "gaps" in it.

    Monday, October 1, 2007 8:06 AM
  • Hi Jean,

    Web service will not save the last autonumber if you dont develop special logic for that purpose by saving the autonumber to some file.

    The better option is to everytime you need to create new autonumber, first fetch the last created autonumber, increament it and use it. In this way you will always have the latest autonumber.

    Monday, October 1, 2007 10:18 AM
    Moderator