Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

DynaPDF.SetFieldExpValue

Changes the choice values of a combo or list box, or to change the state and export value of check box.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DynaPDF 4.0 Yes Yes Yes Yes Yes

MBS( "DynaPDF.SetFieldExpValue"; PDF; Field; ValIndex; Value; ExpValue; Selected )

Parameters

Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf
Field The field index or field name. "FirstName"
ValIndex The value index or -1. -1
Value The new value. "Hello"
ExpValue The export value. "World"
Selected Whether to select the value?

Result

Returns OK or error.

Description

Changes the choice values of a combo or list box, or to change the state and export value of check box.
In the latter case, the parameter ValIndex will be ignored. If the field handle refers to a radio button, ValIndex represents the index into the Kids array of the radio botton.
To determine how many values are defined in a field call the function DynaPDF.GetFieldExpValCount or DynaPDF.GetFieldEx.
The parameter Value is ignored if the field is a check box or radio button. However, the parameter ExpValue is required for these field types.

If you don't need to change the value or export value then use the function DynaPDF.SetFieldExpValueEx instead.
If the field is either a combo box or list box, the parameter ExpValue is optional and can be empty. If the parameter Value is set to an empty string, the choice value will be deleted. Note that all choice values in a combo or list box must be unique. DynaPDF checks whether another choice value with the new name does already exist. If this is the case then the function will fail.
Combo boxes which have the field flag ffEdit set accept a value that was directly typed into the field in a viewer. Such a value may or may not exist the list of choice values. In any case, a special handling is required for this case because the value must be set as the field's value independent of whether it is already included in the list of choice value.
To achieve this, set the parameter ValIndex to PDF_MAX_INT (2147483647) or any index greater than the number of choice values in the field. The parameter Value can also be set to NULL or to an empty string to delete the field's value. If the string is set then it becomes the new field value but it is not added to the list of choice values if not included.
Note that the above handling is only valid for combo boxes which have the ffEdit field flag set.
To enumerate the choice values of a combo box, list box or radio button use the function DynaPDF.GetFieldExpValueEx.

See also SetFieldExpValue function in DynaPDF manual.

See also

Example Databases


DynaPDF.SetFieldDate   -   DynaPDF.SetFieldExpValueEx

Feedback: Report problem or ask question.




Links
MBS Xojo blog