Dynamics 365 Blog - Page 2

These posts are machine-translated.

Use built-in symbols as display method

If you want to include one of the symbols included in Dynamics 365 for Finance and Operations as a display method, the following is an example:

[SysClientCacheDataMethodAttribute(true)]
public display container displayOnHoldImage()
{
    if (trueContition)
    {
        return ImageReference::constructForSymbol(ImageReferenceSymbol::Pause).pack();
    }
    return connull();
}

 


 
 

Error "The step failed" during platform update 32 while updating retail self service

If the following error occurs during a platform update of a local VPC...

GlobalUpdate script for service model: RetailSelfService on machine: D365Local
Update Retail self service.
UpdateRetailSelfService.ps1 failed.
The step failed
The step: 52 is in failed state, you can use rerunstep command to debug the step explicitly
   at Microsoft.Dynamics.AX.AXUpdateInstallerBase.RunbookExecutor.ExecuteRunbookStepList(RunbookData runbookData, String updatePackageFilePath, Boolean silent, String stepID, ExecuteStepMode executeStepMode, Boolean versionCheck, Parameters parameters)
   at Microsoft.Dynamics.AX.AXUpdateInstaller.Program.InstallUpdate(String[] args)
   at Microsoft.Dynamics.AX.AXUpdateInstaller.Program.Main(String[] args)

...it might help to start the Azure storage emulator and then continue the update process at the failed step.


 
 

Remove label file on a development environment

If you should get into the embarrassment of having to delete a label file on a development environment, you should case check afterwards whether fragments of this label file are still left in the following directories:

  • C:\AOSService\PackagesLocalDirectory\MyModel\MyModel\AxLabelFile
  • C:\AOSService\PackagesLocalDirectory\MyModel\Resources (also in subdirectories per language)

 
 

Simple time measurement in code

To measure the execution time of a function/logic, you can use System.Diagnostics.Stopwatch:

System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
watch.Start();
// ... do something
watch.Stop();
info(strFmt("%1ms", watch.ElapsedMilliseconds));

 
 

[BPFrameworkFatalException]:A fatal exception occured in the Best Practices framework

I have had the problem in the past that the BP test did not find all expected deviations or even the following error was issued:

[BPFrameworkFatalException]:A fatal exception occured in the Best Practices framework.

In all these cases it has helped to disable the following rule: BPCheckTableDimensionFields

D365 Best practice rules

I found the decisive tip in the Dynamics 365 Community


 
 

How to get dimension display value for ledgerDimension field

If you want to determine the display value of a financial dimension stored as RefRecId by code, you can use the following function from the LedgerDimensionFacade:

DimensionDisplayValue displayValue = 
LedgerDimensionFacade::getDisplayValueForLedgerDimension(ledgerJournalTrans.LedgerDimension);

 
 

Control FormViewOption of a form through code

To control the FormViewOption of a form, you can use code like the following:

public static void setFormViewOption(
    FormRun _formRun,
    FormViewOption _formViewOption = FormViewOption::Details
    )
{
    if (_formRun
        && _formRun.viewOptionHelper())
    {
        _formRun.viewOptionHelper().setViewOption(_formViewOption);
    }
}

 


 
 
Pages « 1 2 3 4 5 » 

 

 
 
 
Posts of the actual month
April 2024
MoTuWeThFrSaSu
1234567
891011121314
15161718192021
22232425262728
2930 
 
© 2006-2024 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.