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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans