User Running NAS

LnZ
Member Posts: 37
Hi, I'm trying to save the User Id of the user running NAS on insert and modify triggers on a table field.
I use this simple code
Anyone had the same problem?
How I can view the content of a global variable like USERID?
Thanks for your help
I use this simple code
FIELD:=USERIDbut it seems to work only on the insert trigger.
Anyone had the same problem?
How I can view the content of a global variable like USERID?
Thanks for your help
0
Answers
-
It works also on the OnModify-trigger, but of course the trigger must be launched.
In code this only happens by doing a INSERT(TRUE) or MODIFY(TRUE). If you don't specify TRUE or specify FALSE, the triggers are not launched.
To show USERID:
MESSAGE('USERID=%1',USERID);
If you put it in the NAS (and the NAS is a service), you will find this message in the eventlog of Windows.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
I'm looking at the code at the Web application and it calls all th triggers with NAS using TRUE.
Maybe there is an error in the XML passed to NAS.
Thank You for yor reply0 -
That code works wherever you write it. Of course to see the user id the code has to be executed first
.
You probably already know this, it is not enough to write "Field := USERID", you also have to MODIFY the record for the value to be written to the database.0 -
Yes that is obviously, it was a only a problem of object cache.
Solved it setting the cache to zero.
Thanks to all for the help0 -
LnZ wrote:Yes that is obviously, it was a only a problem of object cache.
Solved it setting the cache to zero.
Thanks to all for the helpRegards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
The object cache was the one of the web applcation and NAS service, yes it slow down everything but since I'm developing on it I need to set it like this for testing.
When the development is finished everything came as normal.0 -
You know you don't need to set the object cache to 0 if the problem that you are having relates to NAS not picking up new development. What you need to do is restart NAS every time you save objects and it will pick up the new version. It works the same as a regular NAV client.
For development purposes though you should consider running your NAS code from a regular client for testing and using NAS itself only when you reach milestones in your development.0 -
You are completely right but at the time of the test on the server there wasn't a client for running the NAS manually.
I will follow your directions and install one for testing purpose.
It is my fault that I didn't explained the architecture in advance.
Sorry
Thanks for your help0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions