Topic
  • 6 replies
  • Latest Post - ‏2012-02-07T15:04:59Z by Bowser
paulwebb9
paulwebb9
9 Posts

Pinned topic Conditional expression, Data Restriction or another way?

‏2012-01-31T10:16:40Z |
Maximo 7.5 EAM on SQL Server 2008.

Can anyone point me in the right direction please?

I have created a new field in Work Order Tracking ("field1").

When the 'Work Type' is either "CM" or "EM" then we want "field1" to be mandatory (required).

When the 'Work Type' is "PM" then "feild1" is not mandatory (not required).

There is no change of Status.

Regards

Paul
Updated on 2012-02-07T15:04:59Z at 2012-02-07T15:04:59Z by Bowser
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Conditional expression, Data Restriction or another way?

    ‏2012-01-31T12:15:27Z  
    Hi

    you could use a Conditional Property for this in Application Designer

    1.) Add a new Sig Option (FIELD1MAND) to Workorder

    2.) Add a new Conditional Expression (FIELD1MANDEXP)
    :worktype in ('CM', 'EM')

    3.) Add the sigoption to FIELD1

    4.) Add the group you would want this to apply to (or EVERYONE if you want for all)

    5.) Add the new conditional expression
    Value if True

    inputmode

    required
    That should be it, then all other Work Types selected on screen including 'PM' will then render the field not required
  • paulwebb9
    paulwebb9
    9 Posts

    Re: Conditional expression, Data Restriction or another way?

    ‏2012-02-07T10:53:46Z  
    Hi

    you could use a Conditional Property for this in Application Designer

    1.) Add a new Sig Option (FIELD1MAND) to Workorder

    2.) Add a new Conditional Expression (FIELD1MANDEXP)
    :worktype in ('CM', 'EM')

    3.) Add the sigoption to FIELD1

    4.) Add the group you would want this to apply to (or EVERYONE if you want for all)

    5.) Add the new conditional expression
    Value if True

    inputmode

    required
    That should be it, then all other Work Types selected on screen including 'PM' will then render the field not required
    Euq,

    Thanks for the reply.
    Unfortunately when we apply the sigoption, the whole field just disappears!

    Regards

    Paul
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Conditional expression, Data Restriction or another way?

    ‏2012-02-07T11:07:47Z  
    • paulwebb9
    • ‏2012-02-07T10:53:46Z
    Euq,

    Thanks for the reply.
    Unfortunately when we apply the sigoption, the whole field just disappears!

    Regards

    Paul
    It is behaving normally, If you apply sigoption that object disappears. After applying this you need to go to the security settings select the group to which you want to give specific rights to view/update. You will be able to see the option under the application tab.
  • paulwebb9
    paulwebb9
    9 Posts

    Re: Conditional expression, Data Restriction or another way?

    ‏2012-02-07T14:55:44Z  
    It is behaving normally, If you apply sigoption that object disappears. After applying this you need to go to the security settings select the group to which you want to give specific rights to view/update. You will be able to see the option under the application tab.
    Jatin,

    Perfect, thank you
    That is the last bit of the puzzle we didn't add.

    Regards

    Paul
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Conditional expression, Data Restriction or another way?

    ‏2012-02-07T15:01:46Z  
    Go to --> Security Groups
    In "Data Restriction" tab --> "Attribute restrictions" tab
    Click on "New row" button and choose WORKORDER for Application, FIELD1 for Attribute; choose an application if you want the field to be mandatory only using it.
    Choose REQUIRED for Type and put the Condition you created in Conditional Expression Manager in Condition field.

    You should do this for each Group you want to be conditioned.
  • Bowser
    Bowser
    93 Posts

    Re: Conditional expression, Data Restriction or another way?

    ‏2012-02-07T15:04:59Z  
    Hi Paul,

    I think you have 4 options: Conditional UI, Data Restriction, an Automation Script and a Field Listener (Java). Personally, I don't like the Conditional UI option: I find it clumsy and unnecessarily complicated. And with the introduction of Automation Scripts, the need for Field Listeners largely goes away. That leaves Data Restrictions and Automation Scripts, of which a Data Restriction will be easier to implement and maintain and will perform faster than an Automation Script.

    Therefore, in your case, I would use a Data Restriction on the EVERYONE group. Data Restrictions always combine, even if security groups are marked as independent, so putting it on the EVERYONE group ensures that your REQUIRED Attribute Restriction is always applied. Before creating your Data Restriction, you will need to define a Conditional Expression which will be true (a where clause that will return data) when you want your attribute / field to be required. As you will be applying your restriction to the FIELD1 attribute of the WORKORDER object, and as the WORKORDER object holds "normal" work orders, child work orders and tasks / activities (among others), your Conditional Expression may need more to it than simply ":worktype in ('CM','EM')".

    Hope that helps.
    Bowser.