NetTalk Central

Author Topic: Setup for multiple companies/ data sets  (Read 3930 times)

LSlowick

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Setup for multiple companies/ data sets
« on: August 19, 2013, 07:57:03 AM »
We have several 'divisions' internally. Each division has its own set of data files located in separate directories.

With my NetTalk app how can I allow the user to select which division they would like to access and then open the appropriate set of data files.

Note the data files for each division are exactly the same names, layouts, etc.

Can this be done with one nettalk app.exe running or do I need a version for each division?

I thought I saw somewhere a post or tip on how to do this...

Thanks for any suggestions.
Lee

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Setup for multiple companies/ data sets
« Reply #1 on: August 19, 2013, 08:45:04 PM »
Hi Lee,

This is a very common setup and works for TPS files, or SQL databases or however you split your data. The basic idea goes something like this;

a) create and set a session value to determine the name of the data set to use. Maybe this is on the login screen, maybe they select it on a Memory form, maybe it's "tied" to the user himself as he logs in (ie perhaps stored in your User table) or whatever.

b) In the dict all the tables need a variable for their Full Pathname. (Usually I declare the globals in the dict at the same time.) VERY IMPORTANT that these variables are THREADed, as indeed are the files.

b) Create a small, normal, Clarion source procedure which sets all the "full pathnames" based on the Session variable. For example
CustomerName = p_web.GetSessionValue('DataFolder') & '\Customers.Tps'

c) Call this source procedure from the WebHandler procedure, ProcessLink method, before the parent call.

cheers
Bruce

LSlowick

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Setup for multiple companies/ data sets
« Reply #2 on: August 20, 2013, 07:58:57 AM »
Bruce

Thanks for the advice. I'll give this a try.

Lee

LSlowick

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Setup for multiple companies/ data sets
« Reply #3 on: August 22, 2013, 12:54:18 PM »
I want to alter the header so that it displays the 'location' they are logged into.

I've gotten the login working and its is now selecting the proper set of files.

How do place a field in the header after they've selected the proper location?

If you look at the attached image I have a box in the upper right indicating where/what I'd like to see. II can set a field and alter its value when I set the datapaths, hoping to trigger this field to display 'when logged in'. I'm not really to concerned that it has to be located there, but somewhere on the header.

thanks for any help.
Lee



[attachment deleted by admin]

peterH

  • Sr. Member
  • ****
  • Posts: 413
    • View Profile
Re: Setup for multiple companies/ data sets
« Reply #4 on: August 22, 2013, 01:31:27 PM »
Lee,

Use a session value instead of a field and set the value once you know the location they're selecting, e.g. SetSessionValue('current_loc','Name of location').

Then, somewhere in your header xHtml, display the session value using the special tag
<!-- Net:s:current_loc --> and you're all set.

Peter

LSlowick

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Setup for multiple companies/ data sets
« Reply #5 on: August 23, 2013, 05:00:11 AM »
Peter

That worked! Thanks for the help.

Lee