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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Error Type must be equal to 'Person' in Contact: No.=K99999. Current value is 'Company'.

(0) ShareShare
ReportReport
Posted on by 15

Hello Guys,

I have a standalone .NET application that needs to create records in Contact table via Navision Contact Web service. The web service URL looks like below:
http://navisionservername:portno/DynamicsNAV/WS/myorg/Page/Contact

My code creates two contact records, first is of Type=Company and second is of Type=Person.

First record of Contact gets created successfully in NAV and Contact No gets displayed correctly. But person contact gets failed with below error message.

"Error: Type must be equal to 'Person'  in Contact: No.=K9999. Current value is 'Company'."

I am not a Navision developer so please pardon me if I use incorrect terminology. I have inserted the code snippet here.

In case I have posted my question in wrong category, so please help me post in correct forum.

Can anyone give some pointers to fix the error.

Thanks in advance.

Contact.Contact objCompany = new Contact.Contact();
            objCompany.Name = "Company Test 2017-1";
            objCompany.Type = Contact.Type.Company;
            objCompany.VAT_Registration_No = "5852036";
            objCompany.E_Mail = "test2017@test.com";
            svcContact.Create(ref objCompany);

            Contact.Contact objContact = new Contact.Contact();
            objContact.Name = "Contact for Company";
            objContact.Type = Contact.Type.Person;            
            objContact.E_Mail = "test2017@test.com";
            objContact.Company_No = objCompany.No;
            svcContact.Create(ref objContact);


*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Try setting value for ObjContact.Type = 1 instead of using Contact.Type.Person.

  • Ajay Chawla Profile Picture
    15 on at

    Hi Suresh,

    As per the suggestion, I tried with below code but no luck. It generates the same error.

    objContact.Type = (Contact.Type) 1;

    Could there be any Organization specific setting for Type field in Navision that I may have to check.

    Thanks

    Ajay Chawla

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Try to create the person contact first without assigning Company No. and then update the contact with Company No.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans