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

Report calls report and output to PDF

$
0
0
I created a report (A) that calls another report (B). A report has an option to print to PDF so that it shows on screen as a PDF format. But when I run report A with the PDF option, report B is not taking that in consideration and prints straight to the printer. Is there a way to transfer the PDF output option to Report B?
PS: I'm not thinking about the SAVEASPDF option.
Thanks.

Using Newtonsoft JSON Library to find specific key-value pairs in a JSON string

$
0
0
Hi everyone,

There are a number of posts here about parsing JSON files, but none that use the DotNet Newtonsoft JSON library.

Has anyone used the DotNet library Newtonsoft.Json.Linq.JObject to read specific key/value pairs from a JSON string?

I've loaded values into a Json Object:
{
  "item": {
    "ID": "72795",
    "Latitude": "34.045358",
    "Longitude": "-118.443574",
    "ZipCode": "90025",
    "CityAliasAbbr": null,
    "AreaCode": "310/424/818",
    "City": "LOS ANGELES",
    "CountyName": "LOS ANGELES",
    "CityAliases": {
      "Item": [
        {
          "ID": "72795",
          "Primary": "P",
          "CityType": "P",
          "CityAliasName": "LOS ANGELES",
          "MixedCaseAlias": "Los Angeles"
        },
        {
          "ID": "72796",
          "Primary": " ",
          "CityType": "N",
          "CityAliasName": "W LOS ANGELES",
          "MixedCaseAlias": "W Los Angeles",
        },
        {
          "ID": "72797",
          "Primary": " ",
          "CityType": "N",
          "CityAliasName": "WEST LOS ANGELES",
          "MixedCaseAlias": "West Los Angeles",
        },
      ]
    }
  }
}

I can retrieve the "item" key using:
IF JObject.TryGetValue('item',JToken) THEN BEGIN
  JProperty := JObject.Property(propertyName);
  value := JProperty.Value;
END;

The value returned is the entire Json string as above.

But I want to retrieve ONLY the "Latitude" and "Longitude" key-value pairs.

I've tried:
IF JObject.TryGetValue('[item][Longitude]',JToken) THEN BEGIN...
IF JObject.TryGetValue('item,Longitude',JToken) THEN BEGIN...

But both return <blank>.

There are numerous examples out on the web for C# or Javascript that say this can be done, i.e. you don't have to parse the entire string and check each key-value pair for the one you want. But the syntax doesn't translate to C/AL. for example:
JObject rss = JObject.Parse(json);
string rssTitle = (string)rss["item"]["Longitude"];

Does anyone know how to read a specific key-value pair in C/AL that is "nested" inside another key?

xRec and Rec have same value in sales line OnAfterModifyEvent (automated tests)

$
0
0
We are using the Microsoft Sales Test Library to create sales lines. We have an extension where we need to log certain changes to sales line fields under certain conditions (change log won't work for what we need)

We have a subscription on sales lines that works fine when we use the web client with keyboard and mouse (BC2020 wave 1)

[EventSubscriber(ObjectType::Table, Database::"Sales Line", 'OnAfterModifyEvent', '', true, true)]
local procedure LogEntrySalesLine(var Rec: Record "Sales Line"; var xRec: Record "Sales Line")
var
CU1: Codeunit "My CodeUnit";
begin
if Rec.IsTemporary then exit;
if (Rec.Quantity = 0) and (xRec.Quantity = 0) then exit; // This is always true when run from tests
if Rec.Type = Rec.Type::Item then
CU1.LogSalesLines(Rec, xRec);
end;


We create a sales line using SalesLibrary.CreateSalesLine and then do SalesLine.Validate(Quantity, 10) and SalesLine.Modify(true). In the event subscription, Rec and xRec have the same values for all fields

We then tried doing it without using the Microsoft Test Libraries.

SalesLine.Init();
SalesLine.Validate("Document Type", SalesHeader."Document Type");
SalesLine.Validate("Document No.", SalesHeader."No.");
RecRef.GetTable(SalesLine);
SalesLine.Validate("Line No.", LibraryUtility.GetNewLineNo(RecRef, SalesLine.FieldNo("Line No.")));
SalesLine.Insert(true);
SalesLine.Validate(Type, SalesLine.Type::Item);
SalesLine.Validate("No.", Item."No.");
SalesLine.Validate("Shipment Date", SalesHeader."Shipment Date");
if Qty <> 0 then
SalesLine.Validate(Quantity, Qty);
SalesLine.Modify(true);

Same problem

The only way we can get the test execute the code in the subscription and pass the assertions by using a TestPage:

var
SalesOrderSubform: TestPage "Sales Order Subform";

Begin
SalesOrderSubform.OpenEdit();
SalesOrderSubform.GoToKey(SalesDocTypeEnum::"Order", SalesHeader."No.", SalesLineNo);
SalesOrderSubform.Quantity.SetValue(10);
SalesOrderSubform.OK.Invoke();

Anyone got any ideas?

Thanks

Mark

how to read blob data from c#

$
0
0

As you knows , NAV could store big Text string data type to BLOB data type in sql server.
It works fine in NAV read and write.

//---write
CLEAR(Ostream);
myTestRec.INIT;
myTestRec."No.":='SO123456';
myTestRec."Line No":=10000;
myTestRec.Comment.CREATEOUTSTREAM(Ostream,TEXTENCODING::UTF8);
Com.WRITE(Ostream);
myTestRec.INSERT;


//---read & show
CLEAR(InStream);
myTestRec.RESET;
myTestRec.SETRANGE("No.",'SO123456');
IF myTestRec.FINDFIRST THEN
REPEAT

myTestRec.CALCFIELDS(Comment);
IF myTestRec.Comment.HASVALUE THEN BEGIN
myTestRec.Comment.CREATEINSTREAM(InStream,TEXTENCODING::UTF8);
InStream.READ(Txt);
MESSAGE(Txt);
END;

But how could I to read it out from sql server ,convert the BLOB data to varchar and show it on page by C# .
It seems always appeared garbled.

AL: Lists and Dictionaries

$
0
0
I've been looking for a good way to use the new variable types List and Dictionary to replace the use of temporary tables.
If anyone here has code snippets to share on how to implement those new buffering tools in more complex ways it would be very welcome! So far I came up with this:


// Welcome to your new AL extension.
// Remember that object names and IDs should be unique across all extensions.
// AL snippets start with t*, like tpageext - give them a try and happy coding!

pageextension 50100 CustomerListExt extends "Customer List"
{
trigger OnOpenPage();
var
myDictionary: Dictionary of [code[20], Decimal];
myListOfLists: List of [List of [code[20]]];
myListOfDictionaries: List of [Dictionary of [code[20], Decimal]];
i: Integer;
j: Integer;
begin
myDictionary.Add('A', 2.432);
myDictionary.Add('B', 0.037);
myDictionary.Add('C', 1.234);
myListOfDictionaries.Add(myDictionary);
clear(myDictionary);
myDictionary.Add('A', 1.425);
myDictionary.Add('B', 9.333);
myDictionary.Add('C', 0.123);
myListOfDictionaries.Add(myDictionary);
clear(myDictionary);
myDictionary.Add('A', 0.134);
myDictionary.Add('B', 3.234);
myDictionary.Add('C', 7.334);
myListOfDictionaries.Add(myDictionary);
for i := 1 to myListOfDictionaries.count do begin
myDictionary := myListOfDictionaries.get(i);
for j := 1 to myDictionary.Count do begin
message('%1', myDictionary.get('A'));
end;
end;
end;
}

HTML Parse

$
0
0
I have a problem with the HTML editor, my editor doesn't read the special characters like ö and ü etc. correctly. can tell me where the error is please.

HTML Speces in XML Document

$
0
0
How can I read in HTMLSpecs from XML document and save them in a table?

Migration 2009 to 2015 - Error Object name already exists

$
0
0
Hi,

I started a test migration from 2009 SP1 to 2015 CU 6 by using the guide from http://blogs.msdn.com/b/nav/archive/201 ... eased.aspx

Now I get an error during step 11:
"Open the old database with Microsoft Dynamics NAV 2013 development environment and convert the database."

Error message:
"The object name already exists. Object: Table 2000000053 Windows Access Control"

I downloaded the 2013 version from the link in the guide, so this is version -> 7.00.40468

Can somebody help me?

Reservation Entry

$
0
0
Reservation entry not getting update when changes in sales line.

Reservation Entry

$
0
0
Reservation entry not getting update when changes in sales line.

UseWindowsAuthentication for SaaS

$
0
0
Good afternoon.

I have an App working for OnPrem with this line:

HttpClient.UseWindowsAuthentication(User(), PasswordF());

I need to migrate to SaaS, and then I get this error:
The type or method 'UseWindowsAuthentication' cannot be used for 'Cloud' development.

How can I replace HttpClient.UseWindowsAuthentication for another kind of autentication allowed in SaaS?

Cheers.

BC 17 CU2 New Price Calculation implemented, how to import prices via interface-buffer table?

$
0
0
Hello,

I've been trying to understand the new price calculation that has been implemented, but some things don't make sence no matter how hard I search for answers.

As far as I understood for the new price calculation and management, the new Price List tables are being used. If I look into the table Sales Line in BC 17 CU 2, then the new price calculation also seems to be implemented there.

When I open the client and take a look from the item list or item card, there are only actions that lead to the old price pages and tables (Sales Price, Purchase Price, etc.). When I take a closer look in VS-Code, it seems that you manually input your prices in the old table, but there seems to functionality to transfer it also into the new tables, for which you apparently can't find and open the pages yet as a user.

Did I understand this correctly so far?

A customer who is currently using BC 13 (CU1) and is going to update to BC 17 (CU2) soon imports his item data including prices and discount from an external software into a buffer table from which we then process and fill the actual tables.

With the new price implementation, do we still fill the old price tables? Or just the new price list tables? Or must both be filled?

And what happens with the data during migration to BC 17? Is the data moved to the new table?

Thanks in advance!

Throughoutly confused,

Lily

Warehouse management

$
0
0
Hi all,
If I need to restrict shipments (only direct shipping) from a particular BIN, which setup needs to be activated?
I know there is a setup on Bin "Block Movement" for inbound/Outbound/All, but that doesn't work correctly.
Thanks in advance!

High CPU load when starting NAV service tiers

$
0
0
After a reboot of the server I start the NAV service tiers. After the service tiers has status Running, the CPU load is 100% for about 10 a 20 minutes.
I have no clue what the service tiers are doing. Anyone?

MS Dynamics NAV 2015 / LS 2015 - Navigation Pane replication

$
0
0
Good day!

MS Dynamics NAV 2015 / LS 2015 - Navigation Pane replication;

- we added new menu/group in Navigation Page called "NEW GROUP"

* is it possible to replicate Navigation Pane using Jobs Replication

4sqgwgbtu01a.jpg

MS Dynamics NAV version:

2w876hyla4hu.jpg

Thank you.


alternative material in BOM

$
0
0
Hi everybody,
we recently implemented BC and one of our major issues is the use of alternative material in BOMs, so for example BOM says 2mm Aluminium sheet 1000x2000 but in the moment we have just Sheets of 1500x3000mm (which can also be used for production), so we prepare the list of required material for warehouse, but somehow we need to Change this material in this particular case, so that stock values will be as well ok (as now they write it by hand and then inventory is no longer correct of Course... )
any idea is highly appreciated.
thanks :)

Silent installation Nav2016 Server failed with config xml file: error 1603

$
0
0
I have created a config with the following parameters:

<Parameter Id="NavServiceServerName" Value="localhost"/>
<Parameter Id="NavServiceInstanceName" Value="DynamicsNAV100TST"/>
<Parameter Id="NavServiceAccount" Value="<administrator account>"/>
<Parameter Id="NavServiceAccountPassword" IsHidden="yes" Value="password"/>

I run Powershell to install Navision 2017 CU28 SERVER:

Start-Process -NoNewWindow -Wait -FilePath "$($Command)" -ArgumentList "/config $($XMLCuInstallConfig)", "/quiet", "/log $($OutputLog)"

In the log I see the following error:

MSI log file set to: C:\Users\<user>\AppData\Local\Temp\setup.wix.msi.27.log
Windows Installer: Error: Service 'Microsoft Dynamics NAV Server [DynamicsNAV100TST]' (MicrosoftDynamicsNavServer$DynamicsNAV100TST) failed to start. Verify that you have sufficient privileges to start system services.
Done configuring package. Id = 'ServiceTier_NL' ReturnCode = 1603

When I install it manually, everything works fine.

I think that it has something to do with NavServiceAccount and password. I don't fill in the password in the config file. Could this be the problem?

Problem to Read Json Stream REST API

$
0
0
Hi Guys,

I'm trying to read a REST API Stream (Json) but something doesn't work.


For example:

i try the same Configuration with Postman and get a json stream, with ca. 2250 KB (Only Body Size)

like this:

rsezesxnf7kg.jpg

IF i use the same Configuration in NAV, and read the Respons, ist look like this.

ll03tdta6c0u.jpg

The Blob Size is exactly the Same (2250 KB).

My Code is this:

dfvroxb495sk.jpg



Save Whole Operation in Barcode

$
0
0
In Production Order Routing user can slelet setup time in and setup time out with an action button. How can I save those actions in barcode, so that user can scan that code instead of clicking on action button.

Page running slow / Index

$
0
0
Hi all,

I have different companies running on same database.
Problem: Running page customer list with some flowfields:
In one company running the customer page it runs perfectly.
On other companies it runs very slow and even closes NAV.

I think it's a index problem missing those table of different , but can't figure out which.
Does anyone got an idea how to help me?


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


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