on 08-01-2013 12:18 PM
I tried to create Business Partner programmatically using xml and created a series for Business Partner numbering that conforms to the CardCodes I want to assign (e.g. the first CardCode I use is precisely the one designated as next number in SBo and all other CardCodes are just increments of it) and tried to create new series and use these in the xml, but it still always returns me this error:
4002 To generate this document, first define the numbering series in the Administration module
Then I tried just using the BusinessPartners class and filling its porperties but it returns me this error: -5002 Code undefined [OCRD.CardCode]
This is the code:
BusinessPartners bp = DBProvider.myCompany.GetBusinessObject(BoObjectTypes.oBusinessPartners);
bp.CardName = "Create Test";
bp.Addresses.TypeOfAddress = "B";
bp.Addresses.Street = "Ordensmeisterstr.";
bp.Addresses.StreetNo = "5";
bp.Addresses.ZipCode = "12099";
bp.Addresses.City = "Berlin";
bp.Addresses.Country = "DE";
bp.UserFields.Fields.Item("U_MANUMODGR").Value = "N";
bp.UserFields.Fields.Item("U_ISACCOUNT").Value = "N";
int returnvalue = bp.Add();
TB_Info.Text += " retval: " + returnvalue.ToString();
if (returnvalue != 0)
{
string msg;
DBProvider.myCompany.GetLastError(out returnvalue, out msg);
TB_Info.Text += " " + msg;
}
How can I programmatically create many Business Partners? I need a lot of data for testing certain processes (10,000 or maybe even 100,000 Business Partners).
And what would be the fastest way?
Thanks.
Hi benjamin,
Can you test to create manually 1 bp from the sbo application using the user login?
It looks like an authorization problem.
Regards,
Edy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Nope....
The only case (from what I know ) where you don't have to specify the CardCode while creating a BP is because you have created a document numbering schema for BP.
So, to make it working:
Besides the fact that it will certainly don't work for the sample, because of the address.
Regards,
Eric
User | Count |
---|---|
94 | |
11 | |
10 | |
6 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.