Hi
fixed
edV.dataView[edV.Row][“PriceListStatus_c”]=1; should be args.Row[“PriceListStatus_c”]=1; Doh!
**
I am trying to highlight the DspDocUnitPrice field on the Order Detail tab. I need to check two fields BreakListCode and DiscBreakListCode, if both are null I set a UD field PriceListStatus_c to 1, if either, or both, has a value I set PriceListStatus_c to 2. By default PriceListStatus_c is 0.
The CustomRule checks the PriceListStatus_c value and if it is 0, triggers the CustomRuleAction.
When create a new line or changing the partnumber of an existing line it works. If I retrieve a previously created order the code ‘appears’ to be set it must not be as it loops back to the the CustomRule again.
I have tried with edV.Notify(new EpiNotifyArgs(“SalesOrderForm”,edV.Row,edV.Column)); commented in and out.
any ideas?
Thanks.
private bool OrderDtlPriceListStatus_c0_CustomRuleCondition(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
bool result = false;
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put Row Rule condition evaluation logic here
if(args.Row["PartNum"].ToString() == "") return false;
if(args.Arg1.ToString() == "0")
{
return true;
}
else
{
return false;
}
}
private void OrderDtlPriceListStatus_cDelegate0_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put custom Rule Action logic here
EpiDataView edV = (EpiDataView)oTrans.EpiDataViews["OrderDtl"];
var test1 = args.Row["BreakListCode"].ToString();
var test2 = args.Row["DiscBreakListCode"].ToString();
if(test1 == "" && test2 == "")
{
edV.dataView[edV.Row].BeginEdit();
edV.dataView[edV.Row]["PriceListStatus_c"]=1;
edV.dataView[edV.Row].EndEdit();
}
else
{
edV.dataView[edV.Row].BeginEdit();
edV.dataView[edV.Row]["PriceListStatus_c"]=2;
edV.dataView[edV.Row].EndEdit();
}
//edV.Notify(new EpiNotifyArgs("SalesOrderForm",edV.Row,edV.Column));
}
}