Project and Portfolio Management Practitioners Forum
cancel

Need explanation on UI rules

SOLVED
Go to solution
Highlighted
Shiwan
Respected Contributor.

Need explanation on UI rules

Hi,

 

I am using UI rule setfieldrequired(true) in following scenario.

 

There are fields ABC and XYZ, I want in dependencies section ABC is NULL, Status = Active (Lite)... Rules are on page load and field change event...

 

Per dependencies XYZ should get required.

 

I have implemented the same and able to get XYZ as required per dependencies.

 

Issue that I am facing is, if I am not putting any value in XYZ field and try to process the request further or saving it, system allows me to do so but it should not happen because we have XYZ field as required and if it is blank, I should not be able to save it or process the request.

 

Any idea, why it is happening? Am I missing something?

 

Please advise.

9 REPLIES
kwood55
Honored Contributor.

Re: Need explanation on UI rules

Hard to say why the dependency NULL does not seeem to trigger fieldrequired.

 

You could try this:

 

rule x      - Set Field to required (no matter what)

ruleX+1 - Based on dependencies set field to not required.

 

Do not even test for NULL in your rules.

Shiwan
Respected Contributor.

Re: Need explanation on UI rules

Thank you for your response.

 

Just to update you that field is getting required if I am passing NULL in dependency field (ABC) but if I do not fill any value for REQUIRED field XYZ (Field got required per rule) and try to save or process the request further, system allows me to do so but IT SHOULD HAPPEN AND SYSTEM SHOULD THROW A MESSAGE TO FILL REQUIRED FIELD VALUE.

 

Hope you are clear on my doubt. Please advise if it is an expected behavior or I am doing something wrong.

 

Thanks,

Shiwan

kwood55
Honored Contributor.

Re: Need explanation on UI rules

Ok, the NULL dependency works for the ABC field but not the XYZ field. Assume you have a configuration error.

1) Are the validations for ABC and XYZ the same (the same data types) ?

2) Make sure the XYZ rule is enabled

3) Make sure all previous rules have "Process subsequent rules?" set to Y.

4) In the Fields tab press Edit for the XYZ field, then select the Default tab.

     Make sure there is not an accidental space set as the default.

5) Make sure the rule for XYZ is set to UI Rules and not SQL Default.

6) Check the UI rules name again. setFieldRequired(false) and setFieldRequired(true).

7) Inspect the error log for any errors. There are two PPM and background.

8) If XYZ is getting set to required you should see an asterisk before the field. (When running).

     Make sure you do not see this. (It should not since it is failing for NULL.

9) Open both rules, take screen shots and attach both as jpg files.

 

 

Shiwan
Respected Contributor.

Re: Need explanation on UI rules

Hi,

 

It seems like I didn't explain my issue properly. Let me start it again.

 

I have created two rules, RULE1 and RULE2. RULE1 works on FIELD CHANGE EVENT and RULE2 works on PAGE LOAD EVENT. See attached for description.

 

In RULE1, I have mentioned three fields in dependency section and applying UI RULE SETFIELDREQUIRED(true) so field mentioned in RESULT section should get REQUIRED.

 

Same thing I am doing in RULE2 but here it is on PAGE LOAD EVENT.

 

Both the rules are working fine for RESULT field and field mentioned in RESULT FIELDS section is getting required (able to see * along with field).

 

Issue is : If I am not filling any value for RESULT FIELD i.e. Policy 564  Architecture & Significance and trying to save the request or process the request to further status, system should not allow me to process further and should throw message to fill value for  Policy 564  Architecture & Significance required field but I am not getting any message and able to save the request or process the request to further status. Any idea WHY?

 

Thanks,

Shiwan

kwood55
Honored Contributor.

Re: Need explanation on UI rules

Pictures are worth a thousand words....

 

I had a rule with multiple dependencies and it behaved odd.

Go ahead and break them out and test one at a time.

 

Start with:

Rule X       - On page load set Result to NOT required (no matter what)

Rule X+1 -  On field change if Phase=2 set Result to required.

If this works then add your next field change rule

Rule X+2 - On field change if Status='Active (Lite)' set Result to required

If this works then add your next field change rule.

 

It is tedious, but by breaking it out you may find the underlying problem.

 

kwood55
Honored Contributor.

Re: Need explanation on UI rules

I have many request types and many rules.

Looking back at my rules it appears I just started treating multiple dependencies as ANDs:

 

(Phase = Phase 2) AND (Architecture=null) AND (Status=Active (Lite))
Thus, each of these must be true.

 

It is not OR.

Shiwan
Respected Contributor.

Re: Need explanation on UI rules

It is not working with NULL so I am now raised it with RnD team.

kwood55
Honored Contributor.

Re: Need explanation on UI rules

Using PPM 9.12 I have a Rule with a dependency "is null". See attached.

It seems to work.

Shiwan
Respected Contributor.
Solution

Re: Need explanation on UI rules

My issue is resolved. I came to know that problem doesn't occur when I use NULL but in my system there are other rules which are creating problem and contradicting.

 

Thank you so much for your help.