This topic contains 4 replies, has 0 voices, and was last updated by Duncan 7 years, 3 months ago.

  • Author
    Posts
  • #10335 Score: 0

    Duncan
    • Contributions: 0
    • Level 1

    Hi,

    We’d like to have the Invoice Numbers based on the Sales Order numbers they are created from. We created a event-based workflow for Invoices (On Create) updating Invoice Number field:

    Code:
    Invoice Number=XX-{createdfrom}
    When we bill a Sales Order, we still see the autogenerated number in the newly created invoice. We changed the Workflow to test with a static value to make sure formula is not the culprit:

    Code:
    Invoice Number=AB-123123
    Still nothing.

    I changed “On Create” to “Before Submit” to eliminate the possibility that the auto-number generator runs after our workflow, but that did not help either.

    What are we missing? TIA.
    This is a cached copy. Click here to see the original post.

  • #10336 Score: 0

    MikeBucklaew
    • Contributions: 0
    • Level 1

    I think it would have to be “After Submit” and you’ll need to check the “Allow Override” box in “Set Up Auto-Generated Numbers”. You will have to watch out for duplicate invoice numbers if a sales order requires multiple invoices ever. Full disclosure – I haven’t tried this.

  • #10337 Score: 0

    Duncan
    • Contributions: 0
    • Level 1

    Originally posted by MikeBucklaew

    View Post

    I think it would have to be “After Submit” and you’ll need to check the “Allow Override” box in “Set Up Auto-Generated Numbers”. You will have to watch out for duplicate invoice numbers if a sales order requires multiple invoices ever. Full disclosure – I haven’t tried this.

    Thanks for the answer. If we do it this way, it sounds like it will change the invoice number after saving the invoice. We would rather see the invoice number in the text box before submitting since there could be duplicates like you said, and put “B” at the end before submitting it.

  • #10338 Score: 0

    Olivier Gagnon NC
    • Contributions: 0
    • Level 1

    Hmm, that is a little odd. My only thought would be to experiment with a client-side script instead of a workflow, see if that solves it. I would also tend to think it’s a timing thing, but then you moving the trigger to before submit should have solved the problem, I would have imagined. So, not sure.

  • #10339 Score: 0

    Duncan
    • Contributions: 0
    • Level 1

    I am happy to report that we were able to do this with the help of Netsuite support just using Workflows. The field to be updated is Ref No. Formula is ‘XX-‘||{createdfrom.tranid}

    Also we had to put a trigger condition “CreatedFrom is not Empty” so that this would only trigger for the invoices created from Sales Orders.

You must be logged in to reply to this topic.