Knockout.js is not Loaded in D365FO MPOS/CPOS Extension Project Successfully / How to import Knockout.js in POS Extension.
Knockout.Js
How to Import Knockout.JS in POS Project.
If the
Knockout.js is not loaded automatically ApplicationStartTrigger &
BirthdayFieldsSection packageform AMER POS is not loaded successfully in POS
Solution:
Go to POS Project Right Click and unload it. See the
project Source
Add KnockoutjsFile in PropertyGroup Element
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<KnockoutjsFile>Libraries/knockout.js</KnockoutjsFile>
</PropertyGroup>
Also add Target Element
<Target Name="ContentIncludeKnockoutLibrary" BeforeTargets="AssignTargetPaths" DependsOnTargets="RunResolvePackageDependencies">
<PropertyGroup>
<KnockoutLibraryFilePath Condition="'%(PackageDefinitions.Name)' == 'knockoutjs'">%(PackageDefinitions.ResolvedPath)\Content\Scripts\knockout-%(PackageDefinitions.Version).js</KnockoutLibraryFilePath>
</PropertyGroup>
<Copy SourceFiles="$(KnockoutLibraryFilePath)" DestinationFiles="$(KnockoutjsFile)" SkipUnchangedFiles="true" />
<!-- Necessary for CPOS -->
<ItemGroup>
<Content Include="$(KnockoutjsFile)"></Content>
</ItemGroup>
</Target>
Final Result link This
Comments
Post a Comment