HELP ARTICLE

Business Central error- Key “XXX” is not well formed! – when trying to delete a record


I’m trying to delete a Customer record in Business Central/NAV using the SmartConnect SOAP CustomerCard endpoint.
When I run the integration, it fails with the error:

Failed to delete record with Keys ‘Key = XXX’ Key “XXX” is not well formed!

Why do I get this error?



The reason for the error is a mismatch for the data provided for the Key field on this integration.
In this case, using the CustomerCard SOAP endpoint, the only field required to delete the Customer record is the “Key” field.

Notice that the field is “Key” and not “No”.

The No field in Business Central/NAV is a human readable such as “PTR”.
The Key field in Business Central/NAV is a long identifier such as “16;EgAAAAJ7/1AAVABS7;31847521;22;AgedAccReceivableChart1;16;EgAAAAJ7/1AAVABS7;31847520;

In this case, the error happened because the “No” field was mapped to the “Key” field on that map.  Because the Key field wasn’t in the correct format, Business Central gave this error.

There are two solutions:

1. Using the SOAP connector, since we likely do not have the hidden Key field, we can use SmartConnect to look that up for us using a Page Field Lookup.

This lookup type will return the Key for a record if you give it the fields to look up with.  Typically this would be the No field but it could be a combination of other fields of No wasn’t available for some reason.

Once the calculation for the Page Field Lookup is created, map this new lookup to the Key field on the entity and group on this field.



2. Using the ODATA connector in SmartConnect 20.18.1.11 and greater, we can also delete records.

In this case, we wouldn’t need to use a lookup.  Instead, we just map our field(s) to tell Business Central which fields to match and delete with – No in this case since we have it – and mark the For Delete option. 



Example maps for both solutions using SmartConnect 20.18.1.11 are ATTACHED.

RECENT POSTS


RM Apply Detail SmartList Builder Template
The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement
GlobalFileName not populated when using in a script
Wrong Date in Dynamics CRM/D365 for Customer Engagement Data Source
NAV 2017 Error: Data object not provided

POPULAR POSTS


Removed Part: /xl/vbaProject.bin part. (Visual Basic for Applications (VBA))
Manufacturing Serial Trace SmartList Builder Template
The server process could not be started because the configured identity is incorrect.
How to update SmartConnect from 10.0.0.51 to SmartConnect 2014
Running a map in SmartConnect and receiving an error that says "The source was not found, but some or all event logs could not be searched."

CATEGORIES

ARCHIVES

open all | close all

TAGS

CRM Demo Dynamics Dynamics 365 dynamics crm Dynamics GP Dynamics NAV Econnect Employee Spotlight eone eOne News eOne Spotlight ERP Events Excel Excel Report Builder Extender Flexicoder GP GPUG integration integration manager Meet the Team Microsoft Microsoft dynamics crm Microsoft Dynamics GP Office Relationships partners release SalesForce SalesForce.com scripting SmartConnect SmartConnect.com SmartConnect Office Hours SmartList SmartList Builder SmartList Designer SmartView SQL Support Tech Tuesday Templates training Zendesk

Integrate & Automate without Any Code.

SmartList Data has Never Been Faster.

The Easiest Way to Report on GP Data.