Verify that prices have been added in 2 pricelists
JohnOBrien
Hi all,Any help appreciated on creating a rule that checks that the user has set the price in 2 price lists before adding the item.
Thanks,
John
Friederike Mundt
Hi John,One option to check this could be to get the value via UI from the relevant price lists. You would do this in an Opimizer Rule on FormDataAdd Before Event.
To get the value select the corresponding price lists in the combobox and read the value. Make sure to freeze and unfreeze the form so the use does not see it:
Sample select a price list, get the value and return false if it is empty:
[CODE]
string price;
pVal.Form.Freeze(true);
ComboBox.GetFromUID(pVal.Form, "24").Select("1");
price = TextEdit.GetFromUID(pVal.Form, "34").Value;
if (price == "")
{
pVal.Form.Freeze(false);
MessageBox.Show("Price in Price List 1 ... not defined", "OK");
TextEdit.GetFromUID(pVal.Form, "34").Click(SwissAddonFramework.UI.Components.Item.ClickType.Regular);
return false;
}
ComboBox.GetFromUID(pVal.Form, "24").Select("2");
price = TextEdit.GetFromUID(pVal.Form, "34").Value;
if (price == "")
{
pVal.Form.Freeze(false);
MessageBox.Show("Price in Price List 2 ... not defined", "OK");
TextEdit.GetFromUID(pVal.Form, "34").Click(SwissAddonFramework.UI.Components.Item.ClickType.Regular);
return false;
}
pVal.Form.Freeze(false);
[/CODE]
I did not do real testing for this and there are probably other options to check but it is one option that works and hope it helps to get started.
Cheers,
Friederike
John O'Brien
Thanks a lot [color=#282828][font=helvetica, arial, sans-serif]Friederike, this helps a lot![/font][/color]
0
Please sign in to leave a comment.
Comments
0 comments