NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: terryd on June 02, 2010, 04:30:38 AM

Title: Changing record values in the PostInsert 1 Start Embed
Post by: terryd 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?
Title: Re: Changing record values in the PostInsert 1 Start Embed
Post by: kevin plummer on June 02, 2010, 05:56:45 AM
try the validateInsert embed
Title: Re: Changing record values in the PostInsert 1 Start Embed
Post by: Bruce 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.
Title: Re: Changing record values in the PostInsert 1 Start Embed
Post by: terryd on June 05, 2010, 09:58:16 AM
Thanks Kevin and Bruce. Working fine now