Developer forum

Forum » Integration » Missing addresses from BC

Missing addresses from BC

Michael Knudsen
Reply

Hello forum,

- I'm using the request below to get customers + addresses from BC and have the result integrated into Users (using key "AccessUserAddressUID" in the integration job), but even the customer have 2 delivery addresses for the 3 contact persons, it's only the first (random?) contact person, which will have the 2 delivery addresses beside standard company + contact address. The 2 other contacts will only have standard company + contact address.

Request:
<GetEcomData><tables><Customers type="all" importSalesPeople="false" /></tables></GetEcomData>

Return:
<tables version="1.2.0.20_NAV19.0.36528.39541">

Looking closer to the data it returns, it seems that "AccessUserAddressUID" under certain conditions doesn't return a unique id (UID), because it repeats the "AccessUserAddressCustomerNumber" eg. 8248_8248-1 instead it should have returned: 945_8248-1 or 8248_945-1   
    <item table="AccessUserAddress">
      <column columnName="AccessUserAddressUserID"><![CDATA[945]]></column>
      <column columnName="AccessUserAddressCustomerNumber"><![CDATA[8248]]></column>
      <column columnName="AccessUserAddressUID"><![CDATA[945_ContactAddress]]></column>
      <column columnName="AccessUserAddressCallName"><![CDATA[Contact Address]]></column>

      ...

    </item>
    <item table="AccessUserAddress">
      <column columnName="AccessUserAddressUserID"><![CDATA[945]]></column>
      <column columnName="AccessUserAddressCustomerNumber"><![CDATA[8248]]></column>
      <column columnName="AccessUserAddressUID"><![CDATA[8248_8248-1]]></column>
      <column columnName="AccessUserAddressCallName"><![CDATA[BFT LOGISTIK - VEST]]></column>
      ...

    </item>
    <item table="AccessUserAddress">
      <column columnName="AccessUserAddressUserID"><![CDATA[945]]></column>
      <column columnName="AccessUserAddressCustomerNumber"><![CDATA[8248]]></column>
      <column columnName="AccessUserAddressUID"><![CDATA[8248_8248-2]]></column>
      <column columnName="AccessUserAddressCallName"><![CDATA[BFT LOGISTIK - ØST]]></column>
      ...
    </item>

    <item table="AccessUserAddress">
      <column columnName="AccessUserAddressUserID"><![CDATA[1040]]></column>
      <column columnName="AccessUserAddressCustomerNumber"><![CDATA[8248]]></column>
      <column columnName="AccessUserAddressUID"><![CDATA[1040_ContactAddress]]></column>
      <column columnName="AccessUserAddressCallName"><![CDATA[Contact Address]]></column>

      ...
    </item>
    <item table="AccessUserAddress">
      <column columnName="AccessUserAddressUserID"><![CDATA[1040]]></column>
      <column columnName="AccessUserAddressCustomerNumber"><![CDATA[8248]]></column>
      <column columnName="AccessUserAddressUID"><![CDATA[8248_8248-1]]></column>
      <column columnName="AccessUserAddressCallName"><![CDATA[BFT LOGISTIK - VEST]]></column>
      ...
    </item>
    <item table="AccessUserAddress">
      <column columnName="AccessUserAddressUserID"><![CDATA[1040]]></column>
      <column columnName="AccessUserAddressCustomerNumber"><![CDATA[8248]]></column>
      <column columnName="AccessUserAddressUID"><![CDATA[8248_8248-2]]></column>
      <column columnName="AccessUserAddressCallName"><![CDATA[BFT LOGISTIK - ØST]]></column>
      ...
    </item>

 

Is there an error in the "AccessUserAddressUID" field? 

 

Br. Michael Knudsen

 

 


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Michael,
not it is not looking like an error. The same AccessUserAddressUID value which set to a combination  of "Customer."No." + '_' + address.Code" which means that the same address
is assigned to different users. So you can include the AccessUserAddressUserId into the job mapping Key Columns list, this column
will hold the value of the different Contact's Numbers so having both columns selected as key columns will produce the unique PK combination.
Can you try with that and see if it will work?
BR, Dmitrij

 
Michael Knudsen
Reply

Hello Dmitriy,

- and thanks for your quick respons regarding the "AccessUserAddressUID" field. Even you don't think it's an error, I still think something is wrong in the combination of the field.

In the data below the UID is 8248_8248-2 which also is the same UID for all customer contacts from the same customer (8248), and thereby is it misleading to call the field a unique identifier (UID).

  <item table="AccessUserAddress">
      <column columnName="AccessUserAddressUserID"><![CDATA[945]]></column>
      <column columnName="AccessUserAddressCustomerNumber"><![CDATA[8248]]></column>
      <column columnName="AccessUserAddressUID"><![CDATA[8248_8248-2]]></column>
      <column columnName="AccessUserAddressCallName"><![CDATA[BFT LOGISTIK - ØST]]></column>
      ...
  </item>

---

I can of course create a unique PK combination by adding AccessUserAddressUserID to AccessUserAddressUID, but I see this as a workaround. I prefer to have a true unique identifier, if the field should have the name AccessUserAddressUID otherwise it should be called AccessUserAddressID.

Br. Michael Knudsen

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply
This post has been marked as an answer

Ok, I can fix this so it will generate the value in the format like that (without underscores "_") since the total length of AccessUserAddressUID is 50
so it will contain the value of: Contact."No." + Customer."No." + address.Code (20+20+10=50)
And it can be released soon in the next codeunit version.
Let me know if smth is not right in that decision :)
BR, Dmitrij

Votes for this answer: 1
 
Michael Knudsen
Reply

Thanks Dmitriy, sounds awesome to me... I'll keep an eye on the upcoming releases of the codeunits.

Br. Michael Knudsen

 

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Michael,
the issue is now fixed and released in the last BC Dynamicweb Plugin Unit 1.2.0.22 version
BR, Dmitrij

 

You must be logged in to post in the forum