NetTalk Central

Author Topic: Changing record values in the PostInsert 1 Start Embed  (Read 2099 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Changing record values in the PostInsert 1 Start Embed
« on: June 02, 2010, 04:30:38 AM »
I call the following procedure routine from the PostInsert 1 Start Embed

SetClaimStatus ROUTINE !Set the value of ClaimStatus dependant on pickup value and Collection Authorisation No
     WDOCREAS:Pickup = p_web.GSV('WDOCREAS:Pickup')
     WCLM:CollectionAuthorisationNo = p_web.GSV('WCLM:CollectionAuthorisationNo')
     IF WDOCREAS:Pickup = 0
        WCLM:ClaimStatusID = 4   !Collected/Finalised
     ELSE
        IF WCLM:CollectionAuthorisationNo = ''
            WCLM:ClaimStatusID = 2   !Authorisation O/S
        ELSE
            WCLM:ClaimStatusID = 3   !Waiting Colloection
        END
     END
     p_web.SSV('WCLM:ClaimStatusID',WCLM:ClaimStatusID)
!     MESSAGE('WCLM:ClaimStatusID' & WCLM:ClaimStatusID)
Exit
The value in the MESSAGE('WCLM:ClaimStatusID' & WCLM:ClaimStatusID) is correct but the value in the file after the record is saved is not changed to whatever value is in WCLM:ClaimStatusID.
Is this the right embed or is there something I am doing incorrectly?
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Changing record values in the PostInsert 1 Start Embed
« Reply #1 on: June 02, 2010, 05:56:45 AM »
try the validateInsert embed

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11194
    • View Profile
Re: Changing record values in the PostInsert 1 Start Embed
« Reply #2 on: June 02, 2010, 07:54:09 AM »
PostInsert happens after the Insert call, so if you change the record at that point you'll need to Update it yourself.
Or, use ValidateRecord, or ValidateInsert routine to do work on the record before it is inserted.

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Changing record values in the PostInsert 1 Start Embed
« Reply #3 on: June 05, 2010, 09:58:16 AM »
Thanks Kevin and Bruce. Working fine now
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186