NetTalk Central

Author Topic: update a related file  (Read 3200 times)

Edvard

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • BB-Soft
    • Email
update a related file
« on: February 09, 2008, 06:17:43 AM »
I have a file called activities
It has a many to many relationship to a file called children
As it is a many:many reæationship, I have made a file called chiildren_activities with 3 fields:
ID
ID from file Children
ID from file activities.
I have made a browse with the activities.
What I want is:
If there is no record with present child and activity - make such a record.
Update an Icon in the activity browse
If there is a record - be able to delete it, and again update the icon field

I just even cannot get started... ???

Edvard Korsbæk

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: update a related file
« Reply #1 on: February 10, 2008, 09:54:06 AM »
The answer to this is buried in the question:

"How would you do this with a normal browse & form?"

There are a number of approaches you can take - but obviously you should approach it the same way that you would do this in a Windows program.

In essence the mechanism would be the same - you just need to think very carefully about what file the browse is browsing, and on which file the form is.

Plus the embed point "Validate Record" (which happens when the save is pressed) is probably also gonna come in very handy.

Cheers
Bruce


Edvard

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • BB-Soft
    • Email
Re: update a related file
« Reply #2 on: February 14, 2008, 12:23:42 PM »
In a standard browse/form, I would use a brwn.updatebuffer() to find the record, prime the form as described in 'Programming in Clarion ABC' and make a form with the id of the fiile as parameter.
Point is, that I do not know the nettalk equialent of the UpdateBuffer  :-\- Parameter passing is via session variables ;D.
And the good old embed points 'Accepted' and s'selected' could too be good to have an equialent of...

Best regards

Edvard

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: update a related file
« Reply #3 on: February 19, 2008, 08:59:17 AM »
Hi Edvard,

Forgive me, but I'm still not 100% sure of exactly what you are trying to do. However some hints...

See FAQ, specifically number W4. This covers calling a form directly "without a browse". I'm not sure if it applies.

Regarding "which record has been highlighted". If the Browse is a Form field (on a form) then you can add some "server side code" just as you can with any form field. This code will get triggered with each selection on the browse. At this point the "unique identifier" for the browse is updated in the session Queue. In this sense this is the same as a Window Event:NewSelection.

Cheers
Bruce