A script-enabled browser is required for this page to function properly.

SRW.SET_FIELD_NUM built-in procedure

This procedure sets the value of a number field. This is useful when you want to conditionally change a field's number value.

Syntax


SRW.SET_FIELD_NUM(objectid, number NUM);

 

Parameters

Description

objectid

Is always 0. (The object must always set its own attributes.)

number

Is the number you want the field to display.

Restrictions

SRW.SET_FIELD_NUM is only meaningful in the format trigger of a field of Datatype NUMBER. It has no effect when entered in other places.

Example

Suppose you want to conditionally change the number of a field, based on each employee's salary. In the format trigger for the field, you could type the following:


FUNCTION CHGFIELD RETURN BOOLEAN IS 
TMP NUMBER;
BEGIN 
  if :sal >= 2000 then
  tmp := :sal * 1.08; 
  SRW.SET_FIELD_NUM (0, tmp); 
 else 
  SRW.SET_FIELD_NUM (0, '2500'); 
 end if; 
 RETURN (TRUE);
END; 

See also

About the Reports Builder built-in package (SRW)

SRW built-in package