NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Johan van Zyl

Pages: 1 2 3 [4] 5 6 ... 12
46
Web Server - Ask For Help / Re: Calling NetWebForm from within embed code
« on: November 11, 2014, 10:15:38 PM »
Thx Bruce,
I have two types of people who will log in.
Normals Users that would probably only ever  be staff members of medxinfo and those who are in the People table.
When logging in the code will use the loc:login to distinguish who is logging in
if len(clip(loc:login)) = 10 and sub(loc:login,1,1) = 0 !probably a cell number 
    clear(people)
    peo:cellno = clip(loc:login)
    if Access:people.TryFetch(peo:cellno_ukey)
...
if a User logs in then after login the LoginForm can call IndexPage or whatever BUT if logging in with cellno then the PeopleNetWebForm must be called populated with that persons details. Upon Saving must be logged out, before they can cause any damage.,
I guess the question is: can there be a choice of URL on Save depending on what type of user logged in.
 ,,,

47
Web Server - Ask For Help / Calling NetWebForm from within embed code
« on: November 11, 2014, 01:28:38 PM »
Hi

A. LoginForm
in ValidateUpdate 2 End
After the User has been validated - i.e. legally logged in, depending what type of User, I would like to call a form populated with THAT users details to be edited by the User himself. How do I call that form inside code and how do I ensure that the form is populated with that users details?
The login and password is validated against the People table which also contains all other details of the logged-in user. Therefore I will have the peopleguid in a Session Value, say called peopleguid.

B. After user is done  editing, upon leaving THAT form User must be logged out? How?

48
>> How do I obtain the value bra:brandnamesysid that has has just been created by the PostGreSQL sequence.

This is a PostGres question, not a NetTalk Question. ie you do it the same way you would for a normal clarion / Postgres program.



After inserting a Brandname in UpdateBrandnames NetWebForm I cannot "see" bra:brandnamesysid whether I put the code in PostInsert or ValidateInsert. Seems there is a difference between ABC and NTWS. I need the value to create audit log files

49
Web Server - Ask For Help / Re: SSV and GSV
« on: October 20, 2014, 02:58:40 PM »
Finally - it has dawned on me!

p_web.SSV('loggedin',Loc:Login)     
loc:savedlogin = p_web.GSV('loggedin')

where 'loggedin' is a SESSION variable that is created "on the fly" - i.e. inside the SSV function!

50
Web Server - Ask For Help / Re: SSV and GSV
« on: October 20, 2014, 02:35:31 PM »

 
       stop('1 Loc:Login = '&Loc:Login)
        p_web.SSV('Loc:Login','Loc:Login')
        stop('2 Loc:Login = '&Loc:Login)
        p_web.SSV('loc:savedlogin','Loc:Login')
        stop('3 p_web.GSV('loc:savedlogin') = '&loc:savedlogin)
        p_web.SSV('loc:savedlogin', p_web.GSV('Loc:Login'))
        stop('4 p_web.GSV('loc:savedlogin') ='&loc:savedlogin)




Vinnie, I do not understand your reply - unless you only wanted to improve the STOPS - but my problem is - I do not get the value of Loc:Login into loc:savedlogin - even in the same procedure. And I would like to use loc:savedlogin, or Loc:Login for that matter, in another procedure - how do I do that? Thx

51
Web Server - Ask For Help / Re: SSV and GSV
« on: October 20, 2014, 02:32:20 PM »
Johan,

Don't put quotes around the value in p_web.ssv() - when it's a variable.

Peter

This does not work either

 stop('1 Loc:Login = '&Loc:Login)
        p_web.SSV(Loc:Login,Loc:Login)
        stop('2 Loc:Login = '&Loc:Login)
        p_web.SSV(loc:savedlogin,Loc:Login)
        stop('3 loc:savedlogin = '&loc:savedlogin)
        p_web.SSV(loc:savedlogin, p_web.GSV(Loc:Login))
        stop('4 loc:savedlogin ='&loc:savedlogin)

52
Web Server - Ask For Help / SSV and GSV
« on: October 20, 2014, 12:41:07 PM »
In LoginForm
Stops 1&2 work - 3&4 do not

LoginForm Validate Update 2 End
       stop('1 Loc:Login = '&Loc:Login)
        p_web.SSV('Loc:Login','Loc:Login')
        stop('2 Loc:Login = '&Loc:Login)
        p_web.SSV('loc:savedlogin','Loc:Login')
        stop('3 loc:savedlogin = '&loc:savedlogin)
        p_web.SSV('loc:savedlogin', p_web.GSV('Loc:Login'))
        stop('4 loc:savedlogin ='&loc:savedlogin)

If I cannot even retrieve the Loc:Login on the LoginForm how will I retrieve it in  another procedure i.e.
some update form in eg PostUpdate - to store who is logged in and therefore made the changes to the table?

53
I have now added this to PostInsert
p_web.FileToSessionQueue(brandnames)

but this still does not work
 alh:keyvalue = clip(p_web.GSV('bra:brandnamesysid'))

54
PostGreSQL

I need two values:

table: brandnames
In PostInsert I have this code
 Access:auditlogheader.PrimeRecord()
    alh:logtimestamp_DATE = Today()
    alh:logtimestamp_TIME = Clock()
    alh:username = p_web.GSV('usr:userlogin') ! does not work
    alh:tablename = 'brandnames'
    alh:keyname = 'bra:brandnames_pkey'
   alh:keyvalue = bra:brandnamesysid
OR?
    alh:keyvalue = p_web.GSV('bra:brandnamesysid')
does not work

In PostUpdate  alh:keyvalue = bra:brandnamesysid works just fine

How do I obtain the value bra:brandnamesysid that has has just been created by the PostGreSQL sequence.
How do I obtain the username from a normal login form?

55
Web Server - Ask For Help / Audit file
« on: October 05, 2014, 01:51:59 PM »
How should this be coded in NTWS?
 alh:actiontaken = Choose(ThisWindow.Request,'Add','Change','Delete')

I get these errors when trying to run "normal" code in NTWS
Unknown identifier: THISWINDOW -
Field not found: REQUEST -
Too few parameters -
Must specify identifier -
Unknown identifier: HISTORY::BRA:RECORD -
Too few parameters -
Must specify identifier -
Unknown identifier: HISTORY::BRA:RECORD -

PostUpdate      Routine
  ! Start of "On Update : Form ends : following disk write"
  ! [Priority 4000]
   Access:auditlogheader.PrimeRecord()
     alh:logtimestamp_DATE = Today()
     alh:logtimestamp_TIME = Clock()
     !alh:username = GLO:Username
     alh:tablename = 'brandnames'
     alh:keyname = 'bra:brandnames_pkey'
     alh:keyvalue = bra:brandnamesysid
     alh:procedurename = GlobalErrors.GetProcedureName()
     alh:actiontaken = Choose(ThisWindow.Request,'Add','Change','Delete')
     Access:auditlogheader.Insert()
     Stream(auditlogdetail)
     Loop i# = 1 to brandnames{Prop:Fields}
         If Clip(What(History::bra:Record,i#)) <> Clip(What(bra:Record,i#))
             Access:auditlogdetail.PrimeRecord()
             ald:auditlogheadersysid = alh:auditlogheadersysid
             ald:columnname = Sub(Who(bra:Record,i#),7,Len(Clip(Who(bra:Record,i#))))
             ald:oldvalue = What(History::bra:Record,i#)
             ald:newvalue = What(bra:Record,i#)
             Access:auditlogdetail.Insert()
         End
     End
  ! End of "On Update : Form ends : following disk write"

56
This is the XHTML code I have in a NetWebSource procedure
<img src="images/medxinfocontactinfo004_311x186.png" width="311" height="186" alt="" border="0"/>

that cause this problem:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<ajax-response>
<response type="element" id="contactus_div">
<div id="contactus_div" class="nt-toppanel">
<img  src="images/medxinfocontactinfo004_311x186.png" width="311" height="186" alt="" border="0"/>
</div>
<!--  contactus_div  -->
</response>
</ajax-response>

57
Web Server - Ask For Help / send sms and email from one set of code
« on: September 23, 2014, 03:56:51 AM »
For instance - when somebody logs into (enters UserName and Password and clicks "Request OTP" ) www.medxinfo.co.za an OTP One Time Password must be sent to the user's cell phone and/or email address. Once the user has entered the correct OTP and clicks Login, he will be logged in.
The "Request OTP" button calls another NetWebForm?
This form generates the OTP and sends sms and/or email to user?
Which embed points would be optimal?


58
Web Server - Ask For Help / Re: NetWebForm - filter on Drop
« on: May 19, 2014, 09:11:33 AM »
RESOLVED!
The Form is for people table

 filter must be:
 'pro:countrysysid = <39>' & p_web.GSV('peo:countrysysid') & '<39>'
and had to reset!


sysid's always INTEGER

CREATE TABLE geo.countries(
   countrysysid serial PRIMARY KEY,
  countrycode varchar(10) UNIQUE,
  countrycodeshort  varchar(10) UNIQUE,
   countrydescr citext UNIQUE,
  dailingcode citext,
...
CREATE TABLE geo.provinces(
   provincesysid serial PRIMARY KEY,
  countrysysid integer REFERENCES countries ON DELETE RESTRICT,
  provincecode citext UNIQUE,
   provincedescr citext,
   capitalcity citext,

Click on Drop for Provinces and select South Africa - when I click on Provinces only South African Provinces must be selectable.


I cannot find send order/filter to debugview under LookUp Settings of the Drop,
...

[attachment deleted by admin]

59
Web Server - Ask For Help / NetWebForm - filter on Drop
« on: May 18, 2014, 10:22:23 AM »
First a Country is selected via a Drop from Country Table
Then I would like to select a  Province from Province table filtered on CountrySysID
neither of these filters work
‘pro:countrysysid = ' & p_web.GSV(‘cou:countrysysid')
 'pro:countrysysid = <39>' & p_web.GSV('cou:countrysysid') & '<39>'

Drop Filter web33.app does not seem to apply here.

60
But how many byes of text can I paste in here?
see attached.
Or must I not use NetWebPage and just call a normal html page?



[attachment deleted by admin]

Pages: 1 2 3 [4] 5 6 ... 12