mibuso.com

Microsoft Business Solutions online community
It is currently Fri May 24, 2013 1:59 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [Solved] Customized code in Codeunit 1
PostPosted: Tue Jan 31, 2012 4:51 pm 
Offline

Joined: Thu Sep 09, 2004 2:04 pm
Posts: 1029
Location: Switzerland
Country: Switzerland (ch)
Hello
We have a strange behaviour in Codeunit 1.
Code: Select all
Function LoginStart:
IF GUIALLOWED AND NOT ISSERVICETIER THEN BEGIN
  //something
end;


This works like charm but if a classic report without rtc layout is started in rtc then "something" should not run. Any ideas how to change the code?
Btw: The "something" is a modal form that shows db name, servername, etc.
Thanks in advance.
Thomas


Last edited by ta5 on Wed Feb 01, 2012 10:01 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Tue Jan 31, 2012 5:15 pm 
Offline

Joined: Mon Sep 08, 2008 10:25 am
Posts: 486
Location: Switzerland
Country: Switzerland (ch)
Made a short test, when the classic client is loaded for report displaying of not converted reports, the Application Name in the session table shows: "111"
So maybe you could get your session record (set filter to "My Session" = true) and check if appliation name = '111'

_________________
My Blog


Top
 Profile  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Tue Jan 31, 2012 5:26 pm 
Offline

Joined: Thu Sep 09, 2004 2:04 pm
Posts: 1029
Location: Switzerland
Country: Switzerland (ch)
Hi Dev.CH
Thanks for reply. Good point, I already knew that, but for different reasons I'd rather would not use session table (problems in some versions if user has only rights for some companies)...
Any other ideas?
Thanks
Thomas


Top
 Profile  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Tue Jan 31, 2012 5:27 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4226
Location: New Delhi
Country: India (in)
may i know what is your requirement?

If you want to show server name and database name..you can use system indicator functionality in NAV 2009 R2..

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Tue Jan 31, 2012 5:41 pm 
Offline

Joined: Thu Sep 09, 2004 2:04 pm
Posts: 1029
Location: Switzerland
Country: Switzerland (ch)
mohana_cse06 wrote:
may i know what is your requirement?

If you want to show server name and database name..you can use system indicator functionality in NAV 2009 R2..

good point, but system indicator is for rtc only, isnt't it?


Top
 Profile  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Tue Jan 31, 2012 5:46 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Tue Sep 02, 2008 8:37 am
Posts: 4226
Location: New Delhi
Country: India (in)
ta5 wrote:
mohana_cse06 wrote:
may i know what is your requirement?

If you want to show server name and database name..you can use system indicator functionality in NAV 2009 R2..

good point, but system indicator is for rtc only, isnt't it?


yes..exactly

_________________
-Mohana
http://mibuso.com/blogs/mohana
http://mohana-dynamicsnav.blogspot.in/


Top
 Profile  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Tue Jan 31, 2012 5:48 pm 
Offline

Joined: Mon Dec 20, 2010 10:25 am
Posts: 531
Location: Bergamo
Country: Italy (it)
ta5 wrote:
good point, but system indicator is for rtc only, isnt't it?

You're right. System Indicator will work only for RTC.
Which build of Nav are you using?

_________________
~Rik~
It works as expected... More or Less...


Top
 Profile E-mail  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Tue Jan 31, 2012 5:51 pm 
Offline

Joined: Thu Sep 09, 2004 2:04 pm
Posts: 1029
Location: Switzerland
Country: Switzerland (ch)
Troubles In Paradise wrote:
ta5 wrote:
good point, but system indicator is for rtc only, isnt't it?

You're right. System Indicator will work only for RTC.
Which build of Nav are you using?

2009R2 Build 32012


Top
 Profile  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Tue Jan 31, 2012 5:51 pm 
Offline

Joined: Thu Sep 09, 2004 2:04 pm
Posts: 1029
Location: Switzerland
Country: Switzerland (ch)
Btw: Why does IsServiceTier does not help?


Top
 Profile  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Tue Jan 31, 2012 6:12 pm 
Offline

Joined: Thu Oct 30, 2008 10:38 am
Posts: 987
Location: Earth
Country: Netherlands (nl)
Because classic reports run on rtc, but don't fall under "isservicetier"

_________________
|Pressing F1 is so much faster than opening your browser|
|MCBMSS: 5.0 intro|MCTS:NAV09 839..841|JetReports© Certified Specialist|
|Dynamics Anywhere: Mobile Business Solutions|


Top
 Profile  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Tue Jan 31, 2012 10:52 pm 
Offline
Site Admin
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Sun Nov 07, 1999 8:01 am
Posts: 3294
Location: Wilrijk
Country: Belgium (be)
Maybe someone from MS can comment:
a) why Application Name in the Session table is set to '111', when executed through RTC to run classic reports
b) is there another way to distinguish if LoginStart in Codeunit 1 is executed through RTC to run classic reports

_________________
No support using PM or e-mail - Please use this forum.
Search is your friend || Mark your Topic as SOLVED (= green checkmark) when your question is answered || Read the Forum Rules before making a posting

»»» Mark your calendar: NAV TechDays 2013 - 7 & 8 November 2013 ««« Visit the conference website: www.navtechdays.com


Top
 Profile  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Wed Feb 01, 2012 8:56 am 
Offline

Joined: Mon Sep 08, 2008 10:25 am
Posts: 486
Location: Switzerland
Country: Switzerland (ch)
Hmm have you tried to add permission at the object level to ensure session table is accessible?

_________________
My Blog


Top
 Profile  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Wed Feb 01, 2012 9:05 am 
Offline

Joined: Thu Sep 09, 2004 2:04 pm
Posts: 1029
Location: Switzerland
Country: Switzerland (ch)
deV.ch wrote:
Hmm have you tried to add permission at the object level to ensure session table is accessible?

I'll try, but as said before, my primary goal was not to use session at all, because it's a special table and generally not used similar on all versions and platforms.
Thomas


Top
 Profile  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Wed Feb 01, 2012 9:15 am 
Offline

Joined: Mon Sep 08, 2008 10:25 am
Posts: 486
Location: Switzerland
Country: Switzerland (ch)
Yeah i understand that, but i guess since your request ist very special, you can be happy that there is at least ONE way to do this. But who knows...

_________________
My Blog


Top
 Profile  
 
 Post subject: Re: Customized code in Codeunit 1
PostPosted: Wed Feb 01, 2012 10:00 am 
Offline

Joined: Thu Sep 09, 2004 2:04 pm
Posts: 1029
Location: Switzerland
Country: Switzerland (ch)
It works like this:
Code: Select all
Session.SETRANGE("My Session",TRUE);
Session.FINDFIRST;
IF Session."Application Name" = '111' THEN
  EXIT;


Thanks for all of the contributions
Thomas


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: