web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Create a Contact linked to Customer from API

(2) ShareShare
ReportReport
Posted on by 2
Hello,
 
I try to create a Contact (with type Person) record which is related to Customer record.

Tried several ways, but none seem to work (I was able to create Customers and unlinked Contacts). As I understood you do not link that Contact directly to Customer but to another Contact (with Type Company) which is automatically created when Customer is created.

I tried to create a new Contact (with type Person) with a link to Contact that automatically created Contact (with Type Company). I used this body:
 

{

  "displayName": "Test Contact",

  "phoneNumber": "555577777",

  "email": "test@test.com",

  "type": "Person",

  "companyNumber": "CU17414"

}

 


This request gives me such error: You cannot change Company No. because one or more unlogged segments are assigned to the contact.

Any ideas what this error means or how to properly link my new Contact?
I have the same question (0)
  • Suggested answer
    OussamaSabbouh Profile Picture
    3,461 on at
    Create a Contact linked to Customer from API
    Hello,
     
    You're using the Customer No. in companyNumber, but the API expects the Company Contact No. (the contact automatically created for the customer).
     
    Fetch it from:
    GET /customers({id})/contactsInformation → use contactNumber from the response → send that in companyNumber.
     
    Regards,
    Oussama Sabbouh

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,343

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,556 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 2,098 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans