Closed kylehardin6 closed 5 years ago
You don't specify the image you use, but I assume you are using Business Central and that this is a bug in Business Central (not sure whether it ever got/will get fixed). As a result of this, I changed all the places where I use invoke codeunit to instead invoke an API (which I expose in my app), It is a much cleaner solution anyway and fairly easy. Described here: https://freddysblog.com/2019/03/27/navcontainerhelper-0-5-0-11/
Yes, BC14. I will give that a try.
Yeah, so you are running into this platform bug, which I don't know whether it ever will get fixed (as the API route is better and more future-safe).
So far, they have not fixed it - I just applied CU2 and it still does the same thing. I will try the API.
Invoke-NavContainerCodeunit does not seem to work with NavUserPassword. It's fine with windows authentication, but with NavUserPassword, the NST says that the operation cannot be completed.
$containerName = 'CKS' $companyName = "CKS Packaging" $navApp = Resolve-Path "..\ArcherPoint_CKSPackaging_1.0.0.0.app" $hostPackageFile = Resolve-Path "..\Rapid\CKS.rapidstart" $credential = get-credential -Message "Using NavUserPassword Authentication. Please enter username/password for the Containter."
this works
Publish-NavContainerApp
-useDevEndpoint
-containerName $containerName-credential $credential
-appFile $navApp-skipVerification
-sync Add-install
-tenant defaultthis does not
$containerPackageFile = Split-Path $hostPackageFile -leaf Copy-Item $hostPackageFile c:\share\ $containerPackageFile = "c:\share\" + $containerPackageFile $params = @{ 'containerName' = $containerName } $params += @{ 'companyName' = $companyName } $params += @{ 'codeunitId' = 8620 } $params += @{ 'methodName' = 'ImportAndApplyRapidStartPackage' } $params += @{ 'argument' = $containerPackageFile } Write-Host "Importing " $hostPackageFile Invoke-NavContainerCodeunit @params -ErrorAction Continue