Hello Kyat33.
The main problem is that You tried to generate the Wrappers of Modern UI via ClassGenerator.exe and ClassGenerator.exe.config. You should use the way which is briefly described in SDK - README. Although the documentation provides very limited information, I could understand the workflow after the research. You can compare the Wrappers generated in 2 ways, after comparing the Wrapper of the same Screen, You could notice some differences.
So, the wrappers for Modern UI should be generated by .NET Console Application Core project. References in .csproj file should also be added.
<ItemGroup>
<PackageReference Include="Execution" Version="25.201.213.220" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />
<PackageReference Include="PX.QA.WrappersGenerator" Version="25.201.213.220" />
</ItemGroup>
It also requires the nuget package to be installed. You can use this command to install it. Please also pay attention on the version.
Install-Package Microsoft.Bcl.AsyncInterfaces -Version 5.0.0
In Your new console application create a new class which will contain the method to generate the Wrappers. The arguments of the method would specify the Acumatica instance URI, username, password, tenant, wrapper’s code namespace, path of the generated files, log result information and error response. In this code I specified the Automation Testing project itself as the destination of the generated wrappers. It is important to ensure the screen is in Modern UI view for the user account provided in the credentials. Here is the template example of the code, with some explanations of the package usage.
internal class WrappersGenerator
{
public static void MethodGenerator()
{
//WG is available in PX.QA.WrappersGenerator
//Log and its methods are available in Execution
var wg = new WG("http://localhost/PayPal_25_201_0213", "admin", "psw1234", "Company",
"WrappersModernUI",
"C:\\Users\\vachagan.mirzoyan\\source\\repos\\TestPaypal_25_201_0213\\TestPaypal_25_201_0213\\WrappersModernUI",
_ => Log.Information(_),
_ => Log.Error(_));
wg.RunAsync("BZ501001").Wait();
}
}
The Web.config file of Acumatica instance may require this to be added in <appSettings> section.
<add key="EnableSiteMapSwitchUI" value="True" />
The remaining steps of the using the Wrappers, are the same. Have Your own custom class derived from the generated wrappers, and use the UI element via Your custom class.
I could automatically insert value into the Modern UI fields via this approach.
Please let me know if this helps You.