# How to enable/disable a field based on mainframe behaviour.

**URL:** <https://techcommunity.softwareag.com/t/how-to-enable-disable-a-field-based-on-mainframe-behaviour/90903>\
**Category:** Forum\
**Tags:** Mainframe-Integration, ApplinX\
**Created:** [August 6, 2009, 7:42pm UTC](https://techcommunity.softwareag.com/t/how-to-enable-disable-a-field-based-on-mainframe-behaviour/90903 "2009-08-06T19:42:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumar\_piyus](https://avatars.discourse-cdn.com/v4/letter/k/c57346/32.png) [@kumar\_piyus](https://techcommunity.softwareag.com/u/kumar_piyus)\
**Post date:** [August 6, 2009, 7:42pm UTC](https://techcommunity.softwareag.com/t/how-to-enable-disable-a-field-based-on-mainframe-behaviour/90903/1 "2009-08-06T19:42:36Z")

</div>

Hi,  
I am using ApplinX 8. I need to combine three screens from mainframe into a single screen. I am able to collect and display data from all three screens.

The problem is enabling/disabling of the fields. I can do that by Java Script but few fields will enabled for a particular user and can be disabled for some another user. So I need to enabled/disabled a field based upon the state of the field on the mainframe.

How do I know whether a particular field is enabled or disabled on the mainframe?  
Since I am using a path in order to collect the data from different screens, now after I have gone through different screens collecting the data and finally displaying the consolidated data how will I know whether a particular field was enabled/disabled?

Please help and please reply back if any more info is required.  
Thanks.

---

<div class="post-metadata">

**Author:** ![Arijit](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@Arijit](https://techcommunity.softwareag.com/u/Arijit)\
**Post date:** [August 7, 2009, 3:02pm UTC](https://techcommunity.softwareag.com/t/how-to-enable-disable-a-field-based-on-mainframe-behaviour/90903/2 "2009-08-07T15:02:48Z")

</div>

HI Pijus,

Assume there is a screen “ABCD” consists of 10 fields [5 protected, 5 unprotected].  
To find out which field is enable(unprotected)/disable(protected) do the following stuff inside “gx\_preRender” method of GXBasicContext. Or inside gx\_onInit() method of corresponding customized java ABCD.java.

///////////////////////////////////////

GXIFieldCollection coll = getGXSession().getScreen().getFields().getAppFields();

int count = coll.getFieldCount(),i=0;

while(i\<count){  
if(coll.getFieldAt(i).isProtected()){  
System.out.println(coll.getFieldAt(i).getName()+" is disable");  
}else {  
System.out.println(coll.getFieldAt(i).getName()+" is enable");  
}  
i++;  
}

///////////////////////////////////////

Thanks  
Arijit 😃

---

<div class="post-metadata">

**Author:** ![Gadi](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/gadi/32/16051_2.png) [@Gadi](https://techcommunity.softwareag.com/u/Gadi)\
**Post date:** [August 10, 2009, 5:21pm UTC](https://techcommunity.softwareag.com/t/how-to-enable-disable-a-field-based-on-mainframe-behaviour/90903/3 "2009-08-10T17:21:31Z")

</div>

Hi Kumar,

You have two options to get the field attribute data.  
Since last time we recommended you to use the “execute procedure

---

<div class="post-metadata">

**Author:** ![kumar\_piyus](https://avatars.discourse-cdn.com/v4/letter/k/c57346/32.png) [@kumar\_piyus](https://techcommunity.softwareag.com/u/kumar_piyus)\
**Post date:** [August 24, 2009, 4:50pm UTC](https://techcommunity.softwareag.com/t/how-to-enable-disable-a-field-based-on-mainframe-behaviour/90903/4 "2009-08-24T16:50:41Z")

</div>

Thanks Gadi,  
The option “Send To Base Object” is working great. One more thing that I noticed and wanted to share with you was that it not only enable’s or disable’s a field but it also retrieves the fields data and based upon the id it fills the data as well as enables and disables it.

What I wanted to know is what is the difference between retrieving data using “Screen Mapper

---

<div class="post-metadata">

**Author:** ![Gadi](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/gadi/32/16051_2.png) [@Gadi](https://techcommunity.softwareag.com/u/Gadi)\
**Post date:** [August 24, 2009, 7:14pm UTC](https://techcommunity.softwareag.com/t/how-to-enable-disable-a-field-based-on-mainframe-behaviour/90903/5 "2009-08-24T19:14:17Z")

</div>

Hi Kumar,

The general rule-of-thumb is to use the procedures (“Screen Mapper

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:57pm UTC](https://techcommunity.softwareag.com/t/how-to-enable-disable-a-field-based-on-mainframe-behaviour/90903/6 "2021-04-02T14:57:21Z")

</div>


