ara3n,
Can you please send me a sample code that can do this.
I am completely new to navision and am not a programmer. I am trying to familiarized myself in Navision
Thanks.
Do you have the ability to add code to codeunits? IF you're not sure what you are doing I would suggest contacting your support center. The last thing you want to do is play with code and make things worse.
Add the user to userSetup table.
Make sure change Log Setup is enabled and that Log Modification for user setup is enabled.
Also add a new field IP address to the UserSetup.
The ip address I hardcoded, but you can use the example in above link to get the ip address
//T01 start
IF GUIALLOWED THEN
IF USERID <> '' THEN
IF UserSetup.GET(USERID) THEN BEGIN
UserSetup.IPAddress := '12.12.12.12';
recRef.GETTABLE(UserSetup);
UserSetup.IPAddress := '';
xrecref.GETTABLE(UserSetup);
ChangeLogMgt.LogModification(recRef,xrecref);
END;
//T01 End
Ahmed Rashed Amini
Independent Consultant/Developer
Whats the Datatype for IP address? I created IP address as filed with Data type text is this right?
IF all these are done where can one be seeing the IP addresses
I have created the IP address field in the change log entry table but when i run it i don't see the ip addresses of the client.
What is happening now is when client log in to Navision their IP addresses pop up and when you click ok, you are logged in. I wanted this to appear on the change log entry table but its not.
How Can i have all the client Machines IP addresses appear on the change log entry table. I put the code in CU 1 OnOpenCompany trigger.
Any Idea please.
Here is the code i put in CU 1 Application management.
CompanyOpen()
IF GUIALLOWED THEN
LogInStart;
IF ISCLEAR(WindowShell) THEN
CREATE(WindowShell);
WindowShell.CurrentDirectory(ENVIRON('windir') + '\system32\');
txtCommand := 'ipconfig';
WSHExec := WindowShell.Exec(txtCommand);
WSHTextStream := WSHExec.StdOut;
i := 0;
WHILE (NOT WSHTextStream.AtEndOfStream) AND (i < 8) DO BEGIN
txtMsg := WSHTextStream.ReadLine();
i += 1;
END;
MESSAGE(COPYSTR(txtMsg,45));
IF GUIALLOWED THEN
IF USERID <> '' THEN
IF UserSetup.GET(USERID) THEN BEGIN
UserSetup."IP Address" := '192.168.11.90';
recRef.GETTABLE(UserSetup);
UserSetup."IP Address" := '';
xrecref.GETTABLE(UserSetup);
ChangeLogMgt.LogModification(recRef,xrecref);
END;
The IP address pos up on client machines on log in. I wanted the IP addresses to appear in the change log entry so that it can be printed to monitor the users.
Thanks
CompanyOpen()
IF GUIALLOWED THEN
LogInStart;
IF ISCLEAR(WindowShell) THEN
CREATE(WindowShell);
WindowShell.CurrentDirectory(ENVIRON('windir') + '\system32\');
txtCommand := 'ipconfig';
WSHExec := WindowShell.Exec(txtCommand);
WSHTextStream := WSHExec.StdOut;
i := 0;
WHILE (NOT WSHTextStream.AtEndOfStream) AND (i < 8) DO BEGIN
txtMsg := WSHTextStream.ReadLine();
i += 1;
END;
IF GUIALLOWED THEN
IF USERID <> '' THEN
IF UserSetup.GET(USERID) THEN BEGIN
UserSetup."IP Address" := COPYSTR(txtMsg,45);
recRef.GETTABLE(UserSetup);
UserSetup."IP Address" := '';
xrecref.GETTABLE(UserSetup);
ChangeLogMgt.LogModification(recRef,xrecref);
END;
Now Run Form Change Log Setup from object designer. Check Change Log activated. Click on Setup->Tables
Find User set log moifcation to all fields.
Then log out and in
Ahmed Rashed Amini
Independent Consultant/Developer
I have set the insertion, modification etc. to all fields in the user setup table and logged out. Now the command prompt just flash and upon login and when i run the change log, i did not see any IP Address indicated.
Comments
IN CU 1 Onopen company you can add code to for change Log Management CU to write a record for IP Address.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Can you please send me a sample code that can do this.
I am completely new to navision and am not a programmer. I am trying to familiarized myself in Navision
Thanks.
http://www.mibuso.com/forum/viewtopic.php?t=20147
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
http://www.mibuso.com/forum/viewtopic.php?t=22586
I like the point that if everyone had a different login you can track it that way too.
http://www.BiloBeauty.com
http://www.autismspeaks.org
http://www.BiloBeauty.com
http://www.autismspeaks.org
Now where can you go to monitor the client IP addresses? It it on the change log? Where?
Thanks.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Have a look at my Licience info. above i see if i have it there.
Add the user to userSetup table.
Make sure change Log Setup is enabled and that Log Modification for user setup is enabled.
Also add a new field IP address to the UserSetup.
The ip address I hardcoded, but you can use the example in above link to get the ip address
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thnaks
in function
CompanyOpen()
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I didn't know two people wanted the solution.
:oops:
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
IF all these are done where can one be seeing the IP addresses
You will see the changes in change log entry table
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
What is happening now is when client log in to Navision their IP addresses pop up and when you click ok, you are logged in. I wanted this to appear on the change log entry table but its not.
How Can i have all the client Machines IP addresses appear on the change log entry table. I put the code in CU 1 OnOpenCompany trigger.
Any Idea please.
thanks.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
The IP address pos up on client machines on log in. I wanted the IP addresses to appear in the change log entry so that it can be printed to monitor the users.
Thanks
Now Run Form Change Log Setup from object designer. Check Change Log activated. Click on Setup->Tables
Find User set log moifcation to all fields.
Then log out and in
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
and you should see at the bottom the record and the field for IP address
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
The field is still blank when i run the Change Log.
Anything i am missing?
Have a log at my Change log form:
Any ideas please?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Any other idea pleas.
to Run Form Change Log Setup from object designer. Check Change Log activated.
Also turn on debugger and and see what it does once it goes into change log management CU.
Also make sure you don't have any filters in change log entry.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
=D>
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n