NetTalk Central

Author Topic: Identify from which location a record is saved  (Read 3187 times)

HPabon

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Email
Identify from which location a record is saved
« on: December 31, 2014, 09:41:35 AM »
Hi,

I have a customer with various locations. He wants to identify on which location a record is
created.

I though to have a code in the user record, but a user can be rotated from on location to another. So, the supervisor must amnually change the location in the user record. Is the record is not updated, then the wrong location will
be on each record saved by the user.

The other approach is to identify the PC which is inserting the record, and use the IP as the location identifier.
The PC is most likely not being moved from one location to other.

Is there a way to get the local computer IP address, name or other information?

TIA

Hector

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: Identify from which location a record is saved
« Reply #1 on: December 31, 2014, 11:17:57 PM »
Hi Hector

If you can't find out the IP address or computer name then you could just add 'Location' to the login form which will make it a session variable.  Then you can add that to the record identification.

If you don't have a login then you could just force a user to establish a location before doing anything else and  login them in (p_web.validatelogin()) and then make the menu items dependent on being logged in.

Cheers

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Identify from which location a record is saved
« Reply #2 on: January 01, 2015, 12:12:32 AM »
If you are talking about the WebServer app then the
p_web.GetSessionIP()
method will return the "Internet Facing" IP address of the client. This will work ok as long as the client is not inside a LAN and the server outside the LAN - in which case all the users in the LAN will share the same IP address.

Another approach would be to put a cookie on the client machine with the location. Any user then using that machine would use that cookie, and so you'd know the location.

If the cookie did not exist then you could ask the user (perhaps at login time) for the location so that it can be stored for future use.

cheers
Bruce