Overview
The Epicor Prophet 21 integration provides a set of ready-made functions you can call when building mappings. They handle common lookups and conversions for Prophet 21, such as resolving a Prophet 21 item, ship-to, address, contact, or customer ID, validating a customer, mapping a carrier to an iPaaS.com shipping method, and reading a value from a record's custom fields, so you don't have to write that logic yourself.
Where you can use these functions
These functions are available anywhere you write a formula for the Epicor Prophet 21 integration:
Dynamic Formula mappings: where a destination field's value is produced by a formula rather than mapped directly from a source field.
Mapping collection filters: where a formula decides whether a record should be processed.
Error filters: a mapping collection's error filter, which sits alongside its collection filter. When the error filter's formula resolves to true, the transfer raises an error that is held in the Error Logs for review and is not retried automatically.
Translation collections: where a translation entry uses a formula as its source value.
How to use them
Call a function by name and pass the values it needs in parentheses, for example:
await GetItemIdBySku(Sku).Each function's signature shows its name, the parameters it accepts (with their types), and the type of value it returns. Use it as the reference for exactly how to call the function.
Function names and formula syntax are case-sensitive, so type each name exactly as shown. Whether the values a function matches are treated as case-sensitive varies by function, and is called out in the relevant parameter's description.
Some of these functions are asynchronous (their signature returns a
Task) and must be called withawait; the rest are synchronous and are called directly. Each function's How to call it example shows the correct form.Each function runs at sync time, against the data in your connected Epicor Prophet 21 account and your iPaaS.com subscription.
The functions are grouped below by the area of the integration they support.
Customers and Contacts
Use these to resolve Prophet 21 customer, contact, ship-to, and address IDs, and to validate a customer.
GetShipToIdByCustomerId
What it does: Returns the Prophet 21 ship-to ID for a given Prophet 21 customer ID. Returns nothing if no ship-to ID exists.
Signature: Task<string> GetShipToIdByCustomerId(string customerId)
How to call it: await GetShipToIdByCustomerId(customerId)
Parameter | Type | Required | Default | Description |
customerId |
| Yes | N/A | The Prophet 21 customer ID whose ship-to ID you need. |
Returns: string. The Prophet 21 ship-to ID, or nothing if none exists.
Example: await GetShipToIdByCustomerId("155509") returns the ship-to ID for that customer.
When to use it: When mapping a transaction to Prophet 21 and you need the customer's ship-to ID.
GetAddressIdByContactId
What it does: Returns the Prophet 21 address ID linked to a given Prophet 21 contact ID. Returns nothing if no address is found.
Signature: Task<string> GetAddressIdByContactId(string contactId)
How to call it: await GetAddressIdByContactId(contactId)
Parameter | Type | Required | Default | Description |
contactId |
| Yes | N/A | The Prophet 21 contact identifier whose address ID you need. |
Returns: string. The Prophet 21 address ID, or nothing if no address is found.
Example: await GetAddressIdByContactId("C12345") returns the address ID for that contact.
When to use it: When mapping addresses to Prophet 21 and you need the address ID for a contact.
GetCustomerIdByAddressId
What it does: Returns the Prophet 21 customer ID linked to a given Prophet 21 address ID. Returns nothing if no customer is found.
Signature: Task<string> GetCustomerIdByAddressId(string addressId)
How to call it: await GetCustomerIdByAddressId(addressId)
Parameter | Type | Required | Default | Description |
addressId |
| Yes | N/A | The Prophet 21 address identifier whose customer ID you need. |
Returns: string. The Prophet 21 customer ID, or nothing if no customer is found.
Example: await GetCustomerIdByAddressId("A78901") returns the customer ID linked to that address.
When to use it: When mapping customer data to Prophet 21 and you have an address ID but need the customer ID.
ValidateCustomerId
What it does: Checks whether a customer ID exists in Prophet 21 and returns it if so. Returns nothing if the customer does not exist.
Signature: Task<string> ValidateCustomerId(string customerId)
How to call it: await ValidateCustomerId(customerId)
Parameter | Type | Required | Default | Description |
customerId |
| Yes | N/A | The Prophet 21 customer ID to validate. |
Returns: string. The customer ID if it exists in Prophet 21, or nothing if it does not.
Example: await ValidateCustomerId("155509") returns "155509" when that customer exists in Prophet 21.
When to use it: In a mapping filter, to confirm a customer exists in Prophet 21 before transferring a transaction.
GetContactIdByCustomerId
What it does: Returns the Prophet 21 contact ID for a given iPaaS.com customer ID. Returns nothing if no contact is found.
Signature: Task<string> GetContactIdByCustomerId(string customerId)
How to call it: await GetContactIdByCustomerId(customerId)
Parameter | Type | Required | Default | Description |
customerId |
| Yes | N/A | The iPaaS.com customer ID used to find the Prophet 21 contact. |
Returns: string. The Prophet 21 contact ID, or nothing if no contact is found.
Example: await GetContactIdByCustomerId("12844") returns the Prophet 21 contact ID for that customer.
When to use it: When mapping a transaction to Prophet 21 and you need the contact ID for a customer.
Products
Use this to resolve a Prophet 21 item ID from a SKU.
GetItemIdBySku
What it does: Looks up a Prophet 21 product by SKU and returns its Prophet 21 item ID (inventory master ID). Raises an error if the product does not exist in Prophet 21.
Signature: Task<string> GetItemIdBySku(string Sku)
How to call it: await GetItemIdBySku(Sku)
Parameter | Type | Required | Default | Description |
Sku |
| Yes | N/A | The iPaaS.com product SKU, which is the Prophet 21 item ID, used to look up the product. |
Returns: string. The Prophet 21 item ID (inventory master ID).
Example: await GetItemIdBySku("RTZPVCWS12") returns the Prophet 21 item ID, for example "1113".
When to use it: When mapping a transaction line to Prophet 21 and you need the item ID for a SKU.
Shipping
Use this to map a Prophet 21 carrier to an iPaaS.com shipping method.
ShippingMethodIdFromName
What it does: Looks up the iPaaS.com shipping method that corresponds to a Prophet 21 carrier ID and returns the iPaaS.com shipping method ID. Returns nothing if the carrier ID is not a number or no matching shipping method exists.
Signature: Task<string> ShippingMethodIdFromName(object CarrierId)
How to call it: await ShippingMethodIdFromName(CarrierId)
Parameter | Type | Required | Default | Description |
CarrierId |
| Yes | N/A | The Prophet 21 carrier ID used to find the matching iPaaS.com shipping method. |
Returns: string. The iPaaS.com shipping method ID, or nothing if no matching shipping method exists.
Example: await ShippingMethodIdFromName("10000") returns the iPaaS.com shipping method ID for that carrier.
When to use it: In a tracking-number mapping filter, to map a Prophet 21 carrier to its iPaaS.com shipping method.
Custom Fields
Use this to read a value from a Prophet 21 record's custom fields.
GetValueFromCustomField
What it does: Reads the value of a named custom field from a Prophet 21 custom field object. The value keeps its original type (text, number, and so on). Returns nothing if the field is not present or has no value.
Signature: object GetValueFromCustomField(object customFieldObj, object textFieldName)
How to call it: GetValueFromCustomField(customFieldObj, textFieldName)
Parameter | Type | Required | Default | Description |
customFieldObj |
| Yes | N/A | The Prophet 21 custom field object (for example a record's additional properties) to read from. |
textFieldName |
| Yes | N/A | The name of the Prophet 21 custom field to retrieve. |
Returns: object. The custom field's value in its original type, or nothing if the field is not present or has no value.
Example: For a custom field object with customerNotes set to "Please, contact sales", GetValueFromCustomField(customFieldObj, "customerNotes") returns "Please, contact sales".
When to use it: When mapping a value out of a Prophet 21 record's custom fields.
