NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: broche on March 03, 2015, 04:42:46 PM

Title: ValidateUpdate
Post by: broche on March 03, 2015, 04:42:46 PM
CL 9.1
NT 8.34

A look up on a form to get a staff record
In the ValidateUpdate embed I do the following:

        sta:staffsysid = p_web.GSV('CVF:AssignedTo')
        IF Access:Staff.Fetch(sta:pk_trssysid) = Level:Benign
            IF p_web.GSV('CVF:Rush') = 'Y'
                p_web.SSV('CVF:PayRate',sta:lineratehot)
            ELSE
                IF p_web.GSV('CVF:CallIn') = 'Y'
                    p_web.SSV('CVF:PayRate',sta:callinrate)
                ELSE
                    p_web.SSV('CVF:PayRate',sta:linerate)
                END
            END
        ELSE
            loc:alert='Invalid Staff Record ID'
        END
    END
    loc:alert = p_web.GSV('CVF:PayRate')

The last line is just to see did I get the correct value, and yes I did

Save the record then check the database backens and the value in the field is 0.
As far as I can see I'm not doing anything to reset the value.
Do I have the wrong embed?

Brian.


Title: Re: ValidateUpdate
Post by: Bruce on March 03, 2015, 11:26:05 PM
If you are doing this in ValidateUpdte then you should set the actual field value as well as the SessionValue, as the record is primed here ready for saving.

eg
p_web.SSV('CVF:PayRate',sta:linerate)
CVF:PayRate = sta:linerate


cheers
Bruce
Title: Re: ValidateUpdate
Post by: broche on March 04, 2015, 08:45:28 AM
That was it - Thanks Bruce.