# Currform.Field.Enabled based on Condition

**URL:** <https://www.dynamicsuser.net/t/currform-field-enabled-based-on-condition/53905>\
**Category:** Developers Forum\
**Created:** [July 15, 2014, 10:10am UTC](https://www.dynamicsuser.net/t/currform-field-enabled-based-on-condition/53905 "2014-07-15T10:10:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sheeja](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@Sheeja](https://www.dynamicsuser.net/u/Sheeja)\
**Post date:** [July 15, 2014, 10:10am UTC](https://www.dynamicsuser.net/t/currform-field-enabled-based-on-condition/53905/1 "2014-07-15T10:10:04Z")

</div>

I have the issue with Currform.Field.Enabled property based on condition.

And my code (On Item Type OnValidate & OnAfterGetCurrRecord) is

**CASE “Item Type” OF**

**"Item Type"::“Filter Plate”:**

**BEGIN**

**//IF “Item Type” = “Item Type”::“Filter Plate” THEN BEGIN**

**CurrForm.“Instrument Type”.ENABLED(FALSE);**

**CurrForm.Range.ENABLED(FALSE);**

**CurrForm.Body.ENABLED(FALSE);**

**CurrForm.“Process Connection”.ENABLED(FALSE);**

**CurrForm.Model.ENABLED(FALSE);**

**CurrForm.BoreDia.ENABLED(FALSE);**

**CurrForm.RodDia.ENABLED(FALSE);**

**CurrForm.“Stoke length”.ENABLED(FALSE);**

**CurrForm.Kwatts.ENABLED(FALSE);**

**CurrForm.“BOM Door Cylinder”.ENABLED(FALSE);**

**CurrForm.“Plate Shifter”.ENABLED(FALSE);**

**CurrForm.“Main Cylinder”.ENABLED(FALSE);**

**CurrForm.“Side Cylinder”.ENABLED(FALSE);**

**CurrForm.“Valves Type”.ENABLED(FALSE);**

**CurrForm.“Valves Category”.ENABLED(FALSE);**

**CurrForm.PLC.ENABLED(FALSE);**

**CurrForm.“OP Panel”.ENABLED(FALSE);**

**CurrForm.MCC.ENABLED(FALSE);**

**CurrForm.LCS.ENABLED(FALSE);**

**CurrForm.RLC.ENABLED(FALSE);**

**CurrForm.Gladding.ENABLED(FALSE);**

**CurrForm.MoC.ENABLED(FALSE);**

**END;**

**"Item Type"::“Filter Cloth”:**

**BEGIN**

**CurrForm.“Instrument Type”.ENABLED(FALSE);**

**CurrForm.Range.ENABLED(FALSE);**

**CurrForm.Body.ENABLED(FALSE);**

**CurrForm.“Process Connection”.ENABLED(FALSE);**

**CurrForm.BoreDia.ENABLED(FALSE);**

**CurrForm.RodDia.ENABLED(FALSE);**

**CurrForm.“Stoke length”.ENABLED(FALSE);**

**CurrForm.Kwatts.ENABLED(FALSE);**

**CurrForm.“BOM Door Cylinder”.ENABLED(FALSE);**

**CurrForm.“Plate Shifter”.ENABLED(FALSE);**

**CurrForm.“Main Cylinder”.ENABLED(FALSE);**

**CurrForm.“Side Cylinder”.ENABLED(FALSE);**

**CurrForm.“Valves Type”.ENABLED(FALSE);**

**CurrForm.“Valves Category”.ENABLED(FALSE);**

**CurrForm.PLC.ENABLED(FALSE);**

**CurrForm.“OP Panel”.ENABLED(FALSE);**

**CurrForm.MCC.ENABLED(FALSE);**

**CurrForm.LCS.ENABLED(FALSE);**

**CurrForm.RLC.ENABLED(FALSE);**

**CurrForm.Gladding.ENABLED(FALSE);**

**CurrForm.MoC.ENABLED(FALSE);**

**END;**

**"Item Type"::Cylinder:**

**BEGIN**

**CurrForm.“Instrument Type”.ENABLED(FALSE);**

**CurrForm.Range.ENABLED(FALSE);**

**CurrForm.Body.ENABLED(FALSE);**

**CurrForm.“Process Connection”.ENABLED(FALSE);**

**CurrForm.Kwatts.ENABLED(FALSE);**

**CurrForm.“BOM Door Cylinder”.ENABLED(FALSE);**

**CurrForm.“Plate Shifter”.ENABLED(FALSE);**

**CurrForm.“Main Cylinder”.ENABLED(FALSE);**

**CurrForm.“Side Cylinder”.ENABLED(FALSE);**

**CurrForm.“Valves Type”.ENABLED(FALSE);**

**CurrForm.“Valves Category”.ENABLED(FALSE);**

**CurrForm.PLC.ENABLED(FALSE);**

**CurrForm.“OP Panel”.ENABLED(FALSE);**

**CurrForm.MCC.ENABLED(FALSE);**

**CurrForm.LCS.ENABLED(FALSE);**

**CurrForm.RLC.ENABLED(FALSE);**

**CurrForm.Gladding.ENABLED(FALSE);**

**CurrForm.MoC.ENABLED(FALSE);**

**CurrForm.Type.ENABLED(FALSE);**

**CurrForm.Tickness.ENABLED(FALSE);**

**CurrForm.“Discharge Type”.ENABLED(FALSE);**

**CurrForm.Varient.ENABLED(FALSE);**

**END;**

**"Item Type"::“Power Pack”:**

**BEGIN**

**CurrForm.“Instrument Type”.ENABLED(FALSE);**

**CurrForm.Range.ENABLED(FALSE);**

**CurrForm.Body.ENABLED(FALSE);**

**CurrForm.“Process Connection”.ENABLED(FALSE);**

**CurrForm.“Valves Type”.ENABLED(FALSE);**

**CurrForm.“Valves Category”.ENABLED(FALSE);**

**CurrForm.PLC.ENABLED(FALSE);**

**CurrForm.“OP Panel”.ENABLED(FALSE);**

**CurrForm.MCC.ENABLED(FALSE);**

**CurrForm.LCS.ENABLED(FALSE);**

**CurrForm.RLC.ENABLED(FALSE);**

**CurrForm.Gladding.ENABLED(FALSE);**

**CurrForm.MoC.ENABLED(FALSE);**

**CurrForm.Type.ENABLED(FALSE);**

**CurrForm.Tickness.ENABLED(FALSE);**

**CurrForm.“Discharge Type”.ENABLED(FALSE);**

**CurrForm.Varient.ENABLED(FALSE);**

**CurrForm.BoreDia.ENABLED(FALSE);**

**CurrForm.RodDia.ENABLED(FALSE);**

**CurrForm.“Stoke length”.ENABLED(FALSE);**

**CurrForm.Model.ENABLED(FALSE);**

**CurrForm.Size.ENABLED(FALSE);**

**END;**

**"Item Type"::Valves:**

**BEGIN**

**CurrForm.“Instrument Type”.ENABLED(FALSE);**

**CurrForm.Range.ENABLED(FALSE);**

**CurrForm.Body.ENABLED(FALSE);**

**CurrForm.“Process Connection”.ENABLED(FALSE);**

**CurrForm.PLC.ENABLED(FALSE);**

**CurrForm.“OP Panel”.ENABLED(FALSE);**

**CurrForm.MCC.ENABLED(FALSE);**

**CurrForm.LCS.ENABLED(FALSE);**

**CurrForm.RLC.ENABLED(FALSE);**

**CurrForm.Gladding.ENABLED(FALSE);**

**CurrForm.MoC.ENABLED(FALSE);**

**CurrForm.Type.ENABLED(FALSE);**

**CurrForm.Tickness.ENABLED(FALSE);**

**CurrForm.“Discharge Type”.ENABLED(FALSE);**

**CurrForm.Varient.ENABLED(FALSE);**

**CurrForm.BoreDia.ENABLED(FALSE);**

**CurrForm.RodDia.ENABLED(FALSE);**

**CurrForm.“Stoke length”.ENABLED(FALSE);**

**CurrForm.Model.ENABLED(FALSE);**

**CurrForm.“BOM Door Cylinder”.ENABLED(FALSE);**

**CurrForm.“Plate Shifter”.ENABLED(FALSE);**

**CurrForm.“Main Cylinder”.ENABLED(FALSE);**

**CurrForm.“Side Cylinder”.ENABLED(FALSE);**

**CurrForm.Kwatts.ENABLED(FALSE);**

**CurrForm.Pressure.ENABLED(FALSE);**

**END;**

**"Item Type"::“PLC Panel”:**

**BEGIN**

**CurrForm.“Instrument Type”.ENABLED(FALSE);**

**CurrForm.Range.ENABLED(FALSE);**

**CurrForm.Body.ENABLED(FALSE);**

**CurrForm.“Process Connection”.ENABLED(FALSE);**

**CurrForm.Gladding.ENABLED(FALSE);**

**CurrForm.MoC.ENABLED(FALSE);**

**CurrForm.Type.ENABLED(FALSE);**

**CurrForm.Tickness.ENABLED(FALSE);**

**CurrForm.“Discharge Type”.ENABLED(FALSE);**

**CurrForm.Varient.ENABLED(FALSE);**

**CurrForm.BoreDia.ENABLED(FALSE);**

**CurrForm.RodDia.ENABLED(FALSE);**

**CurrForm.“Stoke length”.ENABLED(FALSE);**

**CurrForm.Model.ENABLED(FALSE);**

**CurrForm.“BOM Door Cylinder”.ENABLED(FALSE);**

**CurrForm.“Plate Shifter”.ENABLED(FALSE);**

**CurrForm.“Main Cylinder”.ENABLED(FALSE);**

**CurrForm.“Side Cylinder”.ENABLED(FALSE);**

**CurrForm.“Valves Type”.ENABLED(FALSE);**

**CurrForm.“Valves Category”.ENABLED(FALSE);**

**CurrForm.Size.ENABLED(FALSE);**

**CurrForm.Kwatts.ENABLED(FALSE);**

**END;**

**"Item Type"::Frame:**

**BEGIN**

**CurrForm.“Instrument Type”.ENABLED(FALSE);**

**CurrForm.Range.ENABLED(FALSE);**

**CurrForm.Body.ENABLED(FALSE);**

**CurrForm.“Process Connection”.ENABLED(FALSE);**

**CurrForm.Type.ENABLED(FALSE);**

**CurrForm.Tickness.ENABLED(FALSE);**

**CurrForm.Varient.ENABLED(FALSE);**

**CurrForm.BoreDia.ENABLED(FALSE);**

**CurrForm.RodDia.ENABLED(FALSE);**

**CurrForm.“Stoke length”.ENABLED(FALSE);**

**CurrForm.Model.ENABLED(FALSE);**

**CurrForm.“BOM Door Cylinder”.ENABLED(FALSE);**

**CurrForm.“Plate Shifter”.ENABLED(FALSE);**

**CurrForm.“Main Cylinder”.ENABLED(FALSE);**

**CurrForm.“Side Cylinder”.ENABLED(FALSE);**

**CurrForm.“Valves Type”.ENABLED(FALSE);**

**CurrForm.“Valves Category”.ENABLED(FALSE);**

**CurrForm.Size.ENABLED(FALSE);**

**CurrForm.PLC.ENABLED(FALSE);**

**CurrForm.“OP Panel”.ENABLED(FALSE);**

**CurrForm.MCC.ENABLED(FALSE);**

**CurrForm.LCS.ENABLED(FALSE);**

**CurrForm.RLC.ENABLED(FALSE);**

**CurrForm.Make.ENABLED(FALSE);**

**CurrForm.Pressure.ENABLED(FALSE);**

**CurrForm.Kwatts.ENABLED(FALSE)**

**END;**

**"Item Type"::Instruments:**

**BEGIN**

**CurrForm.Type.ENABLED(FALSE);**

**CurrForm.Tickness.ENABLED(FALSE);**

**CurrForm.“Discharge Type”.ENABLED(FALSE);**

**CurrForm.Varient.ENABLED(FALSE);**

**CurrForm.BoreDia.ENABLED(FALSE);**

**CurrForm.RodDia.ENABLED(FALSE);**

**CurrForm.“Stoke length”.ENABLED(FALSE);**

**CurrForm.Model.ENABLED(FALSE);**

**CurrForm.“BOM Door Cylinder”.ENABLED(FALSE);**

**CurrForm.“Plate Shifter”.ENABLED(FALSE);**

**CurrForm.“Main Cylinder”.ENABLED(FALSE);**

**CurrForm.“Side Cylinder”.ENABLED(FALSE);**

**CurrForm.“Valves Type”.ENABLED(FALSE);**

**CurrForm.“Valves Category”.ENABLED(FALSE);**

**CurrForm.Size.ENABLED(FALSE);**

**CurrForm.PLC.ENABLED(FALSE);**

**CurrForm.“OP Panel”.ENABLED(FALSE);**

**CurrForm.MCC.ENABLED(FALSE);**

**CurrForm.LCS.ENABLED(FALSE);**

**CurrForm.RLC.ENABLED(FALSE);**

**CurrForm.Gladding.ENABLED(FALSE);**

**CurrForm.MoC.ENABLED(FALSE);**

**CurrForm.Kwatts.ENABLED(FALSE);**

**CurrForm.Pressure.ENABLED(FALSE);**

**END;**

**END;**

Its not working properly when i do enter item type or when i click on next rec view. Enabled Fields varies according to the item type

Each time I choose the rec from list to card, only when i run it again it works fine.  
Is it possible to make work on all cases?

Thanks in Advance,

SS

---

<div class="post-metadata">

**Author:** ![monu.2671](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@monu.2671](https://www.dynamicsuser.net/u/monu.2671)\
**Post date:** [July 16, 2014, 8:31am UTC](https://www.dynamicsuser.net/t/currform-field-enabled-based-on-condition/53905/2 "2014-07-16T08:31:26Z")

</div>

Hi,

System is not properly works because you only write the code for disable the control. So once you disable the control its not activated for next record. So you need to write the code for Enable= true also. see below bold lines…

Example

CASE “Item Type” OF

“Item Type”::“Filter Plate”:

BEGIN

//IF “Item Type” = “Item Type”::“Filter Plate” THEN BEGIN

CurrForm.“Instrument Type”.ENABLED(FALSE);

CurrForm.Range.ENABLED(FALSE);

CurrForm.Body.ENABLED(FALSE);

CurrForm.“Process Connection”.ENABLED(FALSE);

**CurrForm.Model.ENABLED(FALSE);**

…

“Item Type”::“Filter Cloth”:

BEGIN

**CurrForm.Model.ENABLED(TRUE); —**

CurrForm.“Instrument Type”.ENABLED(FALSE);

CurrForm.Range.ENABLED(FALSE);

CurrForm.Body.ENABLED(FALSE);

…

---

<div class="post-metadata">

**Author:** ![Sheeja](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@Sheeja](https://www.dynamicsuser.net/u/Sheeja)\
**Post date:** [July 16, 2014, 8:53am UTC](https://www.dynamicsuser.net/t/currform-field-enabled-based-on-condition/53905/3 "2014-07-16T08:53:08Z")

</div>

Ya Monu, Thanks for your reply. What you said is right. But in my case Field control should be enabled & disabled based on Item type. And i have done with the task. I left the code to enable the field in each type for that particular type. Thats the issue & i solved it.

Thanks,

SS
