iVend Integration Monitor with a CardCode character length error when syncing from iVend to SAP Business One (SAP B1),

iVend Integration Monitor with a CardCode character length error when syncing from iVend to SAP Business One (SAP B1),

Overview


This article explains why transactions get stuck in the iVend Integration Monitor with a CardCode character length error when syncing from iVend to SAP Business One (SAP B1), and provides the step-by-step resolution.

Error Message

When the transaction fails in the Integration Monitor, the following error is displayed:


System.Runtime.InteropServices.COMException (0xFFFFFFFF):
CServiceData::SetPropertyValueString failed;
Value too long in property 'CardCode' of 'Document'
at SAPbobsCOM.IDocuments.set_CardCode(String pVal)

Problem Statement

Transactions — particularly special orders created via a third-party portal and integrated into iVend — fail to push from iVend to SAP B1. The affected transaction remains stuck in the iVend Integration Monitor with the above error.
Symptoms:
Transaction is visible in iVend HO but fails to appear in SAP B1
Integration Monitor shows the transaction in an error/stuck state
Error references CardCode property and Value too long
The issue typically affects customers created through third-party portals or external systems where Customer ID length is not validated against SAP B1 limits

Root Cause

SAP B1 enforces a maximum length of 15 characters for the CardCode field (Business Partner / Customer ID). When a customer is created in iVend — either manually or via a third-party portal integration — with a Customer ID longer than 15 characters, the iVend-to-SAP B1 integration fails at the point of setting the CardCode value on the document.
The mismatch between iVend's customer ID (no hard limit enforced) and SAP B1's CardCode field limit (15 characters) is the root cause of the integration failure.
Example of a failing Customer ID:


ENC2349050831524 ← 16 characters (exceeds SAP B1 limit of 15)


Resolution Steps

Follow these steps to resolve the stuck transaction:

Step 1 — Identify the Affected Customer ID
Open the iVend Integration Monitor and locate the stuck transaction. Note the Customer ID (CardCode value) causing the failure.
Step 2 — Update the Customer ID in the iVend Backend
Using a backend SQL update on the iVend HO database, shorten the Customer ID to a maximum of 15 characters:


sql

-- Verify the customer ID first
SELECT Id, FirstName, * FROM CusCustomer
WHERE Id = '<affected_customer_id>'

-- Update to shortened ID (max 15 characters)

--UPDATE CusCustomer
--SET Id = '<shortened_id_max_15_chars>'
--WHERE Id = '<affected_customer_id>'
⚠️ Important: Ensure the shortened ID is unique and does not conflict with any existing customer code. Also update any related tables that reference this CustomerCode.

Step 3 — Generate an "Update Customer" Event from HO MC
Open iVend Management Console (HO)
Navigate to Customers → locate the affected customer
Make a minor edit (e.g., add/remove a space in a field) to trigger the update event
Save the record — this generates an Update Customer replication/integration event that pushes the corrected Customer ID to SAP B1
Step 4 — Retry the Stuck Transaction
Open the iVend Integration Monitor
Locate the stuck transaction(s) with the CardCode error
Select the transaction(s) and click Retry
Verify the transaction successfully integrates into SAP B1
Step 5 — Verify in SAP B1
Confirm the transaction (Sales Order, Invoice, or Special Order) has been created in SAP B1 against the correct Business Partner (CardCode).

Preventive Measures
To prevent this issue from recurring:
1. Enforce 15-Character Limit at Customer Creation
Ensure all customer IDs created in iVend — whether manually, via third-party portals, or via data imports — are limited to a maximum of 15 characters to match the SAP B1 CardCode field constraint.
2. Validate Third-Party Portal Integrations
If customers are created via a third-party portal (e.g., e-commerce, loyalty, or ordering portal), configure the portal's customer ID generation logic to enforce the 15-character maximum before the record is pushed to iVend.
3. Do Not Increase SAP B1 CardCode Limit
The SAP B1 CardCode field length of 15 characters is a system-level constraint. While iVend can be configured to allow up to 20 characters, increasing the limit only in iVend without a matching increase in SAP B1 will cause integration failures. Both systems must be aligned — and since SAP B1's limit cannot typically be changed, the iVend side must be constrained to 15 characters.
4. Regular Integration Monitor Checks
Monitor the iVend Integration Monitor daily for stuck transactions. Early detection of CardCode errors allows faster resolution before the transaction backlog grows.

Notes generated from 25354