Skip to main content
Microsoft Dynamics NAV forum
Suggested answer

Web upload & COMMIT

editSubscribe (0) ShareShare
ReportReport
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.

  • Hannes Holst Profile Picture
    Hannes Holst 5,763 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,763 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,763 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,763 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,152 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 ?

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,030 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,562 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans