Closed pmatsconsulting closed 3 years ago
The bakfile you are restoring - is that from the same version of BC?
Yes, it's from 17.1 OnPrem FR version On container : Version : FR Business Central 17.1 (plateforme 17.0.18204.18738 + application 17.1.18256.18792) On OnPrem Server (source of backup) : Version : FR Business Central 17.1, (plateforme 17.0.18204.18738 + application 17.1.18256.18792)
Just one thing, the backup contains a modified Base Application...
The source code of Base Application (standard not modified):
codeunit 1441 "RC Headlines Executor"
{
TableNo = "Job Queue Entry";
trigger OnRun()
var
RCHeadlinesUserData: Record "RC Headlines User Data";
RoleCenterPageID: Integer;
begin
Evaluate(RoleCenterPageID, "Parameter String");
RCHeadlinesUserData.Get(UserSecurityId(), RoleCenterPageID);
WorkDate := RCHeadlinesUserData."User workdate";
OnComputeHeadlines(RoleCenterPageID);
end;
procedure ScheduleTask(RoleCenterPageID: Integer)
var
JQE: Record "Job Queue Entry";
Tomorrow: Date;
begin
JQE.SetRange("Object Type to Run", JQE."Object Type to Run"::Codeunit);
JQE.SetRange("Object ID to Run", Codeunit::"RC Headlines Executor");
JQE.SetRange("Parameter String", Format(RoleCenterPageID));
JQE.SetFilter(Status, '%1|%2', JQE.Status::"In Process", JQE.Status::Ready);
if not JQE.IsEmpty() then
exit;
JQE.SetFilter(Status, '%1|%2', JQE.Status::Error, JQE.Status::"On Hold");
if JQE.FindFirst() then begin
// restart the job tomorrow
Tomorrow := CalcDate('<+1d>');
JQE."Earliest Start Date/Time" := CreateDateTime(Tomorrow, Time());
end else begin
// create a new job
JQE.Init();
JQE."Object Type to Run" := JQE."Object Type to Run"::Codeunit;
JQE."Object ID to Run" := Codeunit::"RC Headlines Executor";
JQE."Parameter String" := Format(RoleCenterPageID);
end;
if TaskScheduler.CanCreateTask and JQE.WritePermission then
Codeunit.Run(Codeunit::"Job Queue - Enqueue", JQE)
else
OnTaskSchedulerUnavailable(JQE);
end;
[IntegrationEvent(false, false)]
local procedure OnComputeHeadlines(RoleCenterPageID: Integer)
begin
end;
[InternalEvent(false)]
local procedure OnTaskSchedulerUnavailable(JobQueueEntry: Record "Job Queue Entry")
begin
end;
}
The source code of _Microsoft_Tests-TestLibraries.app:
codeunit 130626 "Library - Headlines"
{
EventSubscriberInstance = Manual;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"RC Headlines Executor", 'OnTaskSchedulerUnavailable', '', false, false)]
local procedure OnTaskSchedulerUnavailable(JobQueueEntry: Record "Job Queue Entry")
begin
Codeunit.Run(Codeunit::"RC Headlines Executor", JobQueueEntry);
end;
}
As you can see, OnTaskSchedulerUnavailable is marked as InternalEvent...
Why it works with standard Base Application?
My assumption is that there is an internalsvisibleto (to the test apps) I will ask Nikola
I think, it's in the modified Base Application that I must put InternalsVisibleTo to some apps in the app.json. But with what aspps? (InternalsVisibleTo is empty in the NavxManifest.xml of the standard Base Application.app and in the source of the standard Base Application InternalsVisibleTo is not present in the app.json ...)
<InternalsVisibleTo>
<Module Id="5d86850b-0d76-4eca-bd7b-951ad998e997" Name="Tests-TestLibraries" Publisher="Microsoft" />
<Module Id="c49d9d39-1c94-46d2-8bf7-3cce15ba54dc" Name="Tests-SMTP" Publisher="Microsoft" />
<Module Id="7fe10be7-575f-4cce-957b-bcd0df8f9bd7" Name="Tests-Rapid Start" Publisher="Microsoft" />
<Module Id="4564dd2f-e8b2-41ff-9905-9d7a950475a5" Name="Tests-Misc" Publisher="Microsoft" />
<Module Id="8c9fc75f-dc51-40de-a6fa-55e7bbe0c0c2" Name="Tests-What's New Notifier Test" Publisher="Microsoft" />
</InternalsVisibleTo>
Found in c:\applications\baseapp\Microsoft_Base Application.app navxmanifest.xml (from inside a container). Will fix extract-appfiletofolder to add this to app.json (if you specify -generateappjson) - that was missing
Thank you very much Freddy !!! I will try and give you feedback
"internalsVisibleTo": [
{
"id": "5d86850b-0d76-4eca-bd7b-951ad998e997",
"publisher": "Microsoft",
"name": "Tests-TestLibraries"
},
{
"id": "c49d9d39-1c94-46d2-8bf7-3cce15ba54dc",
"publisher": "Microsoft",
"name": "Tests-SMTP"
},
{
"id": "7fe10be7-575f-4cce-957b-bcd0df8f9bd7",
"publisher": "Microsoft",
"name": "Tests-Rapid Start"
},
{
"id": "4564dd2f-e8b2-41ff-9905-9d7a950475a5",
"publisher": "Microsoft",
"name": "Tests-Misc"
},
{
"id": "8c9fc75f-dc51-40de-a6fa-55e7bbe0c0c2",
"publisher": "Microsoft",
"name": "Tests-What\u0027s New Notifier Test"
}
],
Fix shipped in 1.0.16
Describe the issue After running Restore-DatabasesInBCContainer, Import-TestToolkitToNavContainer generates error:
Scripts used to create container and cause the issue
Full output of scripts