Click or drag to resize

clsImportBusinessPartner Class

Creates a new business partner data to SAP Business One OCRD table via DI-API or ServiceLayer.

Please make sure, that SAP Business One DI-API in 32 or 64 bit is installed according to the usage of this interface. The logon user in MARIProject has to have a corresponding user linked to the selected company database.

Use MPInterface.bImportBusinessPartner(clsImportBusinessPartner, clsImportBaseeImportMode) to import.
Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportBaseERP
      MARIInterfaceclsImportBusinessPartner

Namespace:  MARIInterface
Assembly:  MARIInterface (in MARIInterface.dll) Version: 8.0.0.100
Syntax
public class clsImportBusinessPartner : clsImportBaseERP

The clsImportBusinessPartner type exposes the following members.

Constructors
  NameDescription
Public methodclsImportBusinessPartner
Initializes a new instance of the clsImportBusinessPartner class
Top
Properties
  NameDescription
Public propertyBank1Account
Main Bank information: account number
Public propertyBank1BankCode
Main Bank information (old BLZ in Germany)
Public propertyBank1BankName
Main Bank information: Bank Name (optional)
Public propertyBank1IBAN
Main Bank information: Unique IBAN Code
Public propertyBank1SwiftNum
Main Bank information: Swift Code
Public propertyBilling_AdressID
Address identifier for the first address in CRD1
Public propertyBilling_Block
Address via CDR1. Use Billing_AdressID as identifier.
Public propertyBilling_City
Address via CDR1. Use Billing_AdressID as identifier.
Public propertyBilling_Country
Address via CDR1. Use Billing_AdressID as identifier.
Public propertyBilling_County
Address via CDR1. Use Billing_AdressID as identifier.
Public propertyBilling_Name2
Address via CDR1. Use Billing_AdressID as identifier.
Public propertyBilling_Name3
Address via CDR1. Use Billing_AdressID as identifier.
Public propertyBilling_State
Address via CDR1. Use Billing_AdressID as identifier.
Public propertyBilling_Street
Address via CDR1. Use Billing_AdressID as identifier.
Public propertyBilling_StreetNo
Address via CDR1. Use Billing_AdressID as identifier.
Public propertyBilling_ZipCode
Address via CDR1. Use Billing_AdressID as identifier.
Public propertyBlockCommunicationEMail
Block Marketing communication SELECT Select FROM CRDC CardCode= AND CommMeanId=-1
Public propertyBlockCommunicationFax
Block Marketing communication SELECT Select FROM CRDC CardCode= AND CommMeanId=-2
Public propertyCardCode
Primary Key for the business parner
Public propertyCardFName
CardFName
Public propertyCardName
CardName
Public propertyCardType
Mandatory field: C=Customer, S=Supplier, L=Lead. eCardType.
Public propertyCellular
Cellular
Public propertyChannlBP
BP Channel Code Link to existing channel partner OCRD.ChanelBP
Public propertyCollectionCDR1
Collection of additional addresses. The Main billing address (via properties Billing_AdressID..) and shippping address (via properties Ship_AdressID ...) are already in this collection.

>You can add additional addresses. clsImportBPAddress for property details

Public propertyCollectionContactPerson
Property to attach a list oc Contact Person to be created with the business partner together. The card code (potentially the new CardCode) will automatically linked to all contract person in this collection.

In the update approach, only contact person with the same Name can be updated. Changing of the name is not possible

Public propertyCountry
Country
Public propertyCurrency
Currency
Public propertyE_Mail
E_Mail
Public propertyFax
Fax
Public propertyFree_Text
Free_Text
Public propertyGroupCode
Customer Group, Supplier Group. Referenced to OCRG.GroupCode
Public propertyGroupCodeByName
Helper variable to search [SELECT GroupCode FROM OCRG WHERE GroupName=UPPER() AND GroupType='C'/'S'] for or create the customer or supplier group in OCRG
Public propertyGroupNum Obsolete.
In the frontend: PaymentTerm
Public propertyIndustryC
IndustryC -> OOND.IndCode
Public propertyIntrntSite
website of the business client
Public propertyLangCode
Language code (see SELECT Code FROM OLNG)
Public propertyLicTradNum
LicTradNum
Public propertyListNum
OCRG.ListNum
Public propertyNotes
Notes
Public propertyPaymentTerm
Payment Term. Reference to OCTG.GroupNum
Public propertyPhone1
Phone1
Public propertyPhone2
Phone2
Public propertyPymCode
Payment Method Zahlweg referenced by OPYM
Public propertyShip_AdressID
Address indentifier for the shipping address in CRD1
Public propertyShip_Block
2. Address via CDR1.Block Use Ship_AdressID as identifier.
Public propertyShip_City
2. Address via CDR1.City Use Ship_AdressID as identifier.
Public propertyShip_Country
2. Address via CDR1.Country Use Ship_AdressID as identifier.
Public propertyShip_County
2. Address via CDR1.County Use Ship_AdressID as identifier.
Public propertyShip_Name2
2. Address via CDR1.Address2 Use Ship_AdressID as identifier.
Public propertyShip_Name3
2. Address via CDR1.Address3 Use Ship_AdressID as identifier.
Public propertyShip_State
2. Address via CDR1.State Use Ship_AdressID as identifier.
Public propertyShip_Street
2. Address via CDR1.Street Use Ship_AdressID as identifier.
Public propertyShip_StreetNo
2. Address via CDR1.StreetNo Use Ship_AdressID as identifier.
Public propertyShip_ZipCode
2. Address via CDR1.ZipCode Use Ship_AdressID as identifier.
Public propertySlpCode
Sales Employee Code refernced by OSLP.SlpCode
Public propertyU_MARINam2
U_MARINam2 Additional second name field
Public propertyU_MARINam3
U_MARINam3 Additional third name field
Public propertyVatGroup
VAT Group OCRD.VatGroup or OCRD.EVVatGroup VarChar 8
Public propertyVatIdUnCmp Obsolete.
VatIdUnCmp
Public propertyVatStatus
Top
Methods
  NameDescription
Public methodbReadFromDB
Reads the item data from the database and copies the values to the class
(Overrides clsImportBasebReadFromDB(MPInterface, String).)
Public methodbSaveRSToMDB (Overrides clsImportBasebSaveRSToMDB(MPInterface, DataRow, DataTable).)
Public methodbValidateAndRemove
Allows to remove an SBO business partner via DI-API. SBO will check, if it is allowed to remove.
(Overrides clsImportBasebValidateAndRemove(MPInterface).)
Public methodsGetNewBusinessPartnerNumber
Fuction to suggest a next free number in OCRD. This function does not use the Number Series Function of SBO.
Top
Fields
  NameDescription
Public fieldBPProperties
64 SBO Properties to the SBO Business Partner Properties. (0Based 0-63)
Public fieldCreateDate
Read Only
Public fieldU_Incoterm Obsolete.
Special User Defined Field for one customer. Do not use.
Top
Remarks
Examples
Create new business partner (via DI-API)
public bool CreateBusinessPartner(string sNewCardCode, string sNewMatchcode) {

    clsImportBusinessPartner NewBP = new clsImportBusinessPartner();
    NewBP.CompanyID = 1; // First company linked to MARIProject
    NewBP.CardCode = sNewCardCode;
    NewBP.CardName = sNewMatchcode;
    NewBP.CardFName = sNewMatchcode;
    NewBP.GroupCode = 100;

    NewBP.CardType = clsImportBusinessPartner.eCardType.C; // SBO Code for customer
    NewBP.Billing_AdressID = "Billing Address";
    NewBP.Billing_Street = "Stolberger Str. 114a";
    NewBP.Billing_Name2 = "";
    NewBP.Billing_Name3 = "";
    NewBP.Billing_Block = "";
    NewBP.Billing_County = "";
    NewBP.Billing_State = "";
    NewBP.Billing_ZipCode = "50933";
    NewBP.Billing_City = "Cologne";
    NewBP.Billing_Country = "DE";
    NewBP.Phone1 = "+49 221 949058-0";
    NewBP.Phone2 = "+49 221 949058-30";
    NewBP.Fax = "+49 221 949058-8";
    NewBP.Cellular = "";
    NewBP.E_Mail = "ingo@maringo.de";
    NewBP.IntrntSite = "www.maringo.de";
    NewBP.Free_Text = "Import via MARIInterface";
    NewBP.SlpCode = 1; //SELECT SlpCode FROM OSLP
    NewBP.PaymentTerm = 4; //SELECT GroupNum FROM OCTG

    clsImportBPContactPerson oContactPerson;
    oContactPerson = new clsImportBPContactPerson();
    oContactPerson.Name = "Peter Smith";
    oContactPerson.FirstName = "Peter";
    oContactPerson.MiddleName = "F";
    oContactPerson.LastName = "Smith";
    oContactPerson.E_MailL = "peter.smith@company.com";
    oContactPerson.Title = "Phd.";
    oContactPerson.Profession = "General Manager";
    oContactPerson.Address = "Head Quaters";
    oContactPerson.Tel1 = "+49 221 949058-11";
    oContactPerson.Cellolar = "+49 172 2978199";
    oContactPerson.Notes1 = "This is the best";
    oContactPerson.Gender = clsImportBPContactPerson.eGender.Male;
    NewBP.CollectionContactPerson.Add(oContactPerson);
    oContactPerson = new clsImportBPContactPerson();
    oContactPerson.Name = "Karin Tounsend";
    oContactPerson.FirstName = "Karin";
    oContactPerson.LastName = "Tounsend";
    oContactPerson.E_MailL = "karin.Tounsend@company.com";
    oContactPerson.Profession = "CFO";
    oContactPerson.Address = "Head Quaters";
    oContactPerson.Tel1 = "+49 221 949058-14";
    oContactPerson.Notes1 = "This is the best";
    oContactPerson.Gender = clsImportBPContactPerson.eGender.Female;
    NewBP.CollectionContactPerson.Add(oContactPerson);

    if (oMPInterface.bImportBusinessPartner(NewBP, clsImportBase.eImportMode.ValidateAndImport)) {
        return true;
    } else {
        LogFail(oMPInterface.oErrors.PrintErrors());
        return false;
    }
}
See Also