cancel
Showing results for 
Search instead for 
Did you mean: 

Getting error in BusinessPartners UpdateObject on DI Server

jthomas3
Explorer
0 Kudos

Hi,

I'm trying to update a BusinessPartner through UpdateObject XML code but I get an error... I got through some other post in this forum and it seems my code is like suggested there

I can create new BusinessPartners without problems (using nearly the same code with the AddObject command), but today I tried to create the code for UpdateObject and I get the following error back (I started just updating the CardName, like suggested in other posts)

here my code and the reply from DI server:

<?xml version="1.0" encoding="utf-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">

<SOAP-ENV:Header >

  <SessionID>C5A03D9D-B46C-46E3-B768-D4C9FB120074</SessionID>

</SOAP-ENV:Header>

<SOAP-ENV:Body >

  <dis:UpdateObject xmlns:dis="http://www.sap.com/SBO/DIS">

  <BOM >

  <BO >

  <AdmInfo >

  <Object>oBusinessPartners</Object>

  </AdmInfo>

  <BusinessPartners >

  <row>

  <CardCode>411.2800</CardCode>

  <CardName>Mario Rossi TEST UPDATE</CardName>

  </row>

  </BusinessPartners>

  </BO>

  </BOM>

  </dis:UpdateObject>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

<?xml version="1.0"?>

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">

  <env:Body>

  <env:Fault>

  <env:Code>

  <env:Value>env:Receiver</env:Value>

  <env:Subcode>

  <env:Value>env:0</env:Value>

  </env:Subcode>

  </env:Code>

  <env:Reason>

  <env:Text xml:lang="en">Failed to execute command</env:Text>

  </env:Reason>

  <env:Detail>

  <Object>2</Object>

  <ObjectIndex>1</ObjectIndex>

  <Command>UpdateObject</Command>

  <SessionID>C5A03D9D-B46C-46E3-B768-D4C9FB120074</SessionID>

  </env:Detail>

  </env:Fault>

  </env:Body>

</env:Envelope>

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I am able to update Business Partners using the below XML code. Please change it as per your need:

<?xml version="1.0" encoding="UTF-8"?>

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">

<env:Header>

  <SessionID>E1433C21-1DE6-480B-90BB-8D21CB9BC3EE</SessionID>

  </env:Header>

<env:Body>

<dis:UpdateObject xmlns:dis="http://www.sap.com/SBO/DIS">

<BOM xmlns="http://www.sap.com/SBO/DIS">

<BO>

<AdmInfo>

  <Object>oBusinessPartners</Object>

  </AdmInfo>

<QueryParams>

  <CardCode>C0008</CardCode>

  </QueryParams>

<BusinessPartners>

<row>

  <CardCode>C0008</CardCode>

  <CardName>TESTBP</CardName>

  <GroupCode>100</GroupCode>

  <Phone1>961</Phone1>

  <FederalTaxID>9999999</FederalTaxID>

  <EmailAddress></EmailAddress>

  <ShipToDefault></ShipToDefault>

  <BilltoDefault></BilltoDefault>

  </row>

  </BusinessPartners>

<BPAddresses>

<row>

  <AddressName></AddressName>

  <Street>xxxxxxx</Street>

  <ZipCode></ZipCode>

  <City></City>

  <County></County>

  <Country></Country>

  <AddressType>S</AddressType>

  </row>

<row>

  <AddressName></AddressName>

  <Street></Street>

  <ZipCode></ZipCode>

  <City></City>

  <County></County>

  <Country></Country>

  <AddressType>B</AddressType>

  </row>

  </BPAddresses>

  </BO>

  </BOM>

  </dis:UpdateObject>

  </env:Body>

  </env:Envelope>


Kind regards,

ANKIT CHAUHAN

SAP Business One Global Support

jthomas3
Explorer
0 Kudos

Thanks!

It seems I've missed the <QueryParams> (I got the code from another post here in the forums, but it was missing the queryparams field)

Answers (0)