I think just like buttons you can EpiBind it to OrderHed.DepositHoldShape
and then you can use Row Rules, you have to explicitly type that binding out and pretend it exists.
Here are two Examples.
In this example I use a Row Rule but I have a UD Field.
private void CreateRowRuleShipDtlCustomerOwnedInventory_cEquals_false()
{
// Description: hideCustomerOwnedInventory
// **** begin autogenerated code ****
RuleAction invisibleShipDtl_CustomerOwnedInventory_c = RuleAction.AddControlSettings(this.oTrans, "ShipDtl.CustomerOwnedInventory_c", SettingStyle.Invisible);
RuleAction[] ruleActions = new RuleAction[] {
invisibleShipDtl_CustomerOwnedInventory_c};
// Create RowRule and add to the EpiDataView.
RowRule rrCreateRowRuleShipDtlCustomerOwnedInventory_cEquals_false = new RowRule("ShipDtl.CustomerOwnedInventory_c", RuleCondition.Equals, false, ruleActions);
((EpiDataView)(this.oTrans.EpiDataViews["ShipDtl"])).AddRowRule(rrCreateRowRuleShipDtlCustomerOwnedInventory_cEquals_false);
// **** end autogenerated code ****
}
In this Example you will notice me using OrderHed.eshUnfirmedReleases
with a custom Condition.
private void CreateRowRuleOrderRelFirmReleaseCustomCondition_false()
{
// Description: UnfirmedReleases
// **** begin autogenerated code ****
RuleAction invisibleOrderHed_eshUnfirmedReleases = RuleAction.AddControlSettings(this.oTrans, "OrderHed.eshUnfirmedReleases", SettingStyle.Invisible);
RuleAction[] ruleActions = new RuleAction[] {
invisibleOrderHed_eshUnfirmedReleases};
// Create RowRule and add to the EpiDataView.
RowRule rrCreateRowRuleOrderRelFirmReleaseCustomCondition_false = new RowRule("OrderRel.FirmRelease", new RowRuleConditionDelegate2(this.OrderRelFirmReleasefalse_CustomRuleCondition), null, ruleActions);
((EpiDataView)(this.oTrans.EpiDataViews["OrderHed"])).AddRowRule(rrCreateRowRuleOrderRelFirmReleaseCustomCondition_false);
// **** end autogenerated code ****
}
private bool OrderRelFirmReleasefalse_CustomRuleCondition(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
EpiDataView edvOrderRel = this.oTrans.Factory("OrderRel");
if (edvOrderRel.Row != -1 && edvOrderRel.dataView.Count > 0) {
return !Convert.ToBoolean(edvOrderRel.dataView.Table.Select("FirmRelease = 0 AND OpenRelease = 1").Length > 0);
}
return true;
}
Basically use Row Rules with an imaginary binding
I think @Rich can confirm that Epicor’s Framework handles Buttons and Shapes differently, they get a pass but still can make use of Binding to Manage their states, visibility, colors what not.
That’s what I’ve been doing, replicating what Epicor does on other Shapes and Buttons.