Session table is a virtual table that also has a different view for Native and SQL Navision.
How to organize work with this table to determine what type of connection current user has.What mistake i do in code?
//Sessin - recordref,MySession,AuthType - fieldrefs.
Session.OPEN(2000000009,FALSE);
MySession := Session.FIELD(SessionRec.FIELDNO("My Session"));
AuthType := Session.FIELD(SessionRec.FIELDNO("Login Type"));
MySession.SETFILTER('YES');
Session.FINDFIRST;
IF FORMAT(AuthType.VALUE) = 'Database' THEN
MESSAGE('database') ELSE
MESSAGE('Windows');
0
Comments
in string you put <,>,= etc....
you should do something like this or
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Session.OPEN(2000000009,FALSE);
Session.RESET;
MySession := Session.FIELD(SessionRec.FIELDNO("My Session"));
AuthType := Session.FIELD(SessionRec.FIELDNO("Login Type"));
MySession.SETFILTER('YES');
Session.FINDFIRST;
IF FORMAT(AuthType) ='Database' THEN
IF sessionRec.FIND('-') THEN BEGIN
IF sessionRec."Login Type" = sessionRec."Login Type"::Windows THEN
BEGIN
lv_WindowsAccessControl.SETRANGE(lv_WindowsAccessControl."Login ID",sessionRec."User ID");
lv_WindowsAccessControl.SETRANGE(lv_WindowsAccessControl."Role ID",'ITEMMGR');
IF NOT(lv_WindowsAccessControl.FINDFIRST) THEN
CurrForm.Obsolete.EDITABLE(FALSE);
END
ELSE
BEGIN
GVMemberOf.SETRANGE(GVMemberOf."User ID",sessionRec."User ID");
GVMemberOf.SETRANGE(GVMemberOf."Role ID",'ITEMMGR');
IF NOT(GVMemberOf.FINDFIRST) THEN
CurrForm.Obsolete.EDITABLE(FALSE);
END;
END;
i read the help partially
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog