NetTalk Central

Author Topic: Priming a field  (Read 8523 times)

Gregg Matteson

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Custom Program Solutions
Priming a field
« on: July 05, 2007, 10:26:48 AM »
I am trying to prime a DISPLAY field on a form with a session variable. As part of testing I placed the variable on the static page using the format <!-- Net:s:sessClico --> and it shows the value as I expect it would.

I can't prime the field with anything , for example I primed it ...

cli:client = 'test' and that doesn't even show.

ANY suggestions are much appreciated.
Kindest Regards,

Gregg Matteson

'Software that's actually easy to use'

Gregg Matteson

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Custom Program Solutions
Re: Priming a field
« Reply #1 on: July 05, 2007, 11:42:42 AM »
Ok. Finally got it to prime the field. Now to get it to display during the insert.
Kindest Regards,

Gregg Matteson

'Software that's actually easy to use'

Alan Telford

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
Re: Priming a field
« Reply #2 on: July 05, 2007, 01:41:14 PM »
Greg,
Not sure if you're still asking a question or not?

To manually set a session value you use:
p_web.setSessionValue('sessClico',value)

Alan

Gregg Matteson

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Custom Program Solutions
Re: Priming a field
« Reply #3 on: July 05, 2007, 04:31:32 PM »
Alan,

I got it to prime the field but I would like it to be visible in the display field during an insert .

I am using the session variable from the login procedure and that same variable is working to prime another field in another procedure. Can't understand why it doesn't work in this procedure even though everything is set up the same. I'm missing something.

Thanks,

Gregg
Kindest Regards,

Gregg Matteson

'Software that's actually easy to use'

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Priming a field
« Reply #4 on: July 06, 2007, 04:46:33 AM »
Greg,

To understand what is happening, right click on the procedure, and choose Source.

now search for
Value::fieldname
(where fieldname is the name of your display field)

there you can see how your field is bing used, and hence what you should set to get it to display.
(Typically it'll be the SessionValue)

Cheers
Bruce

Rhys Daniell

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Priming a field
« Reply #5 on: August 02, 2007, 12:48:20 AM »
I'm having the same issue.

A form with a record in insert mode and I can't get the primed values to display.

For example I've primed a checkbox field with a value of 1 and it is not checked when the form is first displayed.

I've tried
- setting 1 as the initial value in the dictionary
- priming the field with 1 on the advanced tab
- using SetValue() and SetSessionValue() individually and together, in the StoreMem routine

What have I missed?

TIA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Priming a field
« Reply #6 on: August 02, 2007, 05:04:29 AM »
Hi Rhys,

Is this form on a "File" or on "Memory"?
If "File" is the field you're trying to prime a file field, or a local variable?

Cheers
Bruce

Rhys Daniell

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Priming a field
« Reply #7 on: August 02, 2007, 02:51:33 PM »
Hi Bruce,

It's a file, and it's the primary file for the form. However I have other other files with entry fields on the same form, and I can't prime them either, using any of the methods below.

Cheers
Rhys

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Priming a field
« Reply #8 on: August 02, 2007, 10:47:33 PM »
Hi Rhys,

Are you calling the form from a browse?

Can you right-click on the procedure, choose "source", search for the PreInsert routine, and cut & paste the code from that routine here? You should see the field priming there, but I'd like to see the actual code.

Cheers
Bruce

Rhys Daniell

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Priming a field
« Reply #9 on: August 08, 2007, 04:15:05 PM »
Hi Bruce,

The form's not being called from a browse. Does that explain things? However, it's always in Insert mode (it's used to let someone set themselves up as a new user).

PreInsert code as requested:

  p_web.SetSessionValue('NewSystemUserPage_CurrentAction',InsertRecord)
  p_web.setsessionvalue('showtab_NewSystemUserPage',0)
  Com:CreatorSuID = 7
  Com:Publish = 1
  SU:CountryID = 1
  Com:TimeZoneID = 1
  ! Start of "Pre Insert After Primes"
  ! [Priority 5000]
  Com:CompanyCode = 'US'
  CR:SuCode = 'US'
  SU:CountryID = 1             ! Australia
  Com:CreatorSuID = 7          ! update to SystemUserID later
 
  ! End of "Pre Insert After Primes"
  p_web.FileToSessionQueue(Companies,Net:AlsoValueQueue)

Cheers
Rhys

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Priming a field
« Reply #10 on: August 10, 2007, 06:53:33 AM »
>> However, it's always in Insert mode

It sounds to me like it's not being put into insert mode correctly.
How are you doing it?
What does the URL look like?

FAQ #4 discusses the correct URL for an Insert.

Cheers
Bruce