Skip to main content
Answer

Processing Dialog box not appearing on Custom processing screen

  • March 20, 2025
  • 3 replies
  • 85 views

DipakNilkanth
Pro III
Forum|alt.badge.img+13

Hello Community,

I am building a custom processing screen in Acumatica and facing an issue where the processing dialog (popup) is not showing when I click "Process" or "Process All."

Can someone help me figure out what I’m missing? Below is the code I am using.
 

public class BusinessAccountMaintTSExt : PXGraph<BusinessAccountMaintTSExt>
{
// Use PXFilter for ProcessFilter
public PXFilter<ProcessFilter> Filter;



public PXProcessingJoin<BAccount, LeftJoin<Customer, On<Customer.bAccountID, Equal<BAccount.bAccountID>>>,
Where<Customer.bAccountID, IsNull,
And<BAccount.type, NotEqual<BAccountType.customerType>,
And<BAccount.type, NotEqual<BAccountType.vendorType>,
And<BAccount.type, NotEqual<BAccountType.employeeType>,
And<BAccount.type, NotEqual<BAccountType.combinedType>,
And<BAccount.type, NotEqual<BAccountType.branchType>,
And<BAccount.type, NotEqual<BAccountType.empCombinedType>>>>>>>>> ItemsProcessing;

public BusinessAccountMaintTSExt()
{


ItemsProcessing.SetProcessDelegate(
delegate (List<BAccount> list)
{
PXLongOperation.StartOperation(this, delegate
{
ProcessItems(list, Filter.Current);
});
});
}

public virtual void ProcessItems(List<BAccount> list, ProcessFilter filter)
{
if (list == null || list.Count == 0) return;

if (filter == null || string.IsNullOrEmpty(filter.CustomerClassID))
{
// Acuminator disable once PX1050 HardcodedStringInLocalizationMethod [Justification]
throw new PXException("Customer Class ID is required.");
}

// Process each selected item
foreach (BAccount ba in list)
{
try
{
ProcessSingleItem(ba, filter.CustomerClassID);
PXProcessing<BAccount>.SetProcessed();
}
catch (Exception ex)
{
PXProcessing<BAccount>.SetError(ex.Message);
PXTrace.WriteError($"Error processing {ba.AcctCD}: {ex.Message}");
}
}
}


public virtual void ProcessSingleItem(BAccount ba, string customerClassID)
{
BusinessAccountMaint graph = PXGraph.CreateInstance<BusinessAccountMaint>();
graph.BAccount.Current = graph.BAccount.Search<BAccount.bAccountID>(ba.BAccountID);
if (graph.BAccount.Current == null)
{
// Acuminator disable once PX1050 HardcodedStringInLocalizationMethod [Justification]
throw new PXException("Business Account not found.");
}


if (graph.BAccount.Current.Type == BAccountType.CustomerType)
{
// Acuminator disable once PX1050 HardcodedStringInLocalizationMethod [Justification]
throw new PXException("This Business Account is already a Customer.");
}


CustomerMaint customerGraph;
try
{
// Get the ExtendToCustomer extension
var ext = graph.GetExtension<BusinessAccountMaint.ExtendToCustomer>();
if (ext == null)
{
// Acuminator disable once PX1051 NonLocalizableString [Justification]
throw new PXException(PX.Objects.CR.MessagesNoPrefix.CannotConvertBusinessAccountToCustomer);
}

// Call the Extend method on the extension instance
customerGraph = ext.Extend();

if (customerGraph == null || customerGraph.BAccount.Current == null)
{
// Acuminator disable once PX1051 NonLocalizableString [Justification]
throw new PXException(Messages.FailedToCreateCustomerGraph);
}
}
catch (Exception ex)
{
// Acuminator disable once PX1051 NonLocalizableString [Justification]
throw new PXException(Messages.FailedToCreateCustomerGraph, ex.Message);
}
// Set customer class ID
customerGraph.BAccount.Current.CustomerClassID = customerClassID;

// Handle class change
customerGraph.BAccount.View.Answer = WebDialogResult.Yes;
customerGraph.BAccount.UpdateCurrent();


customerGraph.Actions.PressSave();

// PXTrace.WriteInformation($"Successfully converted {ba.AcctCD} to customer");
}


Any advice or example would be really appreciated!

Thank you in advance!

Best answer by Samvel Petrosov

Hi Samuel,

I have already tried using PXFilteredProcessing, but the Processing dialog box is still not displaying.

I cannot remove the filtering as I have added Customer Class as a filter, which is required when extending and saving a customer.

Do you have any other suggestions?

Just realized that you have a PXLongRunOperation in the SetProcessDelegate.

That is most likely what is causing the issue. SetProcessDelegate is expecting a function that it will run in a separate thread behind the scene.

3 replies

Samvel Petrosov
Jr Varsity II
Forum|alt.badge.img+8

I think this has something to do with the way you are filtering the records.

Could you please try to completely remove the filtration and see if that fixes this?

If yes, then I guess you will need to switch to using PXFilteredProcessing

https://help.acumatica.com/(W(2))/Help?ScreenId=ShowWiki&pageid=939eba70-3702-92ec-598e-bd94c6455ac9


DipakNilkanth
Pro III
Forum|alt.badge.img+13
  • Author
  • Pro III
  • March 24, 2025

Hi Samuel,

I have already tried using PXFilteredProcessing, but the Processing dialog box is still not displaying.

I cannot remove the filtering as I have added Customer Class as a filter, which is required when extending and saving a customer.

Do you have any other suggestions?


Samvel Petrosov
Jr Varsity II
Forum|alt.badge.img+8

Hi Samuel,

I have already tried using PXFilteredProcessing, but the Processing dialog box is still not displaying.

I cannot remove the filtering as I have added Customer Class as a filter, which is required when extending and saving a customer.

Do you have any other suggestions?

Just realized that you have a PXLongRunOperation in the SetProcessDelegate.

That is most likely what is causing the issue. SetProcessDelegate is expecting a function that it will run in a separate thread behind the scene.