Dwallace
6th March 2004, 17:21
Is there a standard Baan function (IVc4) to obtain the user's default spool.device?

I'm using api commands and would like to feed in the default so no user interaction is required.

Denise

Hitesh Shah
8th March 2004, 07:30
According to me there is no such function. U may have to check ttaad306 and ttadv990 in 0 company .

DStroud
8th March 2004, 21:37
You can get the user default Device by doing the following:

1. Add table tttaad306 (Device Preference)
2. Add the following function

function get.default.device()
{
domain tcmcs.str12 login.id
login.id = logname$

select ttaad306.*
from ttaad306
where ttaad306._compnr = 000
and ttaad306.user = :login.id
and ttaad306.sesq = 1
as set with 1 rows
selectdo
selectempty
ttaad306.devc = "D60"
endselect
}

Dwallace
8th March 2004, 21:55
Thanks - I will follow the long way - I was hoping there was some tools function I could just run. Wishful thinking I guess.

Denise

NPRao
8th March 2004, 22:08
Denise,

I think ttaad306 - Device Preferences gives the info if the device preferences template is set on the User Data.

You need to query the tools table ttadv990 - User Defaults for the login and the session code - ttstpsplopen

string usrdvc(256)
select ttadv990.*
from ttadv990
where ttadv990._index1 = {:logname$, 000, "ttstpsplopen", 000, ttyeno.no }
and ttadv990._compnr = 000
as set with 1 rows
selectdo
usrdvc = ttadv990.rcrd
selectempty
usrdvc = ""
endselect

Process the field - ttadv990.rcrd to get the device name.
Make sure to add the device validation checks using tt.device().
I'm using api commands and would like to feed in the default so no user interaction is required.
Additional check - AFS/API does not take the "D" - Display device.