- I want to display a real field Sales Price in the InventOnHandItem form.
- The Sales Price = Cost price * 1.25
- The Cost Price field is displayed by a system default method called AverageCostPriceUnit from the Data source on the form - InventSum
- The actual table InventSum does not have this method. It only exists on the Data source to the form InventOnhandItem.
- I am trying to write a class with a method that will extend the existing method so that I can use AverageCostPriceUnit * 1.25 and display the result in my real field Sales Price.
- The code I wrote is as follows:
Build step: Metadata validation started. Time: 08/12/2024 18:24:41
Build step: Metadata validation completed (581 ms). Time: 08/12/2024 18:24:41
Build step: X++ compilation started. Time: 08/12/2024 18:24:42
: Compilation failed.
C:\AOSService\PackagesLocalDirectory\ApplicationCommon\ApplicationCommon\AxReference\Microsoft.Commerce.Flighting.Common.xml(0,0): AssemblyFileNotFound: Assembly 'Microsoft.Xbox.Experimentation.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d91bba2b903dc20f' failed to load because it was not found.
C:\AOSService\PackagesLocalDirectory\ApplicationSuite\Foundation\AxReference\Microsoft.Dynamics___vices.PricingEngine.xml(0,0): AssemblyFileNotFound: Assembly 'Microsoft.Dynamics.Commerce.Runtime.Entities.AttributeBasedPricing, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' failed to load because it was not found.
C:\AOSService\PackagesLocalDirectory\ApplicationSuite\Foundation\AxReference\Azure.Core.xml(0,0): AssemblyFileNotFound: Assembly 'System.Memory.Data, Version=1.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' failed to load because it was not found.
C:\AOSService\PackagesLocalDirectory\FleetManagement\FleetManagement\AxClass\Invent_Extension.xml(0,0): UnhandledException: Abnormal termination with unhandled exception. Exception key: 79899e16-0eef-4884-b4b9-24e0227aadee. System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.TypeResolver.ValidateFormNestedElementsExtensionOf(SemanticFormType semanticFormType, IEnumerable`1 extesionOfParamters)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.TypeResolver.CheckForExtensionClassConstraints(SymbolTable payload, ClassOrInterface classOrInterface)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.TypeResolver.VisitClassOrInterface(SymbolTable payload, ClassOrInterface classOrInterface)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitModelElement(TPayload payload, ModelElement modelElement)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.TypeResolver.VisitModelElement(SymbolTable payload, ModelElement modelElement)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitCompilationUnit(TPayload payload, CompilationUnit compilationUnit)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitorWithDiagnostics`2.VisitCompilationUnit(TPayload payload, CompilationUnit compilationUnit)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.TypeResolverPipelineEntry.Execute(CompilationUnit compilationUnit, TypeResolver resolver)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.Pipeline.ExecutePipeline(CompilationUnit compilationUnit, IDiagnosticSink diagnostics, IXppcMetadataProvider metadataProvider, Stack`1 context)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.MultipassAdministrator.RunPipeline(CompilationUnit compilationUnit, Pipeline pipeline)
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ClassTypeGenerator.<>c__DisplayClass6_0.<RunPipeline>b__0(String name)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.ParallelCrashDumpUtil.<>c__DisplayClass1_0`1.<ForEach>b__2(T t)
at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ).
X++ compiler exited unexpectedly with failure code -1.
Build step: X++ compilation completed (1702 ms). Time: 08/12/2024 18:24:43
Build step: Best practice check started. Time: 08/12/2024 18:24:43
Build step: Best practice check completed (481 ms). Time: 08/12/2024 18:24:44
Build completed (2862 ms). Time: 08/12/2024 18:24:44