This post on SO shows how you can set the value that you want the dialog to use:
https://stackoverflow.com/questions/56360479/how-to-pass-value-to-confirmation-popup-from-custom-screen/56365751#56365751
However, I feel like you should be able to set up the new Customer record with the different customer class ID without invoking the business logic by setting the desired value of the Customer Class ID.
Can you share your code?
@anahizentella94 in those cases, your logic should include the response right before the field that triggers the smartpanel is assigned.
Here is an example from the Service Order page:
//Answer is given in advance:
serviceOrderGraph.ServiceOrderRecords.View.Answer = WebDialogResult.Yes;
//Logic that prompts the smartpanel is added:
serviceOrderGraph.uncloseOrder.Press();
in your case, rather than pressing on UncloseOrder, you would be assigning the new CustomerClass value (make sure to either use SetValueExt<> or Update the cache right after the value is assigned)
Hi everybody,
I used this approach with try...catch:
{
CustomerMaint graph = PXGraph.CreateInstance<CustomerMaint>();
Customer exiCust = Customer.PK.Find(graph, bAccountID);
string newCustomerClassID = “NeededClassIDValue”;
cust.CustomerClassID = newCustomerClassID;
try
{
graph.CurrentCustomer.Update(exiCust);
}
catch
{
graph.BAccount.View.Answer = WebDialogResult.Yes;
}
graph.Persist();
}
Thanks for your answer, it worked with the @Fernando Amadoz’s suggestion