Skip to Content
avatar image
Former Member

Autogenerate Business Partner Code

Hi,

Has anyone customized the B1 BP Master Data form to enable the system to automatically generate a BP code while in ADD mode? Our client, understandably, does not want to have to refer to a separate list in order to find the next sequential BP number when adding a new BP. It would also be very cool if customer codes could be preceded by a "C", vendor codes by a "V" and leads by an "L".

Any information is appreciated.

Thanks,

Ted

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Aug 17, 2007 at 10:16 AM

    Hi

    We did it with a formatted search and shift F2:

    SELECT CASE WHEN $[OCRD.CardType] = 'S' THEN 'S' ELSE 'C' END + CAST((MAX(CAST(RIGHT(T0.CardCode, (LEN(T0.CardCode)-1)) AS INT))+1) AS VARCHAR) FROM OCRD T0

    We don't tend to use Leads, hence no "L", but you could easily add it in. You need to choose the BP type first, before the shift F2.

    Alternative B1UP from www.b1up.net will auto generate the numbers, but not the prefix.

    Regards

    Mark

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      You can not run a query referencing a screen variable eg $[OCRD.CardType]='C' using the execute command in a normal query window. The variables are grabbed from the currently active screen, so the way to do it is to run it off of a shift F2 behind a field on the screen you are grabbing from.

      Regards

      Mark