clsImportBusinessPartner Class |
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.Namespace: MARIInterface
The clsImportBusinessPartner type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportBusinessPartner | Initializes a new instance of the clsImportBusinessPartner class |
| Name | Description | |
|---|---|---|
| Bank1Account | Main Bank information: account number | |
| Bank1BankCode | Main Bank information (old BLZ in Germany) | |
| Bank1BankName | Main Bank information: Bank Name (optional) | |
| Bank1IBAN | Main Bank information: Unique IBAN Code | |
| Bank1SwiftNum | Main Bank information: Swift Code | |
| Billing_AdressID |
Address identifier for the first address in CRD1
| |
| Billing_Block |
Address via CDR1. Use Billing_AdressID as identifier.
| |
| Billing_City |
Address via CDR1. Use Billing_AdressID as identifier.
| |
| Billing_Country |
Address via CDR1. Use Billing_AdressID as identifier.
| |
| Billing_County |
Address via CDR1. Use Billing_AdressID as identifier.
| |
| Billing_Name2 |
Address via CDR1. Use Billing_AdressID as identifier.
| |
| Billing_Name3 |
Address via CDR1. Use Billing_AdressID as identifier.
| |
| Billing_State |
Address via CDR1. Use Billing_AdressID as identifier.
| |
| Billing_Street |
Address via CDR1. Use Billing_AdressID as identifier.
| |
| Billing_StreetNo |
Address via CDR1. Use Billing_AdressID as identifier.
| |
| Billing_ZipCode |
Address via CDR1. Use Billing_AdressID as identifier.
| |
| BlockCommunicationEMail | Block Marketing communication SELECT Select FROM CRDC CardCode= AND CommMeanId=-1 | |
| BlockCommunicationFax | Block Marketing communication SELECT Select FROM CRDC CardCode= AND CommMeanId=-2 | |
| CardCode | Primary Key for the business parner | |
| CardFName | CardFName | |
| CardName | CardName | |
| CardType |
Mandatory field: C=Customer, S=Supplier, L=Lead. eCardType.
| |
| Cellular | Cellular | |
| ChannlBP |
BP Channel Code Link to existing channel partner OCRD.ChanelBP
| |
| CollectionCDR1 |
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 | |
| CollectionContactPerson |
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 | |
| Country | Country | |
| Currency | Currency | |
| E_Mail | E_Mail | |
| Fax | Fax | |
| Free_Text | Free_Text | |
| GroupCode | Customer Group, Supplier Group. Referenced to OCRG.GroupCode | |
| GroupCodeByName |
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
| |
| GroupNum | Obsolete.
In the frontend: PaymentTerm | |
| IndustryC | IndustryC -> OOND.IndCode | |
| IntrntSite | website of the business client | |
| LangCode |
Language code (see SELECT Code FROM OLNG)
| |
| LicTradNum | LicTradNum | |
| ListNum | OCRG.ListNum | |
| Notes | Notes | |
| PaymentTerm |
Payment Term. Reference to OCTG.GroupNum
| |
| Phone1 | Phone1 | |
| Phone2 | Phone2 | |
| PymCode | Payment Method Zahlweg referenced by OPYM | |
| Ship_AdressID |
Address indentifier for the shipping address in CRD1
| |
| Ship_Block |
2. Address via CDR1.Block Use Ship_AdressID as identifier.
| |
| Ship_City |
2. Address via CDR1.City Use Ship_AdressID as identifier.
| |
| Ship_Country |
2. Address via CDR1.Country Use Ship_AdressID as identifier.
| |
| Ship_County |
2. Address via CDR1.County Use Ship_AdressID as identifier.
| |
| Ship_Name2 |
2. Address via CDR1.Address2 Use Ship_AdressID as identifier.
| |
| Ship_Name3 |
2. Address via CDR1.Address3 Use Ship_AdressID as identifier.
| |
| Ship_State |
2. Address via CDR1.State Use Ship_AdressID as identifier.
| |
| Ship_Street |
2. Address via CDR1.Street Use Ship_AdressID as identifier.
| |
| Ship_StreetNo |
2. Address via CDR1.StreetNo Use Ship_AdressID as identifier.
| |
| Ship_ZipCode |
2. Address via CDR1.ZipCode Use Ship_AdressID as identifier.
| |
| SlpCode | Sales Employee Code refernced by OSLP.SlpCode | |
| U_MARINam2 | U_MARINam2 Additional second name field | |
| U_MARINam3 | U_MARINam3 Additional third name field | |
| VatGroup |
VAT Group OCRD.VatGroup or OCRD.EVVatGroup VarChar 8
| |
| VatIdUnCmp | Obsolete. VatIdUnCmp | |
| VatStatus |
| Name | Description | |
|---|---|---|
| bReadFromDB |
Reads the item data from the database and copies the values to the class
(Overrides clsImportBasebReadFromDB(MPInterface, String).) | |
| bSaveRSToMDB | (Overrides clsImportBasebSaveRSToMDB(MPInterface, DataRow, DataTable).) | |
| bValidateAndRemove |
Allows to remove an SBO business partner via DI-API. SBO will check, if it is allowed to remove.
(Overrides clsImportBasebValidateAndRemove(MPInterface).) | |
| sGetNewBusinessPartnerNumber |
Fuction to suggest a next free number in OCRD. This function does not use the Number Series Function of SBO.
|
| Name | Description | |
|---|---|---|
| BPProperties |
64 SBO Properties to the SBO Business Partner Properties. (0Based 0-63)
| |
| CreateDate |
Read Only
| |
| U_Incoterm | Obsolete.
Special User Defined Field for one customer. Do not use.
|
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; } }