Developer forum

Forum » Integration » Wrong format of Ship-to address

Wrong format of Ship-to address

Michael Knudsen
Reply

Hello forum,

- we are getting users/customers from BC using the Dynamicweb integration tool using the request below:
<GetEcomData><tables><Customers type="all" importSalesPeople="false" /></tables></GetEcomData>

When we compare the returning XML for Company address or Contact address to the company 'Ship-to address' we see some numbers instead of the expected 'Ship-to address' in the tags "AccessUserAddressCallName" and "AccessUserAddressName".

Contact address:
    <item table="AccessUserAddress">
      <column columnName="AccessUserAddressUserID"><![CDATA[539]]></column>
      <column columnName="AccessUserAddressType"><![CDATA[1]]></column>
      <column columnName="AccessUserAddressCallName"><![CDATA[Contact Address]]></column>
      <column columnName="AccessUserAddressCompany"><![CDATA[MyCompany XyZ]]></column>
      <column columnName="AccessUserAddressName"><![CDATA[Contact Address]]></column>
      <column columnName="AccessUserAddressAddress"><![CDATA[STOBBEWEG 19]]></column>
      ...
    </item>
 
Ship-to address:
    <item table="AccessUserAddress">
      <column columnName="AccessUserAddressUserID"><![CDATA[539]]></column>
      <column columnName="AccessUserAddressType"><![CDATA[1]]></column>
      <column columnName="AccessUserAddressCallName"><![CDATA[8002-1]]></column>
      <column columnName="AccessUserAddressCompany"><![CDATA[MyCompany XyZ]]></column>
      <column columnName="AccessUserAddressName"><![CDATA[8002-1]]></column>
      ...
    </item>

Is this a issue in the Dynamicweb codeunits or should we ask the BC developer to do some corrections?

Br. Michael Knudsen


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Michael,

this is how it works for the Ship-To Addresses xml generation: the fields get the values from the BC Ship to address Name.
Here is the code we have:

    local procedure FillAddress(var itemNode: XmlNodevar Address: Record "Ship-to Address")
    begin
        XmlHelper.AddField(itemNode, 'AccessUserAddressType''1');
        XmlHelper.AddField(itemNode, 'AccessUserAddressCallName', Address.Name);
        XmlHelper.AddField(itemNode, 'AccessUserAddressName', Address.Name);
 

So you can rename your 8002 address name to any other name you want in BC and this will be returned in the output xml.
If you want any other special behavior you can implement your own TableScript in .NET language and use it in the Data Integration job
that is importing this xml.
Another way is to use the BC extensibility point DynamicwebUsersPublisher.OnAddAddressXmlNode and then change the generated AccessUserAddressCallName and AccessUserAddressName tags with your own custom values.

BR, Dmitrij

 
Michael Knudsen
Reply

Hello Dmitrij,

- I just wonder how would the procedure 'FillAddress' look for "Contact Address" ?  

Currently the standard response would produce the following 3 addresses: 8002-1 (is the Ship-to address), Company address and Contact Address.

Br. Michael Knudsen

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Michael,
it is hadrdcoded to the "Contact Address" since there is no other name for this kind of an address from BC.
BR, Dmitrij

 
Michael Knudsen
Reply

Hello Dmitriy,

- can our codeunit version 1.2.0.9 be the reason to this failure of the 'name/title' of the ship-to address?

If I read your code (FillAddress) it should return 'Address.Name' but in our example it seems to return 'Address.Code' on ship-to addresses.

 

Br. Michael Knudsen

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Michael,
yes, this was changed after 1.2.0.9 so try to update to the more latest version that are availble here. Then you should get address Name instead of Code.
BR, Dmitrij

 
Michael Knudsen
Reply

Thanks Dmitrij, we will try with a upgrade to BC17 1.2.012.

Br. Michael Knudsen

 
Michael Knudsen
Reply

Hello Dmitrij,

- seems it's a BC18 and now upgraded to 1.2.0.14 so now we receive the 'ship-to' (not named 'Ship-to address'), but ok, it works.

P.S. we don't use address line 3, but the response XML could use an alignment of tag names eg. should be "AccessUserAddressAddress3" but it's "AccessUserAddress3". Further more is neither "AccessUserAddressAddress3" or "AccessUserAddress3" present in the AccessUserAddress table.

<column columnName="AccessUserAddressAddress"><![CDATA[]]></column>
<column columnName="AccessUserAddressAddress2"><![CDATA[]]></column>
<column columnName="AccessUserAddress3"><![CDATA[]]></column>
 
Br. Michael Knudsen
 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Michael,
I've looked into the source code in both ours extensions: Plugin Unit extension and Plugin unit example extension and did not found any code that is adding the "AccessUserAddress3" column.
So it looks like you have some other extension installed that is adding this line.
BR, Dmitrij

 

You must be logged in to post in the forum