Wiki

Scale Your Enterprise

User Tools

Site Tools


bw2:adding_and_updating_business_partner_contacts

Adding and Updating Business Partner Contacts

Following is an example for adding a new Business Partner contact. In this example, the new address's information is held in a SQL table named “SBO_Contact_Info,” which is in a database named “VersagoData.”

SELECT
t0.CardCode, t0.Name, t0.Position, t0.tel1, t0.e_maill, t0.CardCode + t0.Name AS [RecordBreak]
FROM bizweaver..OCPR t0
WHERE t0.CardCode = 'C99001'
UNION ALL
SELECT
t0.CardCode, t0.Name, t0.Position, t0.tel1, t0.email, t0.CardCode + t0.Name
FROM VersagoData..sbo_contact_info t0
WHERE t0.CardCode = 'C99001'

The first part of the query returns the existing contact rows for Business Partner code C99001. After the UNION ALL statement, the second part of the query returns the row of the contract to be added.

This is another example where the rows also use “Change on value …” for the “Create a new record on” option. The value created by “RecordBreak” ensures that records are processed for each combination of address name + address type.

The image below shows the mapping for this process.

In this case, it is not necessary to map CardCode for the rows since it is mapped at the header (Business Partners) level.

bw2/adding_and_updating_business_partner_contacts.txt · Last modified: 2021/02/05 11:21 by akoehler