Hi,
I wanted to remove “Hold” from AP Bills through webservice API by calling following code and it is throwing an error “The Remove Hold button is disabled” but in actual the button is not disabled and I can remove hold manually on UI without any error. any one knows what is wrong with the code?
static MyWebservice.Screen context = new Screen();
context.AP301000Clear();
var commands = new List<Command>
{
// Header Info
new Key { Value = "='" + dr["ReferenceNbr"].ToString() + "'", FieldName =
APBill.DocumentSummary.ReferenceNbr.FieldName, ObjectName =
APBill.DocumentSummary.ReferenceNbr.ObjectName }
};
commands.Add(APBill.Actions.ReleaseFromHold);
var poResults = context.AP301000Submit(commands.ToArray());
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> PX.Data.PXActionDisabledException: Error: The Remove Hold button is disabled.
at PX.Data.PXAction`1.<Press>d__33.MoveNext()
at PX.Api.SyImportProcessor.SyStep.PressButton(PXAction button, PXAdapter adapter, SyView view, String actionName, Object[] currents)
at PX.Api.SyImportProcessor.SyStep.CommitChangesInt(Object itemToBypass, PXFilterRow[] targetConditions, PXFilterRow[] filtersForAction, SyImportRowResult importResult)
at PX.Api.SyImportProcessor.SyStep.CommitChanges(Object& itemToBypass, PXFilterRow[] targetConditions, PXFilterRow[] filtersForAction)
at PX.Api.SyImportProcessor.ExportTableHelper.ExportTable()
at PX.Api.ScreenUtils.Submit(String screenId, IReadOnlyList`1 commands, SchemaMode schemaMode, PXGraph& graph, String& redirectContainerView, String& redirectScreen, Boolean mobile, Dictionary`2 viewFilters, IGraphHelper graphHelper)
at PX.Api.Services.ScreenService.Submit(String id, IEnumerable`1 commands, SchemaMode schemaMode, Boolean mobile, PXGraph& forceGraph, String& redirectContainerView, String& redirectScreen, Dictionary`2 viewFilters, IGraphHelper graphHelper)
at PX.Api.Services.ScreenService.Submit(String id, IEnumerable`1 commands, SchemaMode schemaMode)
at PX.Api.Soap.Screen.ScreenGate.Submit(Command[] commands)
--- End of inner exception stack trace ---