NetTalk Central

Author Topic: Record primed form  (Read 4931 times)

billbarker

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Record primed form
« on: March 20, 2015, 05:53:13 AM »
Normally I use the Browse/Form paradigm, but in certain conditions I know the exact record I wish to update... In 'normal' clarion I would just 'get' the record, then call the update form as 'change'... is there a similar method here?

Thanks

Bill

Johan de Klerk

  • Full Member
  • ***
  • Posts: 217
  • Johan de Klerk
    • View Profile
    • Designer Software
Re: Record primed form
« Reply #1 on: March 20, 2015, 06:10:41 AM »
Hi Bill,

See: How do I call a form directly using a link? Not via a Browse.
http://www.capesoft.com/docs/NetTalk8/NetTalkWebFAQ.htm#W4

Regards

Johan de Klerk
Clarion 10, NT 11.57

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: Record primed form
« Reply #2 on: March 20, 2015, 06:13:17 AM »

billbarker

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Re: Record primed form
« Reply #3 on: March 20, 2015, 07:06:42 AM »
Ok, but I have one small issue, I don't seem to be able to pass across a value for the key....
My table is pretty simple, with a unique URN as the primary key, so in the menu parameter for the update form  I've tried......

'change_btn=change&_bidv_=' & p_web.AddBrowseValue('pageheadertag','Club',clu:byURN,5) ##### This WORKS PERFECTLY!!!!!!!!

'change_btn=change&_bidv_=' & p_web.AddBrowseValue('pageheadertag','Club',clu:byURN,p_web.GSV('ClubURN')) ###### this returns 'record not found'
I try setting a local in the embed before the menu is called with ClubURN = p_web.GSV('ClubURN')
then
'change_btn=change&_bidv_=' & p_web.AddBrowseValue('pageheadertag','Club',clu:byURN,ClubURN) ###### this also returns 'record not found'

(at that point the session value is set to 5)


Have I missed something?

Thanks

Bill
« Last Edit: March 20, 2015, 10:04:23 AM by billbarker »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Record primed form
« Reply #4 on: March 22, 2015, 09:49:24 PM »
Hi Bill,

remember that the menu parameters are set when the menu is _generated_ not when it is _clicked on_.  By the time the user clicks on it (in the browser) it has been in the browser for some time - since it was generated. Changing the SessionValue in the time won't affect the menu.

Since you are priming it from a session value, it might simply be easier to prime it when the form opens. ie don't pass the parameter to the form at all, but on the PRIMING tab for the form prime the value - "Prime for loading" is the option you want to use.

Cheers
Bruce



billbarker

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Re: Record primed form
« Reply #5 on: March 23, 2015, 02:32:04 AM »
Bruce,

Yup, still not 100% in the mindset of most things 'already happened'!

Maybe I misunderstood something, but I don't want to 'prime' certain values in a form, I want to update an existing entry, I just want to 'land' on the form with it populated with the current data, and perform an UPDATE.

Do I just 'get' the record (and all lookups) in the 'PreUpdate' embed, and then tell the form (somehow) that it is in an 'update'?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Record primed form
« Reply #6 on: March 23, 2015, 05:31:26 AM »
>> Do I just 'get' the record (and all lookups) in the 'PreUpdate' embed, and then tell the form (somehow) that it is in an 'update'?

you're making it harder than I've made it for you.... Remember NetTalk templates do things that ABC doesn't <g>...

>> Maybe I misunderstood something, but I don't want to 'prime' certain values in a form,

I understand - if you did I'd tell you to "Prime on Insert / Update / Copy" etc...
No, this is "Prime FOR Load" which is slightly different.
Stuff you prime here is set _before_ the "record for editing" is loaded. ie this is your opportunity to prime the fields before the GET which loads the file record.

Usually of course this is not used, because the browse does that work (and passes the ID as a parameter) but in this case, no browse means it's not passed - which means it has to "prime the field for loading" from somewhere else...

>> Do I just 'get' the record (and all lookups) in the 'PreUpdate' embed,

That's what "Prime For Load" does for you....

>> and then tell the form (somehow) that it is in an 'update'?

That's done either as a parameter (which you can still pass via the URL) or on the Advanced tab of the form properties - you can set the default action.

cheers
Bruce



I want to update an existing entry, I just want to 'land' on the form with it populated with the current data, and perform an UPDATE.

billbarker

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Re: Record primed form
« Reply #7 on: March 23, 2015, 08:00:26 AM »
Bruce,

Sometimes a simple 'thank you' for this amazing support does not seem enough, but... once again.. thank you (and thanks for your [seemingly!] infinite patience)

Bill