NetTalk Central

Author Topic: Call a related table update form (SOLVED)  (Read 2350 times)

Poul Jensen

  • Full Member
  • ***
  • Posts: 247
    • View Profile
    • Email
Call a related table update form (SOLVED)
« on: May 16, 2025, 03:11:42 AM »
Hi,

From a button on the update form of table A, I would like to call the update form of a related table B.
On the button > Client-Side > Send new value to server, I get the record of the related table B (and verifies with debugview++ that it is the correct record) but I have no luck with calling the related update form.

Have tried various variants of code hacked from table B's browse, but without success.  See code below:

Code: [Select]
    DO OpenFiles
    !Get record of table A
    Access:MobSagH.ClearKey(MSagH:KeyGUID)
    MSagH:GUID =  p_web.GSV('MSagH:GUID')
    NOMEMO(MobSagH)
    IF Access:MobSagH.TryFetch(MSagH:KeyGUID)
        !failed
    ELSE
        !Get record of table B
        Access:MobCustomers.ClearKey(MCus:KeyGUID)
        MCus:GUID =  MSagH:KundeGUID
        NOMEMO(MobCustomers)
        IF Access:MobCustomers.TryFetch(MCus:KeyGUID)
            !failed
        ELSE
            ds_outputdebugstring('RET KUNDEN - **OK**  MSagH:KundeGUID: ' & MSagH:KundeGUID)
            p_web.SSV('MCus:CUSTOMERNO', MCus:CUSTOMERNO)       

            !This doesn't work
            UpdateMobCustomers(p_web,Net:Web:Popup)  !Form Procedure
                   
        END
    END
    DO CloseFiles

What am I missing here?

tia
/Poul
« Last Edit: May 17, 2025, 07:25:27 AM by Poul Jensen »

rjolda

  • Sr. Member
  • ****
  • Posts: 368
    • View Profile
    • Email
Re: Call a related table update form
« Reply #1 on: May 16, 2025, 10:18:17 AM »
Hi Poul,
Are you going to use a Button to call Table B Update?
On the Button Code - "On CLick" - you can call the Update PROCEDURE for Table B here.  You can set any Parameters to pass to Table B on the next line.  Lastly the last check box "Include Action" you can check and set the action to Insert, Change as appropriate.  That is where I would start.
Ron

Poul Jensen

  • Full Member
  • ***
  • Posts: 247
    • View Profile
    • Email
Re: Call a related table update form
« Reply #2 on: May 17, 2025, 07:25:08 AM »
Hi Ron,

Thanks - that got me going.
Had an issue still getting an Record Not Found error when loading form B, until I added this code in the InitForm Routine:

Code: [Select]
p_web.SetValue('MCus:CUSTOMERNO',p_web.GSV('MCus:CUSTOMERNO'))
/Poul