2

I have an if condition and I need to know how to show/hide the values of an attribute if the condition evaluates to true.

if mbo.getString("DSP_L_LGL_INT_IND")=="L" and mbo.getString("STATUS")!="Admin Error":
     mbo.getMboValue("INGRANTVIEW.LOCATION").setRequired(True)
     mbo.getMboValue("LOCATIONS.OPFAC").setRequired(True)
     mbo.getMboValue("LOCATION").setRequired(True)
     mbo.getMboValue("LOCATIONS.LO4").setRequired(True)

I know how to make a particular field required, but I cannot figure out how to show or hide a particular field value.

Nenna Anya
  • 67
  • 7

1 Answers1

3

Hiding a field has to be done from the UI; it can not be done through the business objects (MBOs).

At a high level: you will want to create a "Conditional Expression" for your case, then go into Application Designer for your app, create and attach a sigoption to the fields you want hidden, grant that sigoption to a group (maxeveryone is commonly used) then use the condition you created and finally specify a hide and show cnofiguration for the true and false outcomes, respectively (or you can swap that, depending on your condition).

There are also other, possibly preferred, ways to hide the field with Data Restrictions (globally or per security group). This IBM page gives a brief rundown on the options: https://www.ibm.com/support/pages/overview-conditional-ui-maximo-7

Dex
  • 1,241
  • 6
  • 13
  • If you grant it *conditionally* to maxeveryone, you don't have to mess with Configure Conditional Properties to specify "hide and show" configuration. If the condition is true then the sig option is granted and the field will show, otherwise it won't. Further, I suggest you go back to the Sig Option and clear the Visible flag after you grant it to maxeveryone, so some admin doesn't accidentally see it and ask questions or (worse) ungrant it or grant it unconditionally to a group besides maxeveryone. – Preacher Sep 18 '20 at 17:33