Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Web upload & COMMIT

Posted on by 1,112

Dear Sir,

I'm sending Web request into a Web Portal during Sales Invoice Posting in NAV 2016 database & receiving the Web response  in reply. 

Now I want if there is any issue found in response data then posting should be roll backed  & if there is any issue/inconsistency in Sales Invoice then request should be roll backed.

How can I achieve that ?  Kindly reply.

Thank you.

*This post is locked for comments

  • Hannes Holst Profile Picture
    Hannes Holst 5,767 on at
    RE: Web upload & COMMIT

    [quote user="subrata.bauri"]

    I just want to know is there any possibility in the system to know that the Posting may create any G/L Inconsistency error in Codeunit 80.

    [/quote]

    No, it's not possible to catch errors upfront, which might occur during posting.

  • subrata.bauri Profile Picture
    subrata.bauri 1,112 on at
    RE: Web upload & COMMIT

    Already, I have done in the current system what you said.

    I just want to know is there any possibility in the system to know that the Posting may create any G/L Inconsistency error in Codeunit 80.

  • Hannes Holst Profile Picture
    Hannes Holst 5,767 on at
    RE: Web upload & COMMIT

    Yeah, that's what I meant with "Uploading data during a posting is always a problem."

    I've came across this problem on several occasions. This is mostly a problem with webservices for payment transactions (credit card etc.).

    In this situation, I would utilize the event "OnAfterPostSalesDoc".

    Basically, do your postings in NAV and handle the errors as you like.

    When posting is done, the data is uploaded to the webservice.

    In case an error occurs in the webservice, show the error (keep the invoice posted) and give the user the oppurtinity the upload the data manually after the posting.

  • subrata.bauri Profile Picture
    subrata.bauri 1,112 on at
    RE: Web upload & COMMIT

    Yes.

  • Hannes Holst Profile Picture
    Hannes Holst 5,767 on at
    RE: Web upload & COMMIT

    Hi,

    you mean, you want to catch any possible NAV-error before uploading the data to the WebService?

  • subrata.bauri Profile Picture
    subrata.bauri 1,112 on at
    RE: Web upload & COMMIT

    Thanks for your reply.

    I have already applied all the required validations which are mandatory in WS. The all validations are written in the Codeunit 80 ("OnBeforeSalesPost") but how can I assume that posting sale invoice will have G/L consistency while creating G/L Entries in NAV.

    Suppose a Web Request has been uploaded successfully during posting a Sales Invoice but unfortunately the nav posting gets roll backed due to G/L Inconsistency error message. I want to consider this kind of error (if occurs) message in CU 80.

    Is it possible ?

  • Hannes Holst Profile Picture
    Hannes Holst 5,767 on at
    RE: Web upload & COMMIT

    Hi,

    Uploading data during a posting is always a problem.

    Not sure for NAV2016. Check if there is an event called "OnBeforeSalesPost" in Codeunit 80.

    Subscribe this event and execute your code. When your web response is negative, show an error message (this will cancel the whole posting transaction).

  • subrata.bauri Profile Picture
    subrata.bauri 1,112 on at
    RE: Web upload & COMMIT

    Dear Sir,

    When we post any Sales Invoice in NAV it will create few G/L Entries. And if there is any difference between sum of total debit & Credit Columns then the system will throw a Inconsistency error message in NAV. This inconsistency error occurs from Codeunit 12 Gen. Jnl.-Post Line.

    I just want to know is there any possibility to get/generate/calculate the same error message (if any) in Codeunit 80 Sales-Post ?

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Web upload & COMMIT

    A posting inside NAV (codeunit 80) is always consistent. The transaction is committed if all is ok, otherwise you receive an error and all is rolled back. So, what do you mean exactly with “G/L Entry consistency”?

  • subrata.bauri Profile Picture
    subrata.bauri 1,112 on at
    RE: Web upload & COMMIT

    Thanks for your instant reply.

    Is there any possibility to check G/L Entry Consistency before Committing a Sales Invoice Posting in Codeunit 80 ?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans