Skip to Content
author's profile photo Former Member
Former Member

Auto id (code) in BP Master Data

Can someone help with pointing me to information how to set up auto ID(code) in Business Partner Master Data? Can't find in help files. The same thing with article auto id.

Thank you in advance

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Jan 10, 2007 at 12:27 AM

    Hi Alex,

    You can't set an automatic code for BPs. However, you could use a formatted search to bring up the next code, provided that the code you are using has a logical sequence. You can assign this formatted search to the BP Code field and then the user can trigger it (Shift-F2) when they are creating a new BP. If you want to have a separate range for each BP type then the user needs to set the BP type field before using the formatted search.

    I've also included this kind of function in an add-on. In this case, the query is still the same but the user leaves the BP Code field blank and the add-on will populate it when the user clicks on the Add button.

    Hope this helps,

    Owen

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 07:15 AM

    Check this for generating unique numbers that can be used in IDs:

    Unique Number

    HTH

    Juha

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 09:33 AM

    Hi Alex,

    you try this code for set next code for business partners.

    string code = ClsDIGeneric.GetMaxKeyForUserDefineTable("OCRD","Code",SBOCompany ,"");

    it will get the next maximum code available for business partner master.

    hope it will work.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Ad Kerremans

      Hi,

      you can write this part of code instead of first one:

      SAPbobsCOM.Recordset rs;

      string strSql = "Select ISNULL(Max(convert(int,code)),0) +1 as NewCode from " + "table name" + "";

      rs = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);

      rs.DoQuery(strSql);

      if(rs.RecordCount > 0)

      {

      code = rs.Fields.Item(0).Value.ToString();

      }

      in code you will get the next maximum value.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.