Skip to main content

Value cannot be null.
Parameter name: key

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: key

Source Error:
 

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:



1. Add a "Debug=true" directive at the top of the file that generated the error. Example:



  <%@ Page Language="C#" Debug="true" %>



or:



2) Add the following section to the configuration file of your application:



<configuration>

   <system.web>

       <compilation debug="true"/>

   </system.web>

</configuration>



Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.



Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.


Stack Trace:
 

>ArgumentNullException: Value cannot be null.
Parameter name: key]
System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) +52
System.Collections.Generic.Dictionary`2.FindEntry(TKey key) +14497875
System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) +21
PX.Web.UI.WebApi.Services.QPToolBarDataProvider.GetActionsSource(PXGraph graph, Boolean isPopupOn, Boolean popupInline, IScreenCommandsCustomInfo screenCommandsCustomInfo) +1516
PX.Web.UI.PXBaseDataSource.GetActionsSource() +305
PX.Web.UI.PXToolBar.IsToolbarEmpty() +53
PX.Web.UI.PXToolBar.Render(HtmlTextWriter writer) +195
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +132
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +271
PX.Web.UI.PXBaseDataSource.webControlRender(HtmlTextWriter writer) +141
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +132
PX.Web.UI.PXBaseDataSource.RenderControl(HtmlTextWriter writer) +50
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +271
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +132
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +271
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +132
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +271
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +208
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +132
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +69
ASP.masterpages_formtab_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) +200
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +117
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +132
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +271
System.Web.UI.Page.Render(HtmlTextWriter writer) +39
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +132
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +9480

 

@kevinheng21  Could you please share the customization package here? If you can, it would greatly assist us in reviewing it from our end


Is there any chance you changed the files in App_RuntimeCode and refreshed without publishing?


@kevinheng21 Also, I request you to check this LINK and may be helpful to you, if not please share the customization package as requested above.


Here the package and screen error Pages\AP\AP791000.aspx

https://drive.google.com/file/d/1UqxTRnUOKG1FOKYwpo-FnjrirodxdJPe/view?usp=sharing


I found the code that make it error. But I can fix it yet. Please advice me 

         PXUIField(DisplayName = "Reports", MapEnableRights = PXCacheRights.Select)]
        ÂPXButton(CommitChanges = true)]
        protected virtual IEnumerable Report(PXAdapter adapter) => adapter.Get();

        pPXButton(CommitChanges = true)]
        ePXUIField(DisplayName = "Print Payment Order")]
        protected void PaymentOrderform()
        {
            PaymentOrderHeader current = this.PaymentOrderHeaders.Current;
            throw new PXReportRequiredException(new Dictionary<string, string>()
            {
                <"RefNbr"] = current.RefNbr
            }, "PO109101", "Report");
        }


@kevinheng21  It seems like we need to handle the NULL exceptions. Can you please try with the below code. If still it is not working, please share the customization project here.

 

   PXUIField(DisplayName = "Reports", MapEnableRights = PXCacheRights.Select)]
PXButton(CommitChanges = true)]
protected virtual IEnumerable Report(PXAdapter adapter) => adapter.Get();

PXButton(CommitChanges = true)]
PXUIField(DisplayName = "Print Payment Order")]
protected void PaymentOrderform()
{
if(this.PaymentOrderHeaders.Current !=null)
{
PaymentOrderHeader current = this.PaymentOrderHeaders.Current;
throw new PXReportRequiredException(new Dictionary<string, string>()
{
"RefNbr"] = current?.RefNbr
}, "PO109101", "Report");
}
}

 


Reply