Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #1 
It has been (and continues to be) suggested that you can hide fields at stages (most usually buttons) by using a calculated field with the value "%Action.Name". The theory is that this field will only be shown when the Folder is in an action.

That is true, but extremely misleading. %Action.Name will not be empty if the Folder is being editing by any user, not just the user viewing the form. Futhermore, if anyone starts an action and closes the Folder by any means except the 'Cancel' button (closing the PC down, pressing the top right corner 'x', Ctrl-F4, for example), then %Action.Name will always be filled until an action is cancelled or committed.

This is probably not what you wanted to happen, and not what the advice to use %Action.Name implies.

In v6 you can use "%User.Form" in the field, and make sure the field is  is not set to 'being dependent'. This is because of a little known bug where %User.Form is not filled until after a form refresh at a stage.

In v7 this has been fixed, so it is a little more difficult. The only suggestion I have now is to put the following as the formaula for the field:
Quote:
%SelectSQL("SELECT 'x' FROM eFolder WHERE eFolderID='%FolderID' AND eActionUser='%User.Name'")


__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
Rick

Avatar / Picture

Senior Veteran
Registered:
Posts: 259
Reply with quote  #2 

Thanks, Jerome. I have used %action.name as a 'hider' in several places and was unaware of this.

 

Perhaps we should request an enhancement for a 'Hide at Stage' property on each field...?

 

The only other solution which I have begun to use where I have several, or large, fields which I want to hide (such as grids, buttons etc) is to have two almost identical forms - one displayed at stages and the other used on actions.

 

Rick.

 


__________________

Another full day of doing nothing but rearranging zeros and ones. :)
You know it will be a good day when there is no human interaction on the schedule.

0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #3 
If you ever get a sensible response to any enhancement request, I'd love to know....

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
tobsey

Member
Registered:
Posts: 31
Reply with quote  #4 
The issue of Action.Name being populated when any user is performing an action also causes a problem if the stage form and action form are opened at the same time. If you open a folder and the first tab is a form called MyMainForm. Then you perform an action that uses MyMainForm also, the field that you use for visibility dependencies will be set and your action only controls will become visible.

However the folder is still open behind the action window. If you then change to a different tab in the folder and then change back to MyMainForm, the action only fields will be displayed in the folder window.

A nice and dirty solution is to use the following script:

function MyMainFormOnLoad()
{
if (/eactionformcontents\.ashx/g.test(document.URL))
{
  SetIsAction();
}    
}

function SetIsAction()
{
    eworkSetField("IsAction", "", "True");
}


Metastorm use handler pages to load the form contents into an iframe that takes up the whole of the window. For folder pages, it uses efolderformcontents.ashx. For action pages, it uses eactionformcontents.ashx. Therefore this test above does a regex test on the url of the current page. Because the script runs in the iframe, the document url will be one of the following:

http://MyMetastormServer/Metastorm/efolderformcontents.ashx?FolderId=000.......

http://MyMetastormServer/Metastorm/eactionformcontents.ashx?FolderId=000.......

The test above ensures that the IsAction field is only set when a user is performing an action.

The obviously comes with the usual caveat that if Metastorm change stuff etc. it will stop working but I'm not too worried about that. If you wanted to be overly cautious you could put the regex in a configuration table and then load it into a field on your form and then use that value to create a regex in script and do your test.
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #5 
This was quite an old post. We now have functions and checkbox fields in form segments in our libraries both for version 7 and version 9 that manage this.
__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!