Getfield Peoplecode Scroll 1
In this section, we discuss the Field class properties. The properties are discussed in alphabetical order.
This may occur with various PeopleCode built-in funcitons that specify a 'scroll context' via a series of records and a field name. Review the Peoplecode that is generating the message and the page definition and correct as appropriate. STEPS-The issue can be reproduced at will with the following steps: 1.
DataAreaCollapsed
Description
This property specifies whether the default initialview of the data area of a group box is collapsed or expanded.
Note: You must set the CollapsibleData Area on the properties for the group box in ApplicationDesigner for this property to have any effect.
This property changes to reflect the current stateof the data area, according to whether the user has collapsed or expandedit. Changing the value collapses or expands the data area, but itdoes not prevent the user fromcollapsing (or expanding) it themselves.
Note: Because the user can change the value of this property,whatever value is set in PeopleCode isn’t guaranteed to be still setthe next time it is checked, because the user may have collapsed orexpanded the data area in the meantime.
This property overwrites the value of the Default Initial View to Expanded fieldset in Application Designer. For example, if Default Initial View to Expanded is selected in ApplicationDesigner, then the value for the DataAreaCollapsed property is setto True, the control initially displays collapsed.
This property takes a Boolean value: True, initiallydisplay the data area collapsed, False, initially display the dataarea expanded.
This property is read-write.
Note: If you want to collapse an entire level-based control,such as a scroll area or a grid, use the DataAreaCollapsed Rowsetmethod.
DecimalPosition
Description
Use this property to specify the number of digitsafter the decimal point to be displayed for a field defined as numberor signed number.
This property overwrites the Decimal Positions valuedefined for a field in Application Designer.
Setting the DecimalPosition property to a smallernumber than the record field's decimal position causes the displayeddata to be truncated. For example, suppose a numeric field in thedatabase has a value 0.005. Setting DecimalPosition to 2 displays0.00 on page.
This property takes an integer value. The defaultvalue is -1, which indicates that the property is not set.
This property is read-write.
DisplayFormat
Description
Image: PHONE-INTL format
The followingimage is an example of PHONE-INTL format.
Use this propertyto specify a custom format to use for the field.
This property is read-write.
The custom formatfor a field is specified in the field definition. This property enablesyou to switch between display formats that are defined as part ofa custom format. For example, suppose your field used the PHONE-INTLcustom format:
Both the LONG and the SHORT stored formats havetwo display formats: STANDARD and UNFORMATTED.
Using this property, you could select either ofthe display formats. For example:
Note: You cannot changethe Stored format, but you can find its value using the StoredFormatproperty.
DisplayOnly
Description
This property is set to true if the field property DisplayOnly in the Application Designeris set. May be set to false to change how the field displays.
Note: This property overwrites whatever value is set in Application Designer.
This property is read-write.
DisplayZero
Description
Use this property to specify if, in a numeric field,zeros or blank are displayed on a page.
This property overwrites the Display Zero value on thepage field properties dialog box in Application Designer.
This property takes a Boolean value: true, displayzeros, false, display blank. The default values is false.
The value of the DisplayZero property can be changedby the SmartZero property.
If SmartZero is set to true, and your applicationsets DisplayZero to false in a PeopleCode program, the applicationserver changes the value of DisplayZero to true to display zeros,not blanks. When this occurs, the DisplayZeroChanged property is setto true.
This property is read-write.
DisplayZeroChanged
Description
Use this property to determine if the original DisplayZeroproperty has been changed from its original setting.
The DisplayZeroChanged property is only relevantwhen the SmartZero property has been set to true. When SmartZero equalstrue, the application server adjusts the DisplayZero property to displaya blank or zero based on the user's input. You can then check theDisplayZeroChanged property to find out if the application serverhas changed the DisplayZero property.
This property takes a Boolean value: true, the applicationserver has changed the field's DisplayZero property, false otherwise.
For example, suppose you have a PeopleCode programin the RowInit event that sets the DisplayZero property for a fieldto True, and also sets the SmartZero property to True. When a userdeletes the numeric zero in that field on the page, and the page issubmitted to the application server, the application server sets thefield's DisplayZero property to False so that the new page displaysa blank, not a numeric zero. The DisplayZeroChanged property is setto true in this example.
This property is read-only.
EditError
Description
This property is True if an error for this fieldhas been found after executing the ExecuteEdits method with eithera message object or a record object. This property can be used withthe MessageSetNumber and MessageNumber properties to find the errormessage set number and error message number.
The EditError property returns True if a Null valuewas encountered for this field.
This property is read-write. After you have fixedthe errors, you must set this property to False before running ExecuteEditsagain.
Example
The following is an example showing how EditError,along with the ExecuteEdits method could be used:
Enabled
Description
This property is True if this field is enabled. May be set False to disable any control that displays this field.
This property is read-write.
FieldLength
Description
This property returns the length of the field asa number.
This property is read-only.
FormatLength
Description
This property returns the length of the format forthe field as a number.
This property is read-only.
FormattedValue
Description
This property returns the value of a field as astring, formatted exactly as it would be displayed on an edit fieldon a page. This is useful when you're using a prompt field for thelabel of another field.
Because a record field can be bound to more thanone page field, FormattedValue takes the first associated page field,looking first on the current page, then through all the pages in thecomponent. This property returns a null string (') if used withan Image or ContentReference field. It also returns a null stringif no associated page field is found.
This property is read-write.
Example
This property could be used to set up a hyperlinklabeled by data generated on a page. To do this, do the following:
Define a work field.
Associate the work field withthe hyperlink page field.
Define a hidden page field withthe formatting that you want.
Associate the hidden page fieldwith the data field.
Write PeopleCode (probably forRowInit) to set the label on the work field to be the FormattedValueof the data field.
For example, suppose you wanted a hyperlink labeledby the QE_POSITION_ID field on the QE_PLYR_POSITN record. This fieldis a prompt table field, edited by table QE_POSITION.
You want to display the DESCRSHORT field from theprompt table, instead of the QE_POSITION_ID code value. Create awork field, POS_LINK on the WORK_REC record, and create a hyperlinkpage field associated with the DESCRSHORT field. For the label, createan invisible drop-down list page field, associated with QE_PLYR_POSITN.QE_POSITION_ID. Set its Prompt Table Field to DESCRSHORT. Then put a PeopleCodeprogram on the component RowInit for either the QE_PLYR_POSITN recordor the WORK_REC.
HoverText
Description
Use this property to override the hover text forany push buttons or hyperlinks associated with the field. The maximumlength of hover text is 100 characters. If the hover text is identicalto the push button or hyperlink label, the hover text will not beshown.
Important! Even if the hover text has been set in ApplicationDesigner, this property returns a blank string if you use the propertybefore you’ve explicitly set it in PeopleCode. This property overrides the existing value only. When a user navigates away from the component,and then back to the page again, the original value is used untilit's changed again through PeopleCode.
This property is read-write.
IsAltKey
Description
This property is True if this field references afield definition that is defined as an Alternate Search key in theassociated record definition.
This property is read-only.
IsAuditFieldAdd
Description
This property is True if this field references afield definition that is defined as an audit field in the associatedrecord definition, and the field is audited whenever new data is added.
This property is read-only.
IsAuditFieldChg
Description
This property is True if this field references afield definition that is defined as an audit field in the associatedrecord definition, and the field is audited whenever data is changed.
This property is read-only.
IsAuditFieldDel
Description
This property is True if this field references afield definition that is defined as an audit field in the associatedrecord definition, and the field is audited whenever data is deleted.
This property is read-only.
IsAutoUpdate
Description
This property is True if this field references afield definition that is defined as an Auto-Update field in the associatedrecord definition.
This property is read-only.
IsChanged
Description
This property returns True if the value for thefield has been changed.
Note: Use this property with the primary database recordonly. It will not return valid results if used with a work record.
This property is read-only.
IsDateRangeEdit
Description
This property is True if this field references afield definition that is defined as requiring a Reasonable Date inthe associated record definition.
This property is read-only.
IsDescKey
Description
This property is True if this field references afield definition that is defined as a descending key in the associatedrecord definition.
This property is read-only.
IsDuplKey
Description
This property is True if this field references afield definition that is defined as a duplicate key in the associatedrecord definition.
This property is read-only.
IsEditTable
Description
This property is True if this field references afield definition that has a table edit type of a Prompt Table withEdit.
This property is read-only.
IsEditXlat
Description
This property is True if this field references afield definition that has a table edit type of a Translate Table Edit.
This property is read-only.
IsFromSearchField
Description
This property is True if this field references afield definition that is defined as a From Search Field in the associatedrecord definition.
This property is read-only.
IsInBuf
Description
This property returns True if the data of the fieldis present in the data buffers. For example, all of the fields ofa derived record are not present in the data buffer.
This property is read-only.
Example
The following example iterates over all the fieldsin a record. The code verifies that the data for the field is accessiblebefore it tries to assign the value to a variable.
IsKey
Description
This property is True if this field references afield definition that is defined as a primary key of the associatedrecord definition.
This property is read-only.
IsListItem
Description
This property is True if this field references afield definition that is defined as a List Box item of the associatedrecord definition.
This property is read-only.
IsNotUsed
Description
This property is True if this field has been setas NotUsed with the SetDBFieldNotUsed function.
This property is read-only.
IsRequired
Description
This property is True if this field references afield definition that is defined as Required in the associated recorddefinition.
This property is read-only.
IsRichTextEnabled
Description
This property is True if this field is a long editbox with the rich text editor enabled.
This property is read-only.
IsSearchItem
Description
This property is True if this field references afield definition that is defined as a Search key in the associatedrecord definition.
This property is read-only.
IsSystem
Description
This property is True if this field references afield definition that is defined as System Maintained field in theassociated record definition.
This property is read-only.
IsThroughSearchField
Description
This property is True if this field references afield definition that is defined as a Through Search Field in theassociated record definition.
This property is read-only.
IsUseDefaultLabel
Description
This property is True if this field references afield definition that has its label defined as Use Default Label inthe associated record definition.
This property is read-only.
IsYesNo
Description
This property is True if this field references afield definition that has a table edit type of a Yes/No Table Edit.
This property is read-only.
Label
Description
Use this property to override the label text forthe field when it’s displayed on a page.
Important! Even if the label text has been set in ApplicationDesigner, this property returns a blank string if you use the propertybefore you’ve explicitly set it in PeopleCode. This property overrides the existing value only. When a user navigates away from the component,and then back to the page again, the original value is used untilit's changed again through PeopleCode.
To set the label in PeopleCode, use this propertyor the SetLabel built-in function. To return the text of a label beforeyou set it, use the GetShortLabel or GetLongLabel methods.
Note: You can't use this property to set labels longerthan 100 characters. If you try to set a label of more than 100 characters,the label is truncated to 100 characters.
The “tool tip,” or mouse over text, that appearswith a hyperlink at runtime comes from the RFT long label assignedto the record field. However, the RFT long label displays only ifit is different from the assigned display value of the hyperlink andit is not null. If the link is an image button, the tool tip is derivedfrom the label text if there is any. Otherwise, the RFT long labelis used.
This property is read-write.
Example
The following code sample changes all the fieldlabels for a record to the short label. It assumes that there isa label with the same name as the name of the field for all fieldsin the record.
LabelImage
Description
Use this property to override the image for a button.This property is only valid for button controls. This property canbe set even when the button is disabled or display-only.
Important! Even if the image has been set in Application Designer,this property returns a blank string if you use the property beforeyou’ve explicitly set it in PeopleCode. This property overrides theexisting value only. When a user navigates away from the component,and then back to the page again, the original value is used untilit's changed again through PeopleCode.
The value for this property can be either of thefollowing:
or
Oracle strongly recommends that if the PeopleCodeprogram sets the LabelImage for an active button, it also sets theimage appropriately if the button is disabled.
This property is read-write.
LongTranslateValue
Description
This property returns a string that contains theLong translate (XLAT) value of the field if the field is based ona translate table.
If the field has a null value, a null string isreturned. If the field isn’t based on a translate table, or the valueisn’t in the translate table, the field’s current value is returned. Because the current value can be of any type, this property has atype of Any.
Note: If you’re accessing a field based on the Translatetable, the Value property returns only the one or two letter XLATvalue.
Use the ShortTranslateValue property to return theshort translate value of a field.
This property is read-only.
MessageNumber
Description
This property returns the error message number (asa number) if an error for this field is found after executing ExecuteEditsmethod. You can use this property in conjunction with the EditErrorproperty (which can be used to determine whether there are any errors)and the MessageSetNumber property (which contains the error messageset number if an error is found.)
This property is read-only.
MessageSetNumber
Description
This property returns the error message set number(as a number) if an error for this field is found after executingExecuteEdits method. You can use this property in conjunction withthe EditError property (which can be used to determine whether thereare any errors) and the MessageNumber property (which contains theerror message number if an error is found.)
This property is read-only.
MouseOverMsgNum
Description
Use this property to override the message numberfor a message catalog mouse over popup page. Together with the MouseOverMsgSetproperty, this property uniquely identifies a Message Catalog entryto be used as the mouse over popup page.
The Message Text field from that Message Catalogentry becomes the title of the mouse over popup page; the Explanationfield becomes the body of the mouse over popup page.
Important! For this property to have an effect, the page fielddefinition must first be set as a message catalog mouse over popupin Application Designer. This property overrides the existing messagenumber value only. When a user navigates away from the component,and then back to the page again, the original value is used untilit's changed again through PeopleCode.
This property is read-write.
Example
For example, the following code could be added tothe page Activate event to override the message set and number definedin Application Designer for the popup page associated with the DEBUG_PEOPLECD.DEBUG_CODEfield.
MouseOverMsgSet
Description
Use this property to override the message set numberfor a message catalog mouse over popup page. Together with the MouseOverMsgNumfield property, this property uniquely identifies a Message Catalogentry to be used as the mouse over popup page.
Important! For this property to have an effect, the page fielddefinition must first be set as a message catalog mouse over popupin Application Designer. This property overrides the existing messageset value only. When a user navigates away from the component, andthen back to the page again, the original value is used until it'schanged again through PeopleCode.
This property is read-write.
Name
Description
This property returns the name of the field definitionthat the field object is based on as a string value.
This property is read-only.
OriginalValue
Description
This property returns the value of a field, thatis, the value that from the database. If the value hasn't been changedand saved by the user, it is the original value from the database. If the value has been changed and saved by the user, it is the existingvalue in the database.
Note: This property does not work for derived records. Original values are the database values,and derived records do not have a corresponding database value.
This property is read-only.
ParentRecord
Description
This property returns a reference to the recordobject for the record containing the field.
This property is read-only.
PromptTableName
Description
This property returns the name of the prompt table(if any) associated with this field. This property returns a stringvalue. This property returns Null if no prompt table is associatedwith the field.
This property is read-only.
SearchDefault
Description
If this property is set to True, system defaults(the default values set in the record field definitions) are enabledon search dialogs for the field. Setting this property to True does not cause the FieldDefault event tofire.
The system default is done only once, when the searchdialog first starts, immediately after any SearchInit PeopleCode. If the user subsequently blanks out a field, the field isn't resetto the default value. Setting SearchDefault to False disables defaultprocessing for the field executing the property.
SearchDefault is effective only when used in SearchInitPeopleCode programs.
This property is read-write.
Example
This example turns on edits and system defaultsfor the SETID field in the search dialog box:
SearchEdit
Description
If this property is set to True, SearchEdit enablessystem edits (edits specified in the record field definition) forthe field, for the life of the search dialog box. Setting SearchEditto False disables system edits. In the Add mode search dialog box,the following edits are performed when the end-user clicks the Addbutton. In any other mode, the following edits are performed whenthe end-user clicks the Search button:
Formatting
Required Field
Yes/No Table
1/0 Table
Translate Table
Prompt Table
SearchEdit does not cause the FieldEdit, FieldChange,or SaveEdit PeopleCode events to fire during the search dialog.
You might use SearchEdit to control access to thesystem. For example, you can apply this function to the SETID fieldof a dialog box and require the user to enter a valid SETID beforethey are able to click OK on the search dialog box.
This property is read-write.
Considerations Using SearchEdit
If you use this method in the SearchInit event,the search page options are limited to the '=' and 'IN' operators.
Example
This example turns on edits and system defaultsfor the SETID field in the search dialog box:
SetComponentChanged
Description
This property determines whether a change to a field(using PeopleCode) marks the component as changed and the data writtento the database if the field is a database field.
This property takes a Boolean value: true, changesto the field mark the component as changed, false, the component istreated as if unchanged. The default value is true for database fieldsand false for derived fields.
The Set Component Changed checkbox for a page field in Application Designer determines if auser's action on a page marks the component as changed. For example,if Set Component Changedforan edit box control is cleared in Application Designer, then user'sediting on the edit box does not mark the component as changed andno save warning message is displayed if the user leaves the page withoutsaving. The SetComponentChanged property for a field determines ifa change on the field value using PeopleCode marks the component aschanged and a save warning is issued when the user tries to exit thepage without saving.
This property is only applicable after the PageActivate event has run. If you try to use this property before orduring Page Activate, the user does not receive a warning if datahas been changed.
This property is read-write.
ShortTranslateValue
Description
This property returns a string that contains theShort translate (XLAT) value of the field if the field is based ona translate table.
If the field has a null value, a null string isreturned. If the field isn’t based on a translate table, or the valueisn’t in the translate table, the field’s current value is returned. Because the current value can be of any type, this property has atype of Any.
Note: If you’re accessing a field based on the translatetable, the Value property returns only the one or two letter XLATvalue.
Use the LongTranslateValue property to return thelong translate value of a field.
This property is read-only.
ShowRequiredFieldCue
Description
With PeopleTools 8, an asterisk (*) is displayedon pages beside fields that are defined as Required in ApplicationDesigner. You can use this property to specify whether this asterisk,also called the required field cue, is displayed for a particular field.
For example, many fields are made required or non-requiredeither procedurally or through PeopleCode. This means they aren’tdefined as Required in Application Designer, and the end-user maybe confused. For these fields, you can use this property.
Note: This property affects only fields where a requiredfield cue is otherwise permissible. That is, regardless of the settingof the property, no cue is ever shown on a pushbutton, a display-onlyfield, and so on.
This property is read-write.
SmartZero
Description
Use this property to specify if FieldChange PeopleCodeprograms are run when a user changes a zero to a blank, or a blankto a zero, for a field on a page.
This property takes a Boolean value: true, run FieldChangePeopleCode programs, false, do not. The default value is false.
When you set this property to true, in additionto treating a user change of blank-to-zero and zero-to-blank as afield change, the application server also adjusts the DisplayZeroproperty for the runtime field object to display a blank or zero asentered by the user.
This property is read-write.
SqlText
Description
This property is valid only for fields that havea dynamic view as their prompt record. If you set SqlText to a non-nullvalue, that text is used instead of the dynamic view's normal textused for prompting.
Important! Even if the SQL text has been set in ApplicationDesigner, this property returns a blank string if you use the propertybefore you’ve explicitly set it in PeopleCode. This property overrides the existing value only. When a user navigates away from the component,and then back to the page again, the original value is used untilit's changed again through PeopleCode.
Suppose you wanted to have a different prompt tabledepending on the settings of other fields in the row. Normally youcould use %EDITTABLE to dynamically specify the prompt table you want. However in this case there are too many possible combinations ofvalues, which would require too many views. Furthermore, the valuesare customizable by the end-user or the application, which means evenif you, the developer, wanted to, you couldn't provide all the combinationsof views necessary. However you can generate the desired SQL textfor the view in PeopleCode based on what the user enters.
If you use a dynamic view as the prompt table, andhave the dynamic view contain a SQL object that is updated from PeopleCode,you could achieve this functionality. However, a SQL object is a sharedobject, so if multiple users used the same page, they overwrite eachother's settings and the SQL object contains the SQL for the mostrecent user. Similarly if a single user had multiple rows on a page,the SQL object is valid only for the most recent row. This means ifthe user went to another row and did a prompt, they would get thewrong values again.
The purpose of this property is to enable you tospecify the generated SQL text independently for each occurrence ineach transaction. It enables you to override the text of a dynamicview being used as a prompt table on a field by field basis.
It is up to the developer to verify that the textspecified for this property is valid, that is, that it selects thecorrect number of fields for the record definition, and so on.
This property is read-write.
StoredFormat
Description
This property returns the custom character format(as a string) for the field executing the property.
If the field doesn’t have a custom format associatedwith it, the user receives a runtime error message.
If the field has a display format associated withit, you can change that using the DisplayFormat property.
This property is read-only.
Style
Description
If a page has a style sheet associated with it,this property can be used to specify a different style class witha field. Use this property to override the existing style class fora field.
Important! Even if the style class has been set in ApplicationDesigner, this property returns a blank string if you use the propertybefore you’ve explicitly set it in PeopleCode. This property overrides the existing value only. When a user navigates away from the component,and then back to the page again, the original value is used untilit's changed again through PeopleCode.
This property takes a string value.
This property is read-write.
Example: Field with PSHYPERLINK style
Image: Field with PSHYPERLINK style
The followingexample associates a test field first with a style class dependingon the value of the field.
Image: Field with PSIMAGE style
Another exampleshowing an association of a test field first with a style class dependingon the value of the field
Type
Description
This property returns the type of field. The valuescan be one of the following strings:
CHAR
DATE
DATETIME
IMAGE (for static images)
IMAGEREFERENCE
LONGCHAR
NUMBER
SIGNEDNUMBER
TIME
Note: Fields of type Attachment have a type of IMAGE.
This property is read-only.
Value
Description
This property contains the current value of thefield, converted to an appropriate PeopleCode data type.
In most contexts, the Value property can be usedto assign a new value to the field. However, there are some restrictions:
You cannot assign the Value propertyin any RowSelect PeopleCode program.
You cannot assign the currentrecord field value to the Value property in any FieldEdit PeopleCodeprogram.
Note: If you’re accessing a field based on the translatetable, Value returns only the one letter XLAT value. To get the fullXLAT value, use the LongTranslateValue or ShortTranslateValue properties.
This property is read-write.
Considerations Using INSTALLATION or OPTIONSTables
When using the INSTALLATION or OPTIONS table, youcannot use the Value property. You must use the old style format,not the field object format. For example, the following code is invalid:
While the following code is valid:
Accessing Level 2 Scroll Peoplecode
Considerations Using Character Values
Previously, if you had an edit-box field, and ifthe end-user selected the value in it and deleted the value, leavingthe field empty, the value of the field in PeopleCode was not an empty(zero-length) string.
Now, the value of such a field is an empty (zero-length) string.
In addition, if the user adds one or more spacecharacters to a field, the field still returns a Null string.
The following is how to check for this:
Peoplecode Get Field Value
Visible
Description
This property is True if this field is visible inthe page displaying it. Setting this property to False hides thefield. Because every field is implicitly associated with a rowset,row, and record, setting the Visible property for a field on the firstpage of a component hides only that field. If that field is repeatedon other pages in the component, the other occurrences of the fieldaren't hidden.
This property is read-write.
Example
The following code hides the field &ROUND_OPTIONbased on the value of AVG_DFLT_OPTION:
Power factor controller with 12 cap bank. If your plant loading is constantly changing, resulting in the need for varying amounts of reactive power, a centralized power factor correction method is a more effective and economical method to bring the power factor up to the target.
I got this PeopleCode somewhere that says it can dynamically add items in the drop down list:
My problem is I do not know exactly what event in the peoplecode should I put this in.
What I want to achieve is something like this:
A user will select a date. When the date is before June 2018, it displays a set of drop down items. However, if the selected date is on or after June 1, 2018, it will display another set of drop down list items.
Peoplecode Change Field Label
Brian Tompsett - 汤莱恩1 Answer
So you are wanting the dropdown list to change when the date changes if I understand correctly. You should then put your code in the FieldChange Event for the date field.
In PeopleSoft you have Record.Field.FieldChange Event and Component.Record.Field.FieldChange. The Record.Field.FieldChange event will fire whenever this field is changed regardless of what component it is in. While Component.Record.Field.FieldChange PeopleCode only fires when that field is changed in the component where you saved the code.
In your case you likely want it on the Component.Record.Field.Fieldchange event as your logic sounds componentpage specific.