Solved

FSM: How do i set default values in screen TIMESEARCH

  • 6 August 2020
  • 3 replies
  • 217 views

Userlevel 1
Badge +6

In FSM TIMESEARCH screen,  I would like to set a default value of the logged in user to the search field NON_PART_USAGE.MANAGER_PERSON_ID.

 

I have created a client script to do the job thats uses the SetControlValue function, but the value is not set on the screen.

 

The SetControlValue always returns ‘False

 

Here is the script used:

var MgrPersonID = getControlValue('NON_PART_USAGE','MANAGER_PERSON_ID');
returnvalue=true;
if (MgrPersonID == '')
    {
    MgrPersonID = getUserInfo('PersonID');
    alert('Set person id to default ' + MgrPersonID);
    }
    
var returnvalue = setControlValue('NON_PART_USAGE','MANAGER_PERSON_ID',MgrPersonID);

alert(returnvalue
);

icon

Best answer by BertelLundgaard 14 September 2020, 13:37

View original

3 replies

Userlevel 1
Badge +3

Quick Search does not pass in the values into the search fields.  That is how it is currently designed.  That is also why the user can use “details” to see what values were used.

 

Userlevel 1
Badge +3

Create a person alias in meta data, like PERSON_MGR, then add relationship  from person alias to NPU based on persons manager to person id in UI and add field to  person manager to search.  then add quick search and user variable of person_id when setting the search constraint for the persons manager

Userlevel 1
Badge +6

Hi

 I made it work, thanks. :-)

 

I am still wondering, even if the default quicksearch is set as default (and displaying the correct rows) when entering the screen, the fields used in the quicksearch is not reflected on the search panel of the screen (f.ex person_mgr.person_id). Would you know why this is the case?

(I just realized it is the same under other screens as well, f.ex. project screen...)

Reply