Customer action "Renew to supplier"

Using the latest Acumatica 5 with the latest and greatest updates, I am facing a web API issue that I was unable to resolve. I have code to perform an Extend to Vendor action on the Customer screen. It seems to work fine and throw no errors, but it doesn't create the provider. It seems to me that when performing the same steps through the website interface, the problem is that I did not send the correct command to select the Yes button in the warning popup. Please confirm if you want to update the current vendor settings with the default Vendor Class. The original settings will be saved differently. "I could be completely off, though any help would be greatly appreciated.

Here is my code:

String customerId = "SomeCustomerId";
String vendorClass = "SomeVendorClass";

AcumaticaApiWS.AR303000Content AR303000 = context.AR303000GetSchema();
AcumaticaApiWS.AP303000Content AP303000 = context.AP303000GetSchema();

context.AR303000Clear();
AR303000.Actions.ExtendToVendor.Commit = true;

AcumaticaApiWS.AR303000Content[] AR303000result = context.AR303000Submit
(
    new AcumaticaApiWS.Command[]
    {
        new AcumaticaApiWS.Value { Value = customerId, LinkedCommand = AR303000.CustomerSummary.CustomerID },
        AR303000.Actions.ExtendToVendor
    }   
);

AcumaticaApiWS.AP303000Content[] AP303000result = context.AP303000Submit
(
    new AcumaticaApiWS.Command[]
    {
        new AcumaticaApiWS.Value { Value = vendorClass, LinkedCommand = AP303000.GeneralInfoFinancialSettings.VendorClass },
        new AcumaticaApiWS.Value { Value = "YES", LinkedCommand = AP303000.GeneralInfoFinancialSettings.ServiceCommands.DialogAnswer, Commit = true },
        AP303000.Actions.Save
    }
);

      

Thank!

+3


source to share


1 answer


You're almost there. This is a tricky scenario as it involves multiple screens and dialogs, two things that are not trivial to use. Problems in your example code:

  • The dialog response must be set to before . In your case, you first set the provider class. This is counter intuitive, but the system needs to know this before the dialog is displayed.
  • The answer to the dialogue is "Yes", not "YES". You can see this by using the browser's inspector window and looking at the button title. The text is displayed in uppercase due to CSS styling.
  • You need to set the dialog response in the main form view ( AP303000.VendorSummary.ServiceCommands.DialogAnswer

    ) where the dialog is displayed. There is no way to find out without looking at the source code, but I believe this usually happens with dialog boxes.
  • Various settings are Commit = true

    not needed (but in this case, do not hurt).


This is the code I used and in my case it extends the client for the provider and changes the provider class at the same time:

String customerId = "ACTIVESTAF";
String vendorClass = "DATACENTER";

AcumaticaApiWS.AR303000Content AR303000 = context.AR303000GetSchema();
AcumaticaApiWS.AP303000Content AP303000 = context.AP303000GetSchema();

context.AR303000Clear();

AcumaticaApiWS.AR303000Content[] AR303000result = context.AR303000Submit
(
    new AcumaticaApiWS.Command[]
    {
        new AcumaticaApiWS.Value { Value = customerId, LinkedCommand = AR303000.CustomerSummary.CustomerID },
        AR303000.Actions.ExtendToVendor
    }
);

AcumaticaApiWS.AP303000Content[] AP303000result = context.AP303000Submit
(
    new AcumaticaApiWS.Command[]
    {
        new AcumaticaApiWS.Value { Value = "Yes", LinkedCommand = AP303000.VendorSummary.ServiceCommands.DialogAnswer },
        new AcumaticaApiWS.Value { Value = vendorClass, LinkedCommand = AP303000.GeneralInfoFinancialSettings.VendorClass },
        AP303000.Actions.Save
    }
);

      

+4


source







All Articles