Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all 10032 articles
Browse latest View live

Error calling external webservice in nav 2018

$
0
0
Hi all,

I am calling an external webservice from NAV with dotnet. I am using the same code in dynamics nav 2016 as in dynamics nav 2018, while in 2016 it's working nicely in 2018 it's giving me the following error:

A connection attempt failed because the connected party did not properly respond after a period of time, or established
connection failed because connected host has failed to respond

This error happens in the following line:

RequestStr := HttpWebRequest.GetRequestStream;


Apparently, it seems it's somtehing realted to dynamics nav 2018 but I can't find what it is, I will be very gratefull if someone could help me with any idea or tip to solve it.


The code:

Name DataType Subtype Length
HttpWebRequest DotNet System.Net.HttpWebRequest.'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
HttpWebResponse DotNet System.Net.WebResponse.'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
HttpStatusCode DotNet System.Net.HttpStatusCode.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
HttpWebException DotNet System.Net.WebException.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
NavWebRequest DotNet NAVWebRequest.NAVWebRequest.'NAVWebRequest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f53f0925d26e1382'
ServicePointManager DotNet System.Net.ServicePointManager.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
SecurityProtocol DotNet System.Net.SecurityProtocolType.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'


WSmngt.SendRequestToApi(UrlLogin,'POST','application/x-www-form-urlencoded','application/json',TRUE,'gestor','SGS',
'Cache-Control','no-cache','username=&password=&grant_type=password');
AuthToken := GetResponseValue('access_token');

SendRequestToApi(Url : Text;Method : Text;ContentType : Text;ReturnType : Text;DisableUI : Boolean;HeaderKey1 : Text;HeaderValue1 : Text;HeaderKey2 : Text;HeaderValue2 : Text;BodyText : Text)
//inicializa la conexión y envía la petición
InitConnection(HttpWebRequest,Url,Method,ContentType,ReturnType,DisableUI);
IF HeaderKey1 <> '' THEN
AddHeader(HttpWebRequest,HeaderKey1,HeaderValue1);
IF HeaderKey2 <> '' THEN
AddHeader(HttpWebRequest,HeaderKey2,HeaderValue2);
AddBody(HttpWebRequest,BodyText);
DoWebRequest(HttpWebRequest,HttpWebResponse,'');

InitConnection(VAR HttpWebRequest : DotNet "System.Net.HttpWebRequest";PostUrl : Text;Method : Text;ContentType : Text;ReturnType : Text;DisableUI : Boolean)
Uri := Uri.Uri(PostUrl);
HttpWebRequest := HttpWebRequest.Create(Uri);
IF DisableUI THEN
HttpWebRequestMgt.DisableUI;
HttpWebRequest.KeepAlive := FALSE;
HttpWebRequest.AllowAutoRedirect := TRUE;
HttpWebRequest.UseDefaultCredentials := TRUE;
HttpWebRequest.Timeout := 300000;
HttpWebRequest.Method := Method;
HttpWebRequest.ContentType := ContentType;
HttpWebRequest.Accept := ReturnType;

AddHeader(VAR HttpWebRequest : DotNet "System.Net.HttpWebRequest";key : Text;value : Text)
HttpWebRequest.Headers.Add(key,value);

AddBody(VAR HttpWebRequest : DotNet "System.Net.HttpWebRequest";XmlBodyText : Text)
RequestStr := HttpWebRequest.GetRequestStream;
StreamWriter := StreamWriter.StreamWriter(RequestStr,Encoding.UTF8);
StreamWriter.Write(XmlBodyText);
StreamWriter.Flush;
StreamWriter.Close;
StreamWriter.Dispose;

DoWebRequest(VAR HttpWebRequest : DotNet "System.Net.HttpWebRequest";VAR HttpWebResponse : DotNet "System.Net.WebResponse";IgnoreCode : Code[10])
ServicePointManager.SecurityProtocol(SecurityProtocol.Tls);
NAVWebRequest := NAVWebRequest.NAVWebRequest;
IF NOT NAVWebRequest.doRequest(HttpWebRequest,HttpWebException,HttpWebResponse) THEN
IF (IgnoreCode = '') OR (STRPOS(HttpWebException.Message,IgnoreCode) = 0) THEN
ERROR(HttpWebRequestError,HttpWebException.Status.ToString,HttpWebException.Message);

Compiling RDL Layout with Visual Studio Code

$
0
0
Hello,

mayhap I'm overlooking the obvious, but then so are all of my colleagues. I've developed an new report for a customer in Visual Studio Code with an rdl layout. In the old development enviroment you could compile the report (what is now the AL part) and it would also compile you the layout an tell you if (for example) a hidden expression didn't work. With Business Central (especially if it is Clous-based) the only way I have found to do this is to actually upload the Extension into a sandbox and try to print the report. Or rather, use "Send E-Mail" as only then I am acutally given the error message as before and not just "Report could not be printed due to Layout-Error".

Does anyone know a better way to find out if something is wrong in your layout?

Ciao,
Lils

Get Records from SubPage based on a Temporary Table

$
0
0
Hi,

I have created a Wizard page, in Dynamics NAV 2017.
The Wizard has a few steps, and one of them shows a SubPage where the Source Table is Temporary.

The user will fill in multiple Lines in this SubPage, and at the end of the Wizard we do some validation checks, then insert these records into the real table.
I am struggling with how to retrieve these Temp records stored in the subpage.

Is there a way to do this?

I have tried the following, and it only returns the last record the user enters, the previous records are not found.
On the Temp SubPage, I have added a function called "GetTempRecords(VAR "TempTable")" (I am replacing the real table names here for the example).

This function essentially does the following:
IF Rec.FINDSET THEN 
  REPEAT
    TempTable := Rec;
    TempTable.INSERT;
  UNTIL Rec.NEXT = 0;

I am then calling this from the Wizard Page, with the following line of code...
CurrPage.TempSubPage.PAGE.GetTempRecords(TempTable);

I used the VAR parameter, in the hope it would return all the records the user has entered.
When I debug, the line "Rec.FINDSET" only finds the last record entered, and I have tried adding "RESET" before but this didn't help.

Is there a better way to do this?


Rounding issues on purchases

$
0
0
Hi,

I have a purchase invoice where the Total Amount should be 81,50 euro. However, it shows 81,51 euro.
Local currency is Euro.

nbskenfamdwk.png

The General Ledger Setup is:

Inv. Rounding Precision (LCY): 0.01
Amount Rounding Precision: 0.01
VAT Rounding Type: Nearest

Is there anywhere where you can setup rounding on VAT?

Payment Reconciliation Journal

$
0
0
Hi,

I have a vendor record in the Payment Reconciliation Journal, where I get the following error, when trying to manually apply an invoice to it.
nd3rfoe7eids.png

The vendor ledger entry has a value in both Creditor No. and Recipient Bank Account, which is inherit from the vendor.
fc2domjpw6hz.png

I am not sure, why the system won't allow these two fields to have a value, when it is possible to set it up on the vendor without any error?

The error message is applicable to both fields on the vendor ledger entry.
ie4a3glz2j4i.png

Purchase Order Deleted, Can we get the Approval Request Entries?

$
0
0
Hi, Within the current setup we have the creation of a Purchase Invoice from order, delete the PO and archive it. It also appears this clears the Approval Request Entries for this PO, is it possible to retain this in any way or retrieve it from elsewhere?

Thank you,
Michael.

xmlport.skip problem that exits port when there is more lines to read?

$
0
0
Hello colleagues. When using xmlport.import function I get problem where I use this code to skip first line which works great on all other files, but I find one file which is in structure 100% same as all other files, but it won't import.

When running debugger xmlport.skip function returns from XMLPORT window to my main codeunit and then goes
back in for next data item in XMLPORT, but not with this file it returns from XMLPORT and does not go back in it(all files are identical and there is more data after first line). All my important lines after first line is somehow ignored. And my import is in try function which should capture any error, but none is captured. If I put my statement like this IF xmlport.import THEN do smth. It still says xmlport.import was true and it was successful when in reality it executed first line and then exited my streamed file for good.

I'm doing a lot of imports 100 plus files and trying to keep track of what's imported and not, but with this file I have doubts about XMLPORT importing trustworthiness. Anyone have any ideas what is happening and why? It works great with other files as far as I have seen, but one file just gets ignored after first line. How could I capture this error?
IF Lines = 0 THEN BEGIN
   Lines+=1;
   currXMLport.SKIP;
END;

Session Time out in Dynamics 365 OnCloud Version

$
0
0
Hi All
can you help me how to change default session timeout settings from BC On-cloud Version ?
Thanks

NAV 2018 WEB CLIENT ERROR

$
0
0
Hello guys.

I'm not familiar with this error (see attached photo)

p7w1zqg46n7b.png

I already check the ports and services of navsetting.json and it already uses the right port and nav service.

As I run the that link, it gives me that kind of error. is there anyone encountered this error? All replies will be appreciated. thanks a lot :)

Thanks and God Bless

Importing a xml with external DTD (NAV 2015)

$
0
0
Hi all,

I am trying to import an xml file with an external DTD into NAV 2015. We are migrating from 4.03, in this version it was runnig well.

Now I am getting:

For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method.

The XML file is starting like this

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ORDER SYSTEM "http://www.............(valid path)..................dtd">
<ORDER type="standard" version="1.0">

I cant find out how to solve it, what am I doing wrong?

Regards

duration to time

$
0
0
Hi Experts!!
I have a field type duration with value 1132690
I want to pass it to type time 00:00 h. but I can not find any function that does, only text with the format function but that is not what I need, is there any function?

As always thank you very much

AL Language: Import Proprietary Files

$
0
0
Hi,

We're about to upgrade one of our customers to BC, and - to streamline updates in the future - We're rebuilding all his customizations as extensions. - Not for appsource, but so we don't have to worry about customized standard tables aso.

Most of it works fairly well, but there is a problem on the horizon I'm not sure how to solve yet: Importing/exporting proprietary files. To my knowledge, AL Language can't receive Data from files directly and the System Object "FILE" doesn't exist anymore. I know here are solutions to receive and send Files per WebService.

But is there anything available to just get a file processed, that's sitting on the Users Harddisk? Or, vice versa exporting data into a proprietary file?

I know i COULD build a C/AL based codeunit just to handle the files, but this will defeat the whole "move to extensions" approach.

Ty for your input

BC on premise - problem with only some symbols not loading

$
0
0
I'm working on a Swedish client for an on premise installation and this client has some non-extension based third party objects that are generally used in Sweden NAV installs that are in a part of the 12 million range of object numbers. I am able to download symbols without error, however Visual Studio Code complains that it cannot find the symbols for any of these objects for the third party solution. Currently this client is in a test system prior to implementation and is running our our developer license which emphatically does have permissions to this object range.

Since I have a need to use some of these tables and codeunits in my extension, this is causing a problem. I have done the following:

(We are on BC CU 1)

- Made sure I have the correct version of the AL development tools for Visual Studio code (2.0.56865)
- Recompiled all objects.
- Built server application objects (through the "classic" developer interface)
- Sync schema for all tables (through the "classic" developer interface)
- Run the finsql command=generatesymbolreference successfully (output to log file, no errors or warnings) multiple times.
- Restarted the service multiple times between each of these steps.

Note that both the web client and RTC can be run and pages and tables that are part of this third party solution can be viewed/run without issue, so I am reasonably comfortable in saying this is almost certainly not a permission issue, unless visual studio code has a limitation in that regard.

Does anybody have any ideas on what it might be that I am missing? Everything works except use of these third party objects and I cannot find any reason why those symbols might not be loaded.

Messages of information

$
0
0
Hi Experts! NAV2018

Does anyone know how to put this kind of messages like the one in the image?
It's for a personalized page where I need to put informative messages

l2f52z6voybz.png

thanks in advance!!

Excel Buffer - export with picture

$
0
0
Hi

I'm exporting Item-Table info witg Excel Buffer Codeunit.
Is it possible to export picture with this.

Thanks

/Kenneth

Purchase Invoice Posting error-Quantity must have a value in Item Journal Line : Journal Template Na

$
0
0
Hi All,
I am getting error while posting Purchase Invoice -
Quantity must have a value in Item Journal Line : Journal Template Name=,Journal Batch Name=, Line NO.=0, It cannot be zero or empty.
My database is Navision 2013 IN.
Thanks.

How to zoom a page in Web client?

$
0
0
Hi All,
In RTC we use CTRL+ALT+F1. Now as higher version is released (Webclient), what is the shortcut key to zoom a page?

Thanks in Advance.

'Change License' in Dynamics NAV Development Shell?

$
0
0
Is it possible?
Just want to export some objects in text format without uploading developer's license to the customer's database.

Issues with HMRC VAT Sandbox

$
0
0
I'm currently having issues trying to use the integrated Making Tax Digital facilities on Dynamics 365 (otherwise known as NAV 2019)
I have setup the GovTalk Service on Service connector (see below) and as far as I am aware there is no issue with it.

81bz5buv8rgy.png

However I cannot run "Request Authentication Code" HMRC VAT Sandbox as it gives me the following message, {"error":"invalid_request","error_description":"client_id is invalid"} , please see below for the HMRC VAT Sandbox Page.

gllg344w69vz.png



Payment remittance

$
0
0
Hello all. I've searched through the forum and I can't find anything that is what I'm looking for, so hopefully someone can help.

I'm currently testing 2018 and was wondering if there is anything that can send out or even pdf vendor remittance from the payment journal, per vendor. Right now, the remittance does 1 pdf file for the entire journal. Is there a way to get it to go to separate files with out having something customized?

Thanks in advance for any advice.
Viewing all 10032 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>