I’m trying to create a new Customer from a custom screen and button, but having an issue when setting the CustomerClassID on the new Customer object:
CustomerMaint customerMaint = PXGraph.CreateInstance<CustomerMaint>();
Customer newAcumaticaCustomer = new Customer();
newAcumaticaCustomer.AcctCD = "RC1111";
newAcumaticaCustomer.Status = "A";
newAcumaticaCustomer.CustomerClassID = "REC01";
newAcumaticaCustomer.DiscTakenAcctID = 103;
newAcumaticaCustomer.DiscTakenSubID = 29;
newAcumaticaCustomer.StatementCycleId = "01";
newAcumaticaCustomer.StatementType = "O";customerMaint.CurrentCustomer.Insert(newAcumaticaCustomer);
customerMaint.Save.Press();
The problem is that there is a popup about changing the Customer Class and pressing Yes/No doesn’t allow the customer to be created and the popup keeps happening. Have tried:
customerMaint.Answers.View.Answer = WebDialogResult.Yes;
With various changes and nothing seems to work.
Is there a way to create Customer similar to this?
Thanks All!