Absent Member.
Absent Member.
8389 views

Is there a field attribute that TeamScript can manipulate to toggle field visibility and/or ReadOnly?


Question posted 11/17/09 by Kelvin Haga
Details:

I'm trying to determine if there is a field property that TeamScript can access to toggle the "Hidden" and/or the "ReadOnly" attributes. I would like to be able to toggle both for all field types (e.g., User, Single-, Multi-, Selection, Single-, Multi-, Relational, Numeric, etc.) via a script.

0 Likes
10 Replies
Highlighted
Absent Member.
Absent Member.

Re: Is there a field attribute that TeamScript can manipulate to toggle field visibility and/or ReadOnly?


Comment posted 11/17/09 by Greg Walters

Kelvin,
Remember that TeamScript/MashupScript is a server side scripting language for TeamTrack/Serena Business Mashups. These scripts run on the server before/after a transition starts/finishes and not in the user's browser. These scripts have control over the transition forms and contents. The URL context scripts can, and usually do, generate HTML, but they have to generate everything (<html> to </html>).
In Serena Business Mashups 2008 R2 we included some JavaScript functions that you can use in custom forms to hide and set to read-only fields on the form. You have to attach your own scripts to the form and access these functions to perform what you want to do.
I hope this helps.
Greg

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Is there a field attribute that TeamScript can manipulate to toggle field visibility and/or ReadOnly?


Comment posted 11/17/09 by Kelvin Haga

Yes, thanks, that does help. I was hoping that there was a property or a field in the database related to a specific Project that could be manipulated to temporarily or permanently alter the target attributes. I appreciate the response.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Is there a field attribute that TeamScript can manipulate to toggle field visibility and/or ReadOnly?


Comment posted 11/18/09 by Brian Rosenberger

Hi,
to do this permantly have a look at the TS_PROPERTIES table. This table stores field properties per context (transition, project, etc.). Beware that manipulating system tables may be harmfull to your system.
Brian

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Is there a field attribute that TeamScript can manipulate to toggle field visibility and/or ReadOnly?


Comment posted 11/18/09 by Kelvin Haga

I will check that out, thank you (and for the warning...)

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Is there a field attribute that TeamScript can manipulate to toggle field visibility and/or ReadOnly?


Comment posted 11/18/09 by Paul Thompson

Do you want to hide or disable all fields, or all fields of a specific type?

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Is there a field attribute that TeamScript can manipulate to toggle field visibility and/or ReadOnly?


Comment posted 11/18/09 by Kelvin Haga

We would like to toggle specific fields without regard for a common characteristic.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Is there a field attribute that TeamScript can manipulate to toggle field visibility and/or ReadOnly?


Comment posted 11/20/09 by Paul Thompson

As noted above, check tables ts_properties and ts_fields. To re-inforce Greg's comment, if you make changes via a script in a transition or state context, they will not be applicable to that transaction, and probably not for some time afterwards (your server refresh interval). If you are trying to dynamically enable or disable fields during a transition, you'll have to JavaScript it.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Is there a field attribute that TeamScript can manipulate to toggle field visibility and/or ReadOnly?


Comment posted 11/23/09 by Kelvin Haga

All responses truly appreciated. Thank you. I believe we understand our situation and the additional motivation to upgrade.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Is there a field attribute that TeamScript can manipulate to toggle field visibility and/or ReadOnly?


I am trying to find the scripting commands for this - do you happen to know them?
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Is there a field attribute that TeamScript can manipulate to toggle field visibility and/or ReadOnly?


I need to make fields read-only if a condition is met (or vice versa make them writable if an opposite condition is met). I check the field value via a teamscript (R301) and if ok the user is required to update other fields. The default is writable and required. But if a condition is met, I wanted to stop the transition and not allow them to update the fields. I stop it via a shell.redomessage. I though making them read-only would do it. Any other suggestions?
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.