I just can’t make my custom ControlSettings work. I’m in 10.2.700.15. When I use SettingStyle (comment line), every thing is ok. Can somebody point me where the problem is…
private void AddRROnQuoteDtl()
{
var quoteDtlView = oTrans.Factory("QuoteDtl");
var myCustomSetting = new ControlSettings() { BackColor = Color.Orange, ForeColor = Color.Black };
mandatoryOrderDtlFieldList
.ForEach(field =>
{
var rrEmptyField = new RowRule( "QuoteDtl." + field, RuleCondition.Equals, "");
rrEmptyField.AddAction(RuleAction.AddControlSettings(oTrans, "QuoteDtl." + field, myCustomSetting));
// rrEmptyField.AddAction(RuleAction.AddControlSettings(oTrans, "QuoteDtl." + field, SettingStyle.Warning));
quoteDtlView.AddRowRule(rrEmptyField);
});
}
No, your proposition doesn’t work for my context. But it works (i tried it). In your proposition, your using a RowSettings wich will apply the action on all fields of the row.
My step are:
1- Adding RowRules on Load (I’ve also tried to add them in the Initialize)
2- After the form is open, I search for a Quote with no lines
3- After clicking on the GetNew button, the row rules are working with the SettingStyle action but not with the ControlSettings.
I get the same behavior in another screen. I just can’t figure why the ControlSettings doen’t work. I’ve also tried to use the Wizard to create a RowRule and inside of the method, I have replace the SettingStyle by the ControlSettings with not positive result.
Interesting, I did some testing and the following works for me for individual blank string fields. My guess would be something with the dataview returned from oTran.Factory maybe? The only other difference I see is passing the action[] in the row rule constructor vs. the add action method.
var view = (EpiDataView)this.oTrans.EpiDataViews["QuoteDtl"];
ControlSettings myControl = new ControlSettings();
myControl.BackColor = System.Drawing.Color.Navy;
fieldList.ForEach( field =>
{
string binding = view.ViewName + "." + field;
view.AddRowRule(
new RowRule(binding, RuleCondition.Equals, "",
new RuleAction[]
{
RuleAction.AddControlSettings(this.oTrans, binding, myControl )
})
);
});
It’s the first thing I did when I notice my code was not working. I did plenty of code with ControlSettings, particularly with the Epicor SDK. I’ll keep investigating …
Got it. After decompiling the EpiClientLib.dll and making some tests, I finally made it work. First time I’ve encountered such problem. It always worked nicely before. Anyway, I got what I want.