Skip to main content

Microsoft Dynamics 365 Add/Update Company TO iPaaS

Transfer MSD365 customer records to iPaaS.com

Updated yesterday

Overview

Customer Company records can be transferred to iPaaS.com through both manual sync and polling. This integration supports syncing of Customer Company data to iPaaS.com using the Microsoft Dynamics 365 Customer Company ID for identification.

Before You Begin

Ensure the following prerequisites are in place before configuring this integration.

Microsoft Dynamics 365 Requirements

  • Company records must exist with valid Name, Email, and Address data

  • Web Services must be enabled for Customers, Customer Card, Contact Card, and Customer Price Group

  • Customer Price Groups must be configured if category mapping is required

iPaaS.com Requirements

  • API credentials with create/update permissions for the Company API

  • Custom fields must be created for extended data mapping (B2B Company Status, E_Mail_2, FPP fields, etc.)

  • Customer Category records must exist for CustomerPriceGroup mapping

ID Format

When manually transferring a Customer Company to iPaaS.com, use the Microsoft Dynamics 365 Company No as the company identifier. This No uniquely represents each Customer Company record within Microsoft Dynamics 365.

  • Example: 44552

Mapping Collection Status

  • Status: Enabled

  • Trigger Events: Company Create, Company Update

Supported Child Collections

System Caveats

Microsoft Dynamics 365 Caveats

  • Responsibility Center Exclusions: Certain responsibility centers may be excluded from synchronization based on mapping filter configuration.

  • CustomerPriceGroup Required: If category mapping is configured, the CustomerPriceGroup must exist and be linked to an iPaaS.com Customer Category.

iPaaS.com Caveats

  • Name Matching: Unlinked companies will first try to match by name to existing iPaaS.com company records before creating a new company.

  • Custom Fields Required: Several custom fields must be created in iPaaS.com to support extended data mapping (B2B Company Status, E_Mail_2, FPP_Amount, FPP_Code, etc.).

Integration Caveats

  • Relationship Type Validation: Company relationships are only processed for records where RelationshipType is "Person". The corresponding customer must exist in iPaaS.com.

Authentication and Security

Microsoft Dynamics 365 API credentials are required for accessing the Company API. Ensure credentials are stored securely within the iPaaS.com credential manager.

Integration Flow

The integration processes Microsoft Dynamics 365 Company records as follows:

  1. Company is created or updated in Microsoft Dynamics 365.

  2. A scheduled polling event detects the change.

  3. Mapping filter validates the company (Type == "Company", excluded ResponsibilityCenters filtered out).

  4. iPaaS.com authenticates with Microsoft Dynamics 365 API.

  5. Company data fields are mapped from Microsoft Dynamics 365 to iPaaS.com format.

  6. CustomerPriceGroup is converted to iPaaS.com Category.

  7. Child collections process addresses, hierarchy, and relationships.

  8. Company record is created or updated in iPaaS.com.

  9. Transfer status and any errors are logged.

Mappings

Parent: Dynamics Company Add/Update TO iPaaS

Mapping Filter

Type == "Company" && ResponsibilityCenter != "GG06" && ResponsibilityCenter != "GG07"

Description

This filter ensures only Company type records are processed, excluding specific responsibility centers. Unlinked companies will first try to match by name to existing iPaaS.com company records before creating a new company.

Mapping Type

Source (Dynamics 365)

Destination (iPaaS.com)

Description

Field

EMail

EmailAddress

(Required) Maps the primary email address to iPaaS.com.

Field

PhoneNo

PhoneNumber

(Recommended) Maps the customer phone number.

Dynamic Formula

(CustomerPriceGroup lookup)

Categories

(Recommended) Resolves the customer price group to iPaaS.com Category. If valid Spaceport ID found, adds to Categories collection.

Field

Name

Name

(Required) Maps the company name.

Static

APPROVED

B2B Company Status (Custom Field)

(Recommended) Sets B2B Company Status to APPROVED by default.

Field

imgE_Mail_2

E_Mail_2 (Custom Field)

(Recommended) Maps secondary email address.

Field

imgE_Mail_2_Role

E_Mail_2_Role (Custom Field)

(Recommended) Maps role for secondary email contact.

Dynamic Formula

(E_Mail_2_Contact first name extraction)

E_Mail_2_Fname (Custom Field)

(Recommended) Extracts first name from secondary email contact.

Dynamic Formula

(E_Mail_2_Contact last name extraction)

E_Mail_2_Contact_lname (Custom Field)

(Recommended) Extracts last name from secondary email contact.

Field

Id

Erp_Company_Id (Custom Field)

(Recommended) Maps internal Dynamics 365 record ID.

Field

No

Company Number

(Required) Maps Company Number identifier.

Dynamic Formula

(FPP_Amount lookup)

FPP_Amount (Custom Field)

(Recommended) Retrieves FPP Amount from custom fields.

Dynamic Formula

(FPP_Code lookup)

FPP_Code (Custom Field)

(Recommended) Retrieves FPP Code from custom fields.

Child 1: Dynamics Add/Update Company Address TO iPaaS

Mapping Filter

SourceTypeName != "ParentOnly"

Mapping Type

Source (Dynamics 365)

Destination (iPaaS.com)

Description

Static

true

PreventDuplicate

Prevents duplicate addresses from being added.

Field

Address

Address1

Maps primary street address.

Field

Address2

Address2

Maps secondary street address.

Field

City

City

Maps city.

Field

County

Region

Maps county/region.

Field

CountryRegionCode

Country

Maps country code.

Field

PostCode

PostalCode

Maps postal code.

Field

PhoneNo

PhoneNumber

Maps phone number.

Child 2: Dynamics Add/Update Company TO iPaaS - Parent Only

Description

The ParentOnly support has been added to company addresses, so the Parent data can be used at the child-level using the dot property.

These mappings are provided to demonstrate proof of concept only and will need to be modified for your use case. By using the ParentOnly data source, you may create as many mapping collections as needed to represent different company addresses.

Mapping Filter

var shipToCode = Parent.ShipToCode;
if(shipToCode != null && !string.IsNullOrEmpty(shipToCode.ToString())){
if(SourceTypeName == "ParentOnly"){
return true;
}
}
return false;

Mapping Type

Source (Dynamics 365)

Destination (iPaaS.com)

Description

Dynamic Formula

Parent.ShipToCode

ShipToCode
(custom field)

(Required) Sets relationship type to Employee.

Dynamic Formula

GetValueFromCustomField(Parent.AdditionalProperties, "ShiptoAddress")

Address1

Maps primary street address.

Dynamic Formula

GetValueFromCustomField(Parent.AdditionalProperties, "ShiptoAddress2")

Address2

Maps secondary street address.

Dynamic Formula

GetValueFromCustomField(Parent.AdditionalProperties, "ShiptoCity")

City

Maps city.

Dynamic Formula

GetValueFromCustomField(Parent.AdditionalProperties, "ShiptoCountryRegionCode")

Country

Maps country/region.

Dynamic Formula

GetValueFromCustomField(Parent.AdditionalProperties, "ShiptoName")

FirstName

Maps first name.

Dynamic Formula

GetValueFromCustomField(Parent.AdditionalProperties, "ShiptoName2")

LastName

Maps last name

Dynamic Formula

GetValueFromCustomField(Parent.AdditionalProperties, "ShiptoPostCode")

PostalCode

Maps postal code.

Dynamic Formula

GetValueFromCustomField(Parent.AdditionalProperties, "ShiptoState")

Region

Maps county/region.

Child 3: Dynamics Add/Update Hierarchy TO iPaaS

Description

When a Company is created or updated in MS Dynamics 365, a corresponding parent company profile is created or updated as the relationship of the company in iPaaS.com having type “Parent”

Mapping Filter

var companyId = await GetSpaceportIdAsync(Id.Split("|")[0], "Company", SpaceportSystemId);
if(companyId != null && !string.IsNullOrWhiteSpace(companyId.ToString()))
return true;
return false;

Mapping Type

Source (Dynamics 365)

Destination (iPaaS.com)

Description

Field

ParentCustomerNo_Hierarchy

Parent Customer Number
(custom field)

(Required)Maps the Dynamics 365 Customer Number.

Static

Parent

Type

Sets the Type to Parent.

Dynamic Formula

return await GetSpaceportIdAsync(Id.Split("|")[0], "Company", SpaceportSystemId);

RelatedTold

Extracts the Company name from the Id string.

Child 4: Dynamics Add/Update Company Relationship TO iPaaS

Mapping Filter

if(RelationshipType != null && RelationshipType == "Person"){
var customerId = await GetSpaceportIdAsync(Id.Split("|")[0], "Customer", SpaceportSystemId);
if(customerId != null && !string.IsNullOrWhiteSpace(customerId.ToString()))
return true;
throw new Exception($"Customer record not found. Please create the customer manually in iPaaS using the following id of BC-365: {Id.Split("|")[0]}");
}
return false;

Description

This filter ensures the mapping is applied only for records where the relationship type is "Person". It validates that the corresponding customer exists in iPaaS.com. If the customer does not exist, an exception is thrown.

Mapping Type

Source (Dynamics 365)

Destination (iPaaS.com)

Description

Static

Employee

Type

(Required) Sets relationship type to Employee.

Dynamic Formula

return await GetSpaceportIdAsync(Id.Split("|")[0], "Customer", SpaceportSystemId);

RelatedToId

(Required) Retrieves iPaaS.com internal ID for the customer using the company relationship ID.

Error Handling

Invalid Email

Email format is incorrect.

  • Description: The email field format is invalid.

  • Resolution: Ensure the email field is valid and follows the format user@example.com.

Customer Record Not Found

Customer record not found for relationship mapping.

  • Description: When processing company relationships, the corresponding customer does not exist in iPaaS.com.

  • Resolution: Create the customer manually in iPaaS.com before processing the company relationship.

Validation and Testing

Before deploying this integration, verify the following configuration items and run the test scenarios to confirm proper operation.

Validation Rules

  • CountryRegionCode: Must be valid and not empty.

  • Email: Must be unique and properly formatted.

Validation Checklist

  1. Customer Company Number is present and unique.

  2. Email is present, valid, and unique.

  3. Custom fields exist in iPaaS.com for extended data mapping.

  4. Customer records exist for relationship mappings.

Test Scenarios

Scenario 1: Valid Company Record

Sync a company from Microsoft Dynamics 365. The company should be successfully transferred to iPaaS.com.

Scenario 2: Missing Email (Failure Case)

Attempt to sync a company without an email address. Sync should fail with an error logged.

Scenario 3: Company Relationship with Existing Customer

Sync a company with the Person relationship type where the customer exists in iPaaS.com. The relationship should be created successfully.

Additional Notes

  • Unlinked companies will first try to match by name to existing iPaaS.com company records before creating a new company.

  • Custom fields must be created in iPaaS.com before syncing extended data.

  • Company relationships require the related customer to exist in iPaaS.com first.

  • Polling detects changes automatically; manual sync is also available.

Did this answer your question?