Previous  Next          Contents  Index  Navigation  Glossary  Library

Foreign Key Reference Flexfield

The POPID/LOADID/VALID calling sequence for a foreign key reference flexfield (for most flexfield report parameters) is:

Syntax


#FND {POPID|LOADID|VALID}
CODE="flexfield code"
APPL_SHORT_NAME="application_short_name"
VALIDATE="{FULL|PARTIAL|NONE|QUERY}"
SEG="block.concatenated values field name"
[BLOCK="block_name"]
[FIELD="field_name"]
[DERIVED=":block.field\nSegment qualifier"]
[READ_ONLY="{Y|N}"]
[DINSERT="{Y|N}"]
[WINDOW="{Y|N}"]
[ID="block.unique ID field"]
[REQUIRED="{Y|N}"]
[DISPLAY="{ALL | flexfield qualifier |
segment number
}"]
[UPDATE="{ALL | flexfield qualifier |
segment number
}"]
[INSERT="{ALL | flexfield qualifier |
segment number
}"]
[DATA_FIELD="concatenated hidden IDs field"]
[DESC="block.concatenated description field name"]
[TITLE="window title"]
[VDATE="date"]
[NAVIGATE="{Y|N}"]
[AUTOPICK="{Y|N}"]
[NUM=":structure defining field"]
[COPY=":block.field\n{ALL | flexfield qualifier}"]
[VRULE="flexfield qualifier\n
segment qualifier\n
{I[nclude]|E[xclude]}\n APPL=shortname;
NAME=Message Dictionary message name\n
validation value1\n
validation value2..."]
[VALATT=":block.field\n
flexfield qualifier\n
segment qualifier"]
[USEDBFLDS="{Y|N}"]
[COLUMN="{column1(n) | column1 alias(n)
[, column2(n), ...]}]
[WHERE="where clause"]
[SET="set number"]
[ALLOWNULLS="{Y|N}"]
[QUERY_SECURITY="{Y|N}"]
[QBE_IN="{Y|N}"]
[LONGLIST="{Y|N}"]
[NO_COMBMSG="MESG_NAME"]

CODEThe flexfield code you specify when you set up this flexfield using the Register Key Flexfield form. This code must match the code you registered.
APPL_SHORT_ NAMEThe application short name with which your flexfield is registered.
VALIDATE Use a validation type of FULL to validate all segment values and generate a new code combination and dynamically insert it into the combinations table when necessary. If you specify FULL, Oracle Application Object Library checks the values your user enters against the existing code combinations in the code combinations. If the combination exists, Oracle Application Object Library retrieves the code combination ID. If the combination does not exist, Oracle Application Object Library creates the code combination ID and inserts the combination into the combinations table. If you (or an installer) define the flexfield structure with Dynamic Inserts Allowed set to No, then Oracle Application Object Library issues an error message when a user enters a combination that does not already exist. In this case, Oracle Application Object Library does not create the new code combination. FULL is the usual argument for a form with a foreign key reference.
Use PARTIAL to validate each individual segment value but not create a new valid combination or check the combinations table for an existing combination. You would use PARTIAL when you want to have application logic that requires flexfield segment values but does not require an actual code combination. For example, Oracle Application Object Library's Define Shorthand Aliases form requires that a user enters valid values for each segment, but does not require (or check) that the actual code combination already exists in the combinations table. The Define Shorthand Aliases form does not create the combination, either.
Use NONE if you wish no validation. Use QUERY (not QUERY_BASE) for POPID in a FND_PRE_QUERY trigger. The default value is FULL.
Use the same value in your LOADID and VALID as you use in your POPID in your KEY_PREFIELD trigger. Do not use FOR_INSERT for a form with a foreign key reference.
If you wish to implement shorthand flexfield entry for your form with a foreign key reference, you must use FULL for POPID in your KEY_PREFIELD trigger (as well as LOADID and VALID).
SEG block.concatenated values field name is a displayed, non-database form field that contains your concatenated segment values plus delimiters.
DERIVED Use DERIVED to get the derived value of segment qualifiers for a combination that someone types in. Use block.field to specify the block and field you want Oracle Application Object Library to load the derived value into. Use Segment qualifier to specify the segment qualifier name you want. Note: do not put spaces around \n, and \n must be lowercase.
Oracle Application Object Library uses the following rules to get the derived qualifier value from the individual segment qualifier values: if the segment qualifier is unique, the derived value is the segment qualifier value; for non-unique segment qualifiers, if any segment's qualifier value = N, then the derived value is N, otherwise, the derived value is Y. The only exception to this rule is for the internal SUMMARY_FLAG segment qualifier; the rule for this is if any segment value is a parent, then the derived value of SUMMARY_FLAG is Y. Oracle Application Object Library loads derived values into the combinations table qualifier column that you specify when you define your qualifier.
You do not need the three DERIVED=":block.SUMMARY_FLAG\n SUMMARY_FLAG", DERIVED=":block.START_DATE_ACTIVE\n START_DATE_ACTIVE", and DERIVED=":block. END_DATE_ACTIVE\nEND_DATE_ACTIVE" parameters for a form with a foreign key reference.
READ_ONLY This parameter prevents any updating of your flexfield, whether from shorthand alias, copy, or any other method.
DINSERT The DINSERT parameter turns dynamic inserts off or on for this form. You must set this parameter to N for flexfields within flexfields such as flexfields in a Special validation value set.
WINDOW Specify N if your flexfield contains only a single display segment and you want your users to type directly into the field, instead of into an invisible pop-up window.
ID Specify the block.field that contains the unique ID for this flexfield. The default value is "block.ID column name" where block is the current block and ID column name is the Unique ID Column Name specified for this flexfield using the Register Key Flexfield form.
REQUIRED Specify whether your user can exit the flexfield window without entering segment values.
You should specify the same value for REQUIRED in your POPID, LOADID, and VALID triggers. You do not need the REQUIRED parameter for POPID in an FND_PRE_QUERY trigger. The default value is Y.
If you specify Y, then Oracle Application Object Library prevents your user from leaving any required segment (a segment whose value set has Value Required set to Yes) without entering a valid value for that segment. Also, if your user tries to save a row without ever entering the flexfield pop-up window, VALID attempts to use default values to fill in any required segments and issues an error message if not all required segments can be filled.
If you specify Y and VALIDATE="FULL", then when your user queries up a row with no associated flexfield (the foreign key flexfield ID column contains NULL), Oracle Application Object Library issues an error message to warn the user that a NULL ID has been returned for a required flexfield. The LOADID routine also returns failure.
If you specify N, Oracle Application Object Library allows your user to save a row without ever entering the flexfield pop-up window. If you specify N, Oracle Application Object Library also lets your user navigate (without stopping) through a flexfield window without entering or changing any values. However, if a user enters or changes any segment value in the flexfield, Oracle Application Object Library prevents the user from leaving the flexfield window until all required segments contain valid values. If you specify N and a user does not open or enter values in the window, VALID allows the user to save the row whether the flexfield has required segments. In this case, VALID does not save default values as segment values for the required segments, and it does not issue an error message.
If you specify N and VALIDATE="FULL", then when your user queries up a row with no associated flexfield (the foreign key flexfield ID column contains NULL), Oracle Application Object Library validates the individual segment values returned by the query. Specify N if you want to query up non-required flexfields without getting an error message.
Note that even if REQUIRED="N", a user who starts entering segment values for this flexfield must either fill out the flexfield in full, or abandon the flexfield.
DISPLAY The DISPLAY parameter allows you to display segments that represent specified flexfield qualifiers or specified segment numbers, where segment numbers are the order in which the segments appear in the flexfield window, not the segment number specified in the Define Key Segments form. For example, if you specify that you want to display only segment number 1, your flexfield displays only the first segment that would normally appear in the pop-up window (for the structure you specify in NUM).
If you include the DISPLAY parameter in your POPID, you must include the DISPLAY parameter with the exact same argument in your LOADID and VALID calls.
The default value for DISPLAY is ALL, which makes your flexfield display all segments. Alternatively, you can specify a flexfield qualifier name or a segment number.
You can use DISPLAY as a toggle switch by specifying it more than once. For example, if you want your flexfield to display all but the first segment, you would specify:

				DISPLAY="ALL"
				DISPLAY="1" 

If you do not display all your segments, but you use default values to fill in your non-displayed segments, you must also have hidden SEGMENT1 through SEGMENTn fields in your form. You need these hidden fields because Oracle Application Object Library writes the values for all displayed fields to the concatenated values field, but does not write the values for the non-displayed defaulted fields. Since Oracle Application Object Library normally uses the values in the concatenated values field to update and insert to the database, the default values for the non-displayed fields are not committed. However, if you have the extra hidden fields (similar to a combinations form), Oracle Application Object Library writes flexfield values to those fields as well as to the concatenated segment values field. The non-displayed values are written only to the hidden fields, but are used to update and insert to the database.
UPDATE INSERT The UPDATE / INSERT parameters determine whether your users can update or insert segments that represent specified unique flexfield qualifiers or segment numbers, where segment numbers are the order in which the segments appear in the flexfield window, not the segment number specified in the Define Key Segments form.
You do not need the UPDATE and INSERT parameters for LOADID or VALID.
The default value for each is ALL, which allows your user to update/insert all segments. Alternatively, you can specify a flexfield qualifier name or a segment number. You can enter UPDATE="" or INSERT="" to prevent your user from updating or inserting values for any segments.
You can use these parameters as toggle switches by specifying them more than once. For example, if you want your user to be able to update all but the first segment, you would specify:

				UPDATE="ALL"
				UPDATE="1" 

If you use INSERT="" to prevent your user from inserting values for any segments, Shorthand Flexfield Entry is disabled for that form.
DATA_FIELD The concatenated hidden IDs field is a non-displayed form field that contains the concatenated segment hidden IDs.
DESC block.concatenated description field name is a displayed, non-database, non-enterable field that contains concatenated descriptions of your segment values. If you do not specify the DESC parameter, Oracle Application Object Library does not display concatenated segment descriptions.
TITLE window title appears at the top of the pop-up window. The default value is the Flexfield Name you specify when you set up this flexfield using the Define Key Segments form.
VDATE date is the validation date against which the Start Date and End Date of individual segment values is checked. You enter a Start Date and End Date for each segment value you define using the Define Key Segment Values form. See: Define Segment Values.
For example, if you want to check values against a date that has already passed (say, the closing date of an accounting period), you might specify that date as VDATE using a field reference (VDATE=:block.field) and compare your segment values against that date.
The default value is the current date.
NAVIGATE Specify Y if flexfields should automatically determine the navigation out of the flexfield pop-up window (that is, if your user exits the window by pressing [Next Field], then the cursor appears in the field after flexfield. Alternatively, if your user exits the flexfield by pressing [Previous Field], then the cursor appears in the field before the flexfield).
This value should be Y for POPID in a KEY_PREFIELD trigger, but is not needed for LOADID or VALID. Omit this argument for a POPID in an FND_PRE_QUERY trigger. The default value is N for backward compatibility.
AUTOPICK Specify N if flexfields should not pop up a list of values window when a user enters an invalid value.
You do not need the AUTOPICK parameter for LOADID or VALID. The default value is Y.
NUM The non-displayed database :block.field that holds the identification number of your flexfield structure. You may also specify :$PROFILES$.your_profile_option_name to retrieve a value you set in a user profile option. You can "hardcode" a structure number, such as 101, into this parameter instead of providing a field reference, but such a number prevents you from using multiple structures for your flexfield. You must use this option if you are using multiple structures.
You can use the following SQL statement to retrieve the structure identification numbers for your flexfield:

			SELECT ID_FLEX_NUM, ID_FLEX_STRUCTURE_NAME
			FROM FND_ID_FLEX_STRUCTURES
			WHERE ID_FLEX_CODE = 'flexfield code'; 

where flexfield code is the code you specify when you register your flexfield.
The default value for NUM is 101.
COPY Copies a non-null value from :block.field into the segment representing the specified flexfield qualifier or segment number before the flexfield window pops up. Alternatively, if you specify ALL, COPY copies a set of non-null, concatenated set of segment values (and their segment separators) that you have in :block.field into all of your segments. For example, if you have a three-segment flexfield, and your :block.field contains 001.ABC.05, COPY puts 001 into the first segment, ABC into the second segment, and 05 into the third segment.
The value you COPY into a segment must be a valid value for that segment. The value you COPY overrides any default value you set for your segment(s) using the Define Key Segments form. However, shorthand flexfield entry values override COPY values. COPY does not copy a NULL value over an existing (default) value. However, if the value you copy is not a valid value for that segment, it gives the appearance of overriding a default value with a NULL value: the invalid value overrides the default value, but Oracle Application Object Library then erases the copied value because it is invalid. You should ensure that the field you copy from contains valid values.
When the flexfield window closes, Oracle Application Object Library automatically copies the value in the segment representing the specified flexfield qualifier or segment number into :block.field. Alternatively, if you specify ALL, Oracle Application Object Library automatically copies the concatenated values of all your segments into :block.field.
You can specify one or more COPY parameters. Later COPY parameters override earlier COPY parameters. For example, assume you have a field that holds concatenated flexfield values, called Concatenated_field, and it holds the string 01-ABC-680. You also have a field, Value_field, that holds a single value that you want to copy into your second segment, and it holds the value XYZ. You specify:

				COPY="block.Concatenated_field\nALL"
				COPY="block.Value_field\n2" 

When your user opens the flexfield window, Oracle Application Object Library executes the two COPY parameters in order, and your user sees the values in the window as:

				01
				XYZ
				680 

After the flexfield window closes, Oracle Application Object Library copies the values back into the two fields as 01-XYZ-680 and XYZ respectively. Note that XYZ overrides ABC in this case.
You do not need the COPY parameter for LOADID or VALID, or in POPID in an FND_PRE_QUERY. The delimiter \n must be lowercase.
VRULE Use VRULE to put extra restrictions on what values a user can enter in a flexfield segment based on the values of segment qualifiers (which are attached to individual segment values). You can specify the name of a flexfield qualifier and a segment qualifier, whether to Include or Exclude the validation values, and the Message Dictionary message name for the message Oracle Application Object Library displays if the user enters an improper value. The delimiter \n must be lowercase.
For example, suppose you build a form where you want to prevent your users from entering segment values for which detail posting is not allowed into all segments of Oracle General Ledger's Accounting Flexfield. DETAIL_POSTING_ALLOWED is the segment qualifier, based on the global flexfield qualifier GL_GLOBAL, that you want to use in your rule. You want to exclude all values where the value of DETAIL_POSTING_ALLOWED is N (No). Your message name is "GL Detail Posting Not Allowed", and it corresponds to a message that says "you cannot use values for which detail posting is not allowed." You would specify your rule as:

			VRULE="GL_GLOBAL\nDETAIL_POSTING_ALLOWED\nE
			\nNAME=GL Detail Posting Not Allowed\nN" 

When your user enters an excluded value in one of the segments affected by this qualifier, your user gets the message you specify. In addition, the excluded values do not appear in the Lists of Values on your segments. All other values, not being specifically excluded, are included.
You can specify one or more VRULE parameters. Oracle Application Object Library checks multiple VRULE parameters bottom-up relative to the order you list them. You should order your rules carefully so that your user sees the most useful error message first.
VALATT VALATT copies the segment qualifier value of the segment representing the unique flexfield qualifier into :block.field when the flexfield window closes. The delimiter \n must be lowercase.
Include the same value for the VALATT parameter in your POPID (KEY_PREFIELD), LOADID, and VALID. You do not need this parameter in POPID in FND_PRE_QUERY.
USEDBFLDS Specify this parameter if your form is based on a table that has foreign key references to two or more flexfields, and if you have non-database SEGMENT1 through N fields on your form (where N is the number of segments in your combinations table). If such fields exist, Oracle Application Object Library by default will load values into them that correspond to the combination of segment values in the current flexfield. If you set this parameter to N, Oracle Application Object Library will not load the segment fields for the current flexfield. If you have more than one flexfield on your form, use this parameter to specify which one should use the segment fields (specify Y for one flexfield's routine calls, and specify N for other flexfields' routine calls). The default value is Y.
COLUMN Use COLUMN to display other columns from the combinations table in addition to the current segment columns, where n is the display width of the column. You can place the values of the other columns into fields on the current form. The value is automatically copied into the field when the user selects an existing flexfield.
For example, to display a description column called SEG_DESC and an error message from E_FLAG with the column headings DESCRIPTION and ERROR FLAG, you could set COLUMN="SEG_DESC DESCRIPTION(15), E_FLAG \"ERROR FLAG \"(*)". The (*) sets a dynamic column width, with the size determined by the value selected. If you wanted to place the description into the field block_1.field_1 and the error message into block_1.field_2, you would set
COLUMN="SEG_DESC DESCRIPTION(15) INTO BLOCK_1.FIELD_1, E_FLAG \" ERROR FLAG \"(*) into BLOCK1_FIELD_2"
You may only use 32 distinct INTO columns in your COLUMN= clause. Your maximum width for additional columns is 240 characters.
WHERE Specify a WHERE clause to customize which code combinations to display in the combination-level List of Values pop-up window. Normally, the List of Values displays a combination-level List of Values of all current valid combinations, instead of a single-segment List of Values, when the validation type of the segment's value set is NONE.
This argument also prevents a user from selecting a combination that does not fit the WHERE clause. In the case of a single-segment flexfield where the segment uses a validated value set, this may have the effect that a user will initially see all values in the List of Values (the segment-level List of Values), but then will get an error message if the value chosen is not already an existing combination (as well as being a valid individual segment value) if dynamic inserts are not allowed.
You should use this token with flexfields that do not allow dynamic inserts, either using DINSERTS="N" or preventing dynamic inserts at the structure level. Do not specify the word "WHERE" in this where clause argument.
SET Specify the :block.field that holds the set identifier for your flexfield. SET specifies which set of code combinations to use for this flexfield. For each flexfield structure, you can divide code combinations in your combinations table into sets (for example, parts with high prices, medium prices, and low prices). You can only use SET if you implement a structure defining column (that is, you must specify NUM). The default for SET is your structure number (as specified in NUM). If you use SET, your application must maintain a separate table that contains the correspondences between sets and key flexfield structures. For example, your correspondences table could contain values such as:
If you use SET, Oracle Application Object Library stores the set number in the structure defining column instead of the structure number. Note that you cannot have duplicate set numbers in your correspondences table, though you can have more than one set number for a given structure number. You must derive SET and NUM from different :block.fields (or profile options, or "hardcoded" numbers) since they are distinctly different numbers.
If you have a flexfield query-by-example POPID in a FND_PRE_QUERY trigger, you should add an extra step to copy the set number (SET) in addition to the step that copies the structure number (NUM).
Specify the same value for SET in POPID, LOADID, and VALID.
ALLOWNULLS Determines whether NULLs should be allowed into any segment. ALLOWNULLS overrides the value set definition (Value Required is Yes) for each segment only if you specify PARTIAL or NONE for the VALIDATE parameter.
QUERY_ SECURITY Determines whether flexfield value security applies to queries as well as inserts and updates. If you specify Y, your users cannot query up existing code combinations that contain restricted values. If you specify N, your users can query and look at code combinations containing restricted values. Users can update the restricted values to non-restricted values, but they cannot enter restricted values or update values to restricted values. The default value is N. This option has no effect unless your users have enabled and defined flexfield value security for your flexfield's value sets (using the Define Value Sets form, the Define Flexfield Security Rule form, and the Assign Flexfield Security Rules form).
Put this option in your LOADID call only. You do not need QUERY_SECURITY in POPID or VALID.
QBE_IN Controls the type of subquery Oracle Application Object Library uses to select the desired rows in flexfield query-by-example.
Use this option only in a POPID in an FND_PRE_QUERY trigger. Do not use in POPID in your KEY_PREFIELD trigger or in LOADID or VALID. The default value is N.
If you specify N, Oracle Application Object Library generates a correlated subquery. This query is effectively processed once for each row returned by the main query (generated by the rest of the form), and it uses the code combination ID as a unique index. Choose N if you expect your main query to return a small number of rows and you expect your flexfield query-by-example to return many rows.
If you specify Y, Oracle Application Object Library generates a non-correlated subquery using the "IN" SQL clause. Oracle Application Object Library processes the query only once, but returns all the rows in your combinations table that match your flexfield query-by-example criteria. Choose Y when you expect your main query to return many rows and you expect your flexfield query-by-example to return a small number of rows (less than about 100). Such a condition usually corresponds to a small number of rows in the combinations table and many rows in the application table. For example, assume you have a Part Flexfield, where your company handles only a limited number of parts (say, 75), but you have thousands of orders for your parts (and a correspondingly large Orders table). For this case, choosing Y would greatly improve your application performance on flexfield queries-by-example.
LONGLIST Specify Y or N to allow using LongList with this flexfield. LongList allows users to specify a partial value when querying a flexfield combination.
NO_COMBMSG If you wish to display your own message when a user enters an invalid combination, specify the message name here. Otherwise flexfields uses the standard Application Object Library Message.


         Previous  Next          Contents  Index  Navigation  Glossary  Library