SBX - Search With Button

SBX - Forum Post Title

Document Approval Via Email

Microsoft Dynamics NAV Forum

SUBRATA BAURI asked a question on 11 Jun 2019 3:07 AM
My Badges

Question Status

Suggested Answer

Dear Sir,

The approval system is configured in the NAV 2016 Database with Email Notification. The Email Notification carries Document Details. And now I want to add two Action buttons one for Approve & another for Reject in Email body. So that approver can take decision & update the Navision Data from there.

If the Approver wants to reject the document he will click the Reject button or if he/she wants to approve then click the Approve button. These two buttons will serve the purpose without login the NAV System.

How to do it? Please suggest if you've any idea.

Subrata Bauri

Reply
vmanta responded on 13 Jun 2019 10:02 AM
My Badges
Suggested Answer

There's only one thing you can do in the email:  insert a hyperlink in each your 2 buttons.

Now... what happens when your user clicks the links, depends on the hyperlink schema.

A hyperlink that looks like "http://example.com" - has "http" schema  (and all Operating Systems know how to handle an HTTP schema - they pass it on to the default web browser - which in turn initiates a TCP connection to the domain specified, and makes the GET request.

A hyperlink that looks like  "mytestapp://blah/blah"  has "mytestapp" schema...  and in that case the OS looks through the list of registered schemas in that particular device, and if there is a registered handler for "mytestapp" schema, it will open that app, and pass on the remainding URL.

So knowing this, you can decide how to code this solution.

You decide what app will handle those clicks/what happens when user clicks.

a) Do you want to have a custom made app you write and install on all your users desktops -that the OS will open when your users click the link?

b) Use the default HTTP schema - that all O/S's know how to handle already (they open the web browser and navigate to that URL.

So I'd say B) is a lot more convenient... all your users already can handle http schema... no need to install any other schema handler app.

And with (B) in mind, you have to write a WEB application.

The web application will receive the request (when user clicks the link, the web browser opens and makes the "GET" request you specified in your link url.

Your web app should:

-listen on the port your specify in your URL  (or the default HTTP port 80, or HTTPS port 443)

-accept incoming connections

...so far the above is equivalent to what a web server does  (but you don't have to use a web server -- you can just write a quick bare TCP/IP app in which you parse the http request header for the url/variables...do what needs to be done, and respond)

-parse the parameters you sent it (that you include in your hyperlink) - those will be part of the URL requested

-communicate with your NAV server, to do what needs to be done...  

-respond  (could just show a simple web page /or even plain text... something like "approved".... or "rejected" to let your users know it succeeded in changing the status of the NAV document... or show an error if there was an error)

How you communicate with your NAV server from your Web app:

via Web Services (ODATA/SOAP) that you setup in NAV.

Reply
vmanta responded on 13 Jun 2019 10:02 AM
My Badges
Suggested Answer

There's only one thing you can do in the email:  insert a hyperlink in each your 2 buttons.

Now... what happens when your user clicks the links, depends on the hyperlink schema.

A hyperlink that looks like "http://example.com" - has "http" schema  (and all Operating Systems know how to handle an HTTP schema - they pass it on to the default web browser - which in turn initiates a TCP connection to the domain specified, and makes the GET request.

A hyperlink that looks like  "mytestapp://blah/blah"  has "mytestapp" schema...  and in that case the OS looks through the list of registered schemas in that particular device, and if there is a registered handler for "mytestapp" schema, it will open that app, and pass on the remainding URL.

So knowing this, you can decide how to code this solution.

You decide what app will handle those clicks/what happens when user clicks.

a) Do you want to have a custom made app you write and install on all your users desktops -that the OS will open when your users click the link?

b) Use the default HTTP schema - that all O/S's know how to handle already (they open the web browser and navigate to that URL.

So I'd say B) is a lot more convenient... all your users already can handle http schema... no need to install any other schema handler app.

And with (B) in mind, you have to write a WEB application.

The web application will receive the request (when user clicks the link, the web browser opens and makes the "GET" request you specified in your link url.

Your web app should:

-listen on the port your specify in your URL  (or the default HTTP port 80, or HTTPS port 443)

-accept incoming connections

...so far the above is equivalent to what a web server does  (but you don't have to use a web server -- you can just write a quick bare TCP/IP app in which you parse the http request header for the url/variables...do what needs to be done, and respond)

-parse the parameters you sent it (that you include in your hyperlink) - those will be part of the URL requested

-communicate with your NAV server, to do what needs to be done...  

-respond  (could just show a simple web page /or even plain text... something like "approved".... or "rejected" to let your users know it succeeded in changing the status of the NAV document... or show an error if there was an error)

How you communicate with your NAV server from your Web app:

via Web Services (ODATA/SOAP) that you setup in NAV.

Reply

SBX - Two Col Forum

SBX - Migrated JS