cancel
Showing results for 
Search instead for 
Did you mean: 

copying items through diffrent companies

Former Member
0 Kudos

Hello Everyone

I'm trying to copy an Item object (OITM) from one company to another.

i'm loading the item to the instance through GetByKey function (after it been initialized by the original company instance) but i'm confused about how can i add it to a diffrent company, with all the info held within (of the item).

Blessings

Robert

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear RobertHague,

I think just open the file then copy/ paste it.

Best Regards

Jane Jing

SAP Business One Forums team

Former Member
0 Kudos

I have got the same problem.

Below content of exported file (ChartOfAccounts):

BR,

Andrzej

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear RobertHague,

Could you show one xml file of the item for check?

Best Regards

Jane Jing

SAP Business One Forums team

Former Member
0 Kudos

I save it to the file through SaveXML in the Items object.

But i couldn't load it here as text, isn't there a way to upload files?

Former Member
0 Kudos

Hello Robert,

You could save the item as XML file (SaveXML method). Then, call the GetBusinessObjectFromXML method to load this item into memory again.

For more detailed information including code samples, see the SDK Help Center

"Exchanging Data Using the DI API XML Capabilities"

or code samples provided with the SDK package.

Hope this information helps.

Kind Regards,

Friederike Mundt

SAP Business One Forums Team

Edited by: Paul Finneran on Jun 9, 2009 2:34 PM

Former Member
0 Kudos

Thank you for the advice.

I did saved the object as XML file, but when i'm trying to upload it back to an Items object:

oItems = ((SAPbobsCOM.Items)(globals.oCompany.GetBusinessObjectFromXML(XMLfilePath, 0)));

i'm getting a very long exception error, in this shape (it's just the beginning of him):

<ErrorList>

<Error>System Id = 143853424, Line Number = 1, Column Number = 79, Description = The namespace of element 'schema' must be from the schema namespace.</Error>

<Error>System Id = 143853424, Line Number = 1, Column Number = 99, Description = The namespace of element 'element' must be from the schema namespace.</Error>

<Error>System Id = 143853424, Line Number = 1, Column Number = 112, Description = The namespace of element 'complexType' must be from the schema namespace.</Error>

<Error>System Id = 143915240, Line Number = 1, Column Number = 117, Description = The namespace of element 'all' must be from the schema namespace.</Error>

<Error>System Id = 143915240, Line Number = 1, Column Number = 164, Description = The namespace of element 'element' must be from the schema namespace.</Error>

<Error>System Id = 143915240, Line Number = 1, Column Number = 177, Description = The namespace of element 'complexType' must be from the schema namespace.</Error>

<Error>System Id = 143915240, Line Number = 1, Column Number = 187, Description = The namespace of element 'sequence' must be from the schema namespace.</Error>

<Error>System Id = 143915240, Line Number = 1, Column Number = 239, Description = The namespace of element 'element'

do you have any idea why is that?

Thanks alot!

Robert