web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Product configurator UI not refreshed after updating the xml D365 x++

(0) ShareShare
ReportReport
Posted on by 85

Please help me to update the Product configuration attribute value from custom field. I am able to update xml but form is not refreshing with updated xml.

pastedimage1624019555849v1.png

Tried below code:-

str configuredProductXML;

FormDataSource fds = sender.formRun().dataSource();// as PCRuntimeConfiguratorInfo;
PCRuntimeConfiguratorInfo RuntimeConfiguratorInfo = fds.cursor();
PCProductConfigurationModel productConfigurationModel ;//= PCProductConfigurationModel::findByName("LOGO");
//PCRuntimeControl runTimeControl = sender.formRun().design().controlName(formControlStr(PCRuntimeConfigurator,PCRuntimeControl));
FormControl itemSearch = sender.formRun().design().controlName(formControlStr(PCRuntimeConfigurator,WfsItemSearch));
FormTabPageControl tabPageCtrl = sender.formRun().design().controlName(formControlStr(PCRuntimeConfigurator,tabBody));
str item = itemSearch.valueStr();
FormRun fr = sender.formRun();
PCRuntimeControl runTimeControl = fr.parmPCRuntimeControl();
productConfigurationModel = fr.parmPCProductConfigurationModel();
//Info(strFmt("%1",runTimeControl.xmlModel()));
XmlDocument xmlDocument = XmlDocument::newXml(productConfigurationModel.getXML());
str modelXML = productConfigurationModel.getXML();
//Microsoft.Dynamics.AX.fr.Application.FormControlProxy runtimecontrolProxy = new Dynamics.AX.Application.FormControlProxy(runTimeControl);
//str XMLModel = new Microsoft.Dynamics.AX.Application.FormControlProxy(runTimeControl).CustomControlProperties[6];
System.String values;
values = '<Assignments>' ;//+
if(item != "")
{
values += '<Assignment xPath="ITEMNUMBER" value="'+item+'" />';// +
values += '<Assignment xPath="PROOFPLATE" value="'+item+'" />';// +
}
values +='</Assignments>';

PCRuntimeSynchronousConfigurator configurator = PCRuntimeSynchronousConfigurator::construct();
configurator.parmSolverStrategy(productConfigurationModel.getSolverStrategy());

Microsoft.Dynamics.Ax.Frameworks.Controls.ProductConfiguration.IsConfigurationComplete isConfigurationComplete;

isConfigurationComplete = configurator.configure(modelXML, values);
if (isConfigurationComplete ==
Microsoft.Dynamics.Ax.Frameworks.Controls.ProductConfiguration.IsConfigurationComplete::Complete)
{
configuredProductXML = configurator.getAllAssignedValues();
}


Microsoft.Dynamics.Ax.Frameworks.Controls.ProductConfiguration.IConfigurator configuratornew = Microsoft.Dynamics.Ax.Frameworks.Controls.ProductConfiguration.Configurator::Create(modelXML,true);
configuratornew.LoadAttributeValues();
configuratornew.AssignAttributeValueByXPath("ITEMNUMBER",item);
CLRObject configuratorCLR;
configuratorCLR = configuratornew;
runTimeControl.xmlModel(configuredProductXML);
runTimeControl.solverStrategy(productConfigurationModel.getSolverStrategy());
runTimeControl.columns(productConfigurationModel.Columns);

runTimeControl.attributeChanged("ITEMNUMBER",item);
configuratornew.StartSession();
configuratornew.WaitForIdleStateSync();

runTimeControl.editAutoPostback(true);
runTimeControl.resetUserSetting();
fds.reread();
fds.refresh();

I have the same question (0)
  • Hossein.K Profile Picture
    6,648 on at

    Hi Pupadhyay,

    To do this , use fds.Research(); instead of fds.reread(); or fds.refresh();

  • Pupadhyay Profile Picture
    85 on at

    Hi Hossein,

    It didn't worked for me. Actually this form loads from xml

  • Amitbansal Profile Picture
    5 on at

    It is Not working for me

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 660

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 655 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 557

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans