This is an archive of the Maximo Yahoo Community. The content of this pages may be a sometimes obsolete so please check post dates.
Thanks to the community owner Christopher Wanko for providing the content.
Hi All
First of all - apologies if this is a question that has been raised in the past - I am unable to access the archives at the moment.
All I want to do is hide the NEW ROW button in PR's when a PR is in workflow.
I have tried all sorts of expressions.
Ideally one would think the expression:
(not exists (select 1 from dbo.wfinstance where (ownertable = 'PR' and active = 1 and ownerid=:pr.prid)))
Would be all one would need.
In my case though this works fine for PR's where there is an existing PR line. - If the PR is in workflow the NEW ROW button is missing, If the PR is not in workflow the button is present - for records with at least one PR line.
The issue I am seeing is when there are no lines on the PR.
With the above expression the NEW ROW button is still missing - which is not the intent.
This stretches to creation of PR's as well - so with this restriction the user can create a PR - but not add lines.
This seems to be another of the situations where the conditional expression manager is not behaving like SQL. If I dump the expression
(not exists (select 1 from dbo.wfinstance where (ownertable = 'PR' and active = 1 and ownerid=pr.prid)))
into the where clause of the PR app it returns the records that I need the conditional expression manager allow the New Row button to show.
I am using Maximo 7.5.0.6 and have set a security control on the New row object in APP designer to manage button visibility.
I have tried a couple of options to try and add the results with no PR lines - but so far no luck.
Am I on the right track? Any suggestions please?
Regards
Michael
********************************************************************************************
Check out our web site: http://www.cdhb.health.nz
This email and attachments have been scanned for content and viruses and is believed to be clean This email or attachments may contain confidential or legally privileged information intended for the sole use of the addressee(s). Any use, redistribution, disclosure, or reproduction of this message, except as intended, is prohibited. If you received this email in error, please notify the sender and remove all copies of the message, including any attachments. Any views or opinions expressed in this email (unless otherwise stated) may not represent those of Canterbury District Health Board
********************************************************************************************
When does the PR go into Workflow? Immediately upon Save? If so, could you change your Workflow design to detect existence of PR Lines, such that if there are no Lines it exits the Workflow?
Otherwise, change your Conditional Expression to check for existence of PR Lines too.
Travis Herron
Hi Travis
The trigger for the PR to go into workflow is a separate toolbar button to the save. (This allows a requestor to partially prepare a PR and save so they can update before submitting for approval via workflow.) We are fine with most of the PR being editable up until the PR is approved - just do not want extra lines to be added by the approver. Dropping the New Row button from the approver if a record is in workflow seemed like the simplest option.
I have been trying to add an expression to check for existence of PR lines - where I seem to be coming adrift is where there are no lines at all - The null or no records seem to be where the condition is falling over. Whether trying to allow the button based on wfinstance or PRLINE appears to be behaving the same for PRs yet to get lines.
Regards
Michael
From: MAXIMO@yahoogroups.com [mailto:MAXIMO@yahoogroups.com]
Sent: Wednesday, 17 May 2017 12:58 a.m.
To: MAXIMO@yahoogroups.com
Subject: [MAXIMO List] Re: Conditional Expression Manager - when no values
When does the PR go into Workflow? Immediately upon Save? If so, could you change your Workflow design to detect existence of PR Lines, such that if there are no Lines it exits the Workflow?
Otherwise, change your Conditional Expression to check for existence of PR Lines too.
Travis Herron
What if you could make a check to see if the current user is the user that created the PR? If :user is the PR creator, New Row button is visible; otherwise, hidden. Surely that can be achieved by Relationships.
Alternatively, make another PR Status; I'll call it DRAFT. Make DRAFT the default status. While users are preparing the PR, it remains in DRAFT status. When they submit it for approval, they push the Route Workflow button, and you'll have to change your Workflow Design to have the first thing it does is a Status Change action to WAPPR. Then you hide the New Row button if Status != DRAFT.
---In MAXIMO@yahoogroups.com, <michael.stringer@cdhb.health.nz> wrote :
I have been trying to add an expression to check for existence of PR lines - where I seem to be coming adrift is where there are no lines at all - The null or no records seem to be where the condition is falling over. Whether trying to allow the button based on wfinstance or PRLINE appears to be behaving the same for PRs yet to get lines.
When in doubt, try to reverse the operation, i.e. instead of hiding sometimes, set it hidden all the time.
Then, create an expression to show only if NVL(COUNT(prlinenum),0) > 0
Then... keep modifying the expression. Come at it from another angle.
-C
Try
1 > (select count(*) from prline where prnum = :prnum and siteid = :siteid )
If true then no prlines exist else they do
Workflow does a save on start
Reds ian
Sent from my iPhone
> On 16 May 2017, at 22:05, Michael Stringer michael.stringer@cdhb.health.nz [MAXIMO] <MAXIMO@yahoogroups.com> wrote:
>
> Hi Travis
>
> The trigger for the PR to go into workflow is a separate toolbar button to the save. (This allows a requestor to partially prepare a PR and save so they can update before submitting for approval via workflow.) We are fine with most of the PR being editable up until the PR is approved - just do not want extra lines to be added by the approver. Dropping the New Row button from the approver if a record is in workflow seemed like the simplest option.
>
> I have been trying to add an expression to check for existence of PR lines - where I seem to be coming adrift is where there are no lines at all - The null or no records seem to be where the condition is falling over. Whether trying to allow the button based on wfinstance or PRLINE appears to be behaving the same for PRs yet to get lines.
>
> Regards
> Michael
>
> From: MAXIMO@yahoogroups.com [mailto:MAXIMO@yahoogroups.com]
> Sent: Wednesday, 17 May 2017 12:58 a.m.
> To: MAXIMO@yahoogroups.com
> Subject: [MAXIMO List] Re: Conditional Expression Manager - when no values
>
> When does the PR go into Workflow? Immediately upon Save? If so, could you change your Workflow design to detect existence of PR Lines, such that if there are no Lines it exits the Workflow?
>
> Otherwise, change your Conditional Expression to check for existence of PR Lines too.
>
> Travis Herron
>
>
>
>
>
>
Hi Ian Travis and Chris
Thank you for the suggestions
I have tried the following as the conditional expression.
(not exists (select 1 from dbo.wfinstance where (ownertable = 'PR' and active = 1 and ownerid=:pr.prid))) or (1 > (select count(*) from prline where prnum = :pr.prnum and siteid = :pr.siteid ))
It still works fine for the records where a line already exists – but is still hiding the button when no rows exist.
In the PR app the clause
((not exists (select 1 from dbo.wfinstance where (ownertable = 'PR' and active = 1 and ownerid=pr.prid))) or (1 > (select count(*) from prline where prnum = pr.prnum and siteid = pr.siteid )))
Still brings the population of records I would expect the conditional expression to be true for and grant access for the New Row signature option.
I have tried Travis’s suggestion to control visibility based on the creator of the PR. I was holding off on that limitation. As long as the approver is not adding lines it is ok for multiple team members to add rows to build up the PR. (Or if an approver stops the approval process then it is fine for them to add lines – when the PR is resubmitted for approval it will go the next level up for approval).
The conditional expression I have tried is “&PERSONID& = :REQUESTEDBY” This is working fine for PR records that have a line in them – but is still not showing the button if there are no PR lines.
I also like the thought of reversing the logic on the condition as suggested. Maybe I am going about it the wrong way – but the method I have used to control visibility of the button by creating the signature option and controlling it in the security group seems to default to the button being hidden unless the signature option is granted. In our instance I have not found an option to say that if a signature option is true, hide the button.
I have finally checked the behaviour for a user with no condition on the security option to show the button without any conditional expression clause and found the button is missing if no lines are present – Should have checked this earlier!
It appears as soon as the signature option is added to the addnew button the functionality fails for records without or yet to get lines.
Back to the drawing board.
Regards
Michael
From: MAXIMO@yahoogroups.com [mailto:MAXIMO@yahoogroups.com]
Sent: Thursday, 18 May 2017 5:54 a.m.
To: MAXIMO@yahoogroups.com
Subject: Re: [MAXIMO List] Re: Conditional Expression Manager - when no values
Try
1 > (select count(*) from prline where prnum = :prnum and siteid = :siteid )
If true then no prlines exist else they do
Workflow does a save on start
Reds ian
Sent from my iPhone
> On 16 May 2017, at 22:05, Michael Stringer michael.stringer@cdhb.health.nz<mailto:michael.stringer@cdhb.health.nz> [MAXIMO] <MAXIMO@yahoogroups.com<mailto:MAXIMO@yahoogroups.com>> wrote:
>
> Hi Travis
>
> The trigger for the PR to go into workflow is a separate toolbar button to the save. (This allows a requestor to partially prepare a PR and save so they can update before submitting for approval via workflow.) We are fine with most of the PR being editable up until the PR is approved - just do not want extra lines to be added by the approver. Dropping the New Row button from the approver if a record is in workflow seemed like the simplest option.
>
> I have been trying to add an expression to check for existence of PR lines - where I seem to be coming adrift is where there are no lines at all - The null or no records seem to be where the condition is falling over. Whether trying to allow the button based on wfinstance or PRLINE appears to be behaving the same for PRs yet to get lines.
>
> Regards
> Michael
>
> From: MAXIMO@yahoogroups.com<mailto:MAXIMO@yahoogroups.com> [mailto:MAXIMO@yahoogroups.com]
> Sent: Wednesday, 17 May 2017 12:58 a.m.
> To: MAXIMO@yahoogroups.com<mailto:MAXIMO@yahoogroups.com>
> Subject: [MAXIMO List] Re: Conditional Expression Manager - when no values
>
> When does the PR go into Workflow? Immediately upon Save? If so, could you change your Workflow design to detect existence of PR Lines, such that if there are no Lines it exits the Workflow?
>
> Otherwise, change your Conditional Expression to check for existence of PR Lines too.
>
> Travis Herron
>
>
>
>
>
>
Let's forget the NULL / IS NULL part for a second.
You can reliably hide that button for cases where prlines exist and do not? If not, let's work with a simpler conditional expression, like a default site equal to something. This is something any logged-in user can change.
Once you can reliably flick it on and off, we've got it.
-C