Skip to main content
Solved

Release Hold is disabled when using WebDialogResult in APInvoiceEntry graph extension

  • May 28, 2024
  • 1 reply
  • 53 views

In the below screenshot, I am attempted to override the Release Hold button the Bills and Adjustments screen using a graph extension:

I am running into an issue where I receive the following error:
 

This error seems to happen due to the use of the WebDialogResult, while the purpose of this change was to include the dialog, when it is removed and we just either A) throw the exception or B)invoke the base the functionality here seems to work. When the dialog is initiated, that is when the error appears.

Here is the trace log:
 

PX.Data.PXActionDisabledException2024-05-28 16:37:58 UTC
 
Exception Type PX.Data.PXActionDisabledException
Message

Error: The Remove Hold button is disabled.

Stack Trace

at PX.Data.PXFirstChanceExceptionLogger.ProfilerFirstChanceException(Object o, FirstChanceExceptionEventArgs args) at PX.Data.PXAction`1.<Press>d__38.MoveNext() at PX.Web.UI.PXBaseDataSource.tryExecutePendingCommand(String viewName, String[] sortcolumns, Boolean[] descendings, Object[] searches, Object[] parameters, PXFilterRow[] filters, DataSourceSelectArguments arguments, Boolean& closeWindowRequired, Int32& adapterStartRow, Int32& adapterTotalRows) at PX.Web.UI.PXBaseDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments) at PX.Web.UI.PXDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments) at PX.Web.UI.PXDataSourceView.Select(DataSourceSelectArguments arguments, PXDSSelectArguments swarguments, DataSourceViewSelectCallback callback) at PX.Web.UI.PXFormDataProvider.DataBind() at PX.Web.UI.PXCallbackManager.CollectDataControls(Dictionary`2 controlsDic, List`1 controlsList) at PX.Web.UI.PXCallbackManager.RenderClientData(PXCallbackResultMethod resultMethod, XmlWriter writer) at PX.Web.UI.PXCallbackManager.GetCallbackResultInternal(PXCallbackResultMethod resultMethod) at PX.Web.UI.PXCallbackManager.GetCallbackResult(PXCallbackResultMethod resultMethod) at System.Web.UI.Page.RenderCallback() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at PX.Web.UI.PXPage.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error) at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus) at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

Best answer by darylbowman

I think this is essentially the same logic as your code, with a slight difference. Try it, and if it works, I’ll explain why I think it does.

public IEnumerable ReleaseFromHold(PXAdapter adapter, ReleaseFromHoldDelegate baseMethod)
{
	if (IsIn3WayValidation())
		return baseMethod.Invoke(adapter);
	else
	{
		if (Base.Document.Ask("Warning", ...))
		{
			// Throw exception
		}
		else
			return baseMethod.Invoke(adapter);
	}
}

Edit: I made a small change to the original code that will run baseMethod in either case, but the important piece is that it does not run baseMethod at the end of the method.

View original
Did this topic help you find an answer to your question?

1 reply

darylbowman
Captain II
Forum|alt.badge.img+13
  • 1712 replies
  • Answer
  • May 28, 2024

I think this is essentially the same logic as your code, with a slight difference. Try it, and if it works, I’ll explain why I think it does.

public IEnumerable ReleaseFromHold(PXAdapter adapter, ReleaseFromHoldDelegate baseMethod)
{
	if (IsIn3WayValidation())
		return baseMethod.Invoke(adapter);
	else
	{
		if (Base.Document.Ask("Warning", ...))
		{
			// Throw exception
		}
		else
			return baseMethod.Invoke(adapter);
	}
}

Edit: I made a small change to the original code that will run baseMethod in either case, but the important piece is that it does not run baseMethod at the end of the method.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings