Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Sell to customer name not appearing on NAV UI

(0) ShareShare
ReportReport
Posted on by

Hi ,

I am a newbie for NAV. I have one app which transfer data from different database to NAV db. I mapped the CustomerNo and SelltoCustomerName field of salesheader. It transfers the value of customer no but unable to write value to SelltoCustomerName field. I am unable to get what exactly is happening because i checked the logic in debug mode and the value is there for SelltoCustomerName which should be written in the field but i guess NAV is not allowing to write value in that field. Can anyone help me with this.

I am using simple sql insert statement to insert value to NAV db.

Thanks 

*This post is locked for comments

  • RE: Sell to customer name not appearing on NAV UI

    Thanks @AJ Ansari for your valuable suggestion.

  • Verified answer
    AJAnsari Profile Picture
    AJAnsari 5,754 on at
    RE: Sell to customer name not appearing on NAV UI

    Hi IntegrationDeveloper2017,

    Based on your previous post, the app is syncing data to NAV using SQL insert statements, and this is what is preventing NAV code from being triggered.

    If you design the Sales Header table and look at the C/AL code, you will find there are OnInsert, OnModify, OnDelete triggers for a record, and multiple triggers for each field in the table (such as OnValidate).

    When you validate the Customer No. value on the Sales Header table, it drives the validation processes/code which populates the Sell-to Customer Name and a lot of other values (default Payment Terms Code, Salesperson Code, Address, etc.) in the Sales Header record.

    As mentioned in my previous response, you can trigger these if you use ODATA or ODATAv4 to write to NAV. If you use SQL inserts, you are just placing data from one field in a table in your source database into a field in a table in the NAV database. You may even inadvertently put in something with the wrong data-type, or write into a field you're not supposed to. Unless you are a NAV expert, I advise against the route you're going and suggest trying with ODATA.

    I hope this helps. If my response has answered your question, please verify by clicking Yes next to "Did this answer your question?"

  • RE: Sell to customer name not appearing on NAV UI

    @Aj Ansari .. I am using one windows app to sync data from one database to another another (NAV). In this scenario i am inserting CustomerNo in NAV using that app.Is it because of this the native code of NAV is not getting triggered? is this the default behavior of NAV? What can i do to fix this?

  • Suggested answer
    AJAnsari Profile Picture
    AJAnsari 5,754 on at
    RE: Sell to customer name not appearing on NAV UI

    First, I would discourage you from doing inserts into a NAV DB from SQL. When you do this, SQL is unable to trigger any NAV business logic, so important things like validation triggers will not run. I suggest you write to NAV using ODATA/ODATAv4 Web Services.

    That said, the Sell-to Customer Name field's value is derived by NAV from the Customer record when the Customer No. field is validated on the Sales Header table.

    I hope this helps. If my response has answered your question, please verify by clicking Yes next to "Did this answer your question?"

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,403 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans