NetTalk Central

Author Topic: ValidateUpdate  (Read 2148 times)

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
ValidateUpdate
« 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.


Brian

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: ValidateUpdate
« Reply #1 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

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: ValidateUpdate
« Reply #2 on: March 04, 2015, 08:45:28 AM »
That was it - Thanks Bruce.
Brian