MVC grid operations
oGrid:SetValue(cId,xValue) -> lOkChanges values through the grid submodel API.
Overview
FWFormGridModel maintains rows, validation and model state. SetValue(cId,xValue) operates on the current row and returns logical; GetValue(cId,nLine) can read a specified row. Do not add a third row argument to SetValue. SetLine validates the current row before moving; GoLine can move even when it is invalid and should not bypass validation routinely. Length includes deleted rows by default and can count active rows only. Submodel changes do not confirm full-model persistence. (Sources: refs. 1–1.)
Syntax
oGrid:SetValue(cId,xValue) -> lOkCommented example
#Include "Protheus.ch"
User Function Ed517()
// Requires a submodel object and defined field; block not invoked.
Local bUpdate := {|oGrid,cField,xValue| oGrid:SetValue(cField,xValue)}
ConOut(ValType(bUpdate))
Return NilPrints B. In the actual integration, check the logical update result. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Obtain the submodel from the correct model and respect insert/update actions and process validation. Avoid editing aCols directly as if this were a legacy grid.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.