cannot convert from 'UserControl Chart: "Microsoft.Dynamics.Nav.Client.BusinessChart"' to '__MissingTypeSymbol__
Page/Pag70086946.CleverCreditStatEntriesTMN.al(150,40): error AL0133: Argument 1: cannot convert from 'UserControl Chart: "Microsoft.Dynamics.Nav.Client.BusinessChart"' to 'MissingTypeSymbol'
AL Language version 0.17.30289 Latest bcinsider build (as of today)
My project compiles, but I get the above error attempting to publish the app to the server.
Hi @jimmymcp ! Could you open the settings of your workspace and specify the "al.assemblyProbingPaths"? 'al.assemblyProbingPaths':[{PathToAddInsFolder}]
Hi @atoader Working on this with jimmymcp, I've set the assembly probing path as
"al.assemblyProbingPaths": [
"./.netpackages",
"C:/Program Files/Microsoft Dynamics NAV/130/Service/Add-ins"
]
which does have the BusinessChartBuffer folder inside. Still coming across the same error when publishing, but we can build the app. We do get the following as suggestions:

Have the target in the app.json set to Extension.
Hi @atoader, I'm getting this error when publishing as well. Running AL Language 2.0.41872 and bcsandbox-master from yesterday.
The app builds just fine, but we get the error when VS Code tries to publish the app. So the error comes from the NAV Server, not from AL compiler as it seems.
Do you have a more specific sample on how the al.assemblyProbingPaths should be set? We've tried with local paths in the project (after copying the BusinessChart folder from the server) and remote paths (on the server), but no luck.
@StanislawStempin According to #3423, this was a bug that should have been resolved and shipped. What am I missing? :)
3423 is this bug, which one did you mean to point to?
@StanislawStempin Auch, sorry! I meant to point to #2477
Hi! It looks like you are trying to pass a BussinessChart user control to a procedure taking the backing .NET type. Could you please confirm that this is the issue? Can you post the snippet of code where the issue is located?
Hi @atoader !
Thanks for the hint! I thought it was the UserControl that was the issue, but it was a call to the Update function of the "Business Chart Buffer" table, where we pass the user control as a parameter, that caused this error.
This is old converted code, that have been working just fine in C/AL for some time. Both in Web Client and WinClient.
First we have the usercontrol:
usercontrol(Chart; "Microsoft.Dynamics.Nav.Client.BusinessChart")
{
trigger AddInReady()
begin
gChartIsReady := true;
UpdateChart(false);
end;
}
And then some al to that:
var
gBusChartBuf: Record "Business Chart Buffer";
gChartIsReady: Boolean;
local procedure UpdateChart(pShowValues: Boolean);
begin
if not gChartIsReady then
exit;
InitChartData(gBusChartBuf);
gBusChartBuf.Update(CurrPage.Chart);
end;
If I remove the line "gBusChartBuf.Update(CurrPage.Chart);", the app can be published. But with that line present, I get the error:
error AL0133: Argument 1: cannot convert from 'UserControl Chart: "Microsoft.Dynamics.Nav.Client.BusinessChart"' to '__MissingTypeSymbol__'
How should we use this Business Chart if this call is not possible? Is this a bug?
Hi @jwikman !
Can you try to compile this sample?
// 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!
page 50100 MyPage
{
PageType = Card;
ApplicationArea = All;
UsageCategory = Administration;
layout
{
area(Content)
{
group(GroupName)
{
usercontrol(Chart; "Microsoft.Dynamics.Nav.Client.BusinessChart")
{
trigger AddInReady()
begin
gChartIsReady := true;
UpdateChart(false);
end;
}
}
}
}
var
gBusChartBuf: Record "Business Chart Buffer";
gChartIsReady: Boolean;
local procedure UpdateChart(pShowValues: Boolean);
begin
if not gChartIsReady then
exit;
// InitChartData(gBusChartBuf);
gBusChartBuf.Update(CurrPage.Chart);
end;
}
I took the code you posted and put it on a page.
@atoader , thanks for your fast reply.
Tried your page, and receives the very same error:
[2018-09-04 22:22:44.51] The request for path /NAV/dev/apps?SchemaUpdateMode=recreate failed with code 422. Reason: Extension compilation failed
HelloWorld.al(38,29): error AL0133: Argument 1: cannot convert from 'UserControl Chart: "Microsoft.Dynamics.Nav.Client.BusinessChart"' to '__MissingTypeSymbol_
Line 38: gBusChartBuf.Update(CurrPage.Chart);
So it seems at we've got a small repro for this issue :)
I installed NAV from the latest release build, configured the development environment and published and it worked. Are you using C/SIDE with generatesymbols ?
@jwikman could you post the exact steps you followed to set up your environment?
I created an Azure VM with Docker yesterday through http://aka.ms/bcdeveloperpreviewext using bcinsider.azurecr.io/bcsandbox-master:se as the docker image. Let me know if you need more details
I just noticed that the C/SIDE shortcut that was created on the desktop had the parameter generatesymbolreference=1 set. I have not changed anything in C/AL, but I've been running C/SIDE.
Thanks! I will try to repro this first thing in the morning. I think this is the source of a few of the issues we've been seeing.
Great, looking forward to your results!
This should be fixed and available in the daily drops.
Thanks @atoader,
I can confirm that this works for me on NAV Version: 13.0.24284.0-SE
Unfortuanately it didn't make it into RC1 (there the same error occured, but now while compiling), so I hope we'll see a RC2 with this fix soon.
Hi @atoader, I just installed RC3, but it still doesn't work there. runtime 13.0.24535 vsix 2.0.43900, Microsoft_Application_13.0.24573.0 Microsoft_System_13.0.12929.0
So I assume that this fix didn't make it into BC Fall '18 release? (build numbers are greater than where I saw the fix in MASTER branch) When can we expect this fix to be available in bcinsider.azurecr.io/bcsandbox?
I also assume that the issue right now is only in the vsix file, since I get the error as a problem in VS Code: "Argument 1: cannot convert from 'UserControl Chart: "Microsoft.Dynamics.Nav.Client.BusinessChart"' to 'MissingTypeSymbol" But I guess that it's a bad idea to use the vsix from MASTER... ;)