After completing this module, you should be able to do
the following: Invoke the Personalizations form Understand the basic structures : Rules, Context, and Actions Make simple changes like changing prompts and hiding objects Select objects by their current on-screen text Get the current value for properties Apply changes immediately to test their effect Disable personalizations
If you are not familiar with the basic construct of an
Oracle Developer form, including terms such as block, record, item, trigger, property and builtin, you should consider a course such as Oracle Developer: Forms Fundamentals, offered by Oracle University. The viewlet Oracle Applications Form Personalization Demonstration shows many of the concepts included in this module.
Agenda Overview of Form Personalization Rules and Conditions Context Actions Working with Strings Getting it right Putting it all Together Limitations Relationship to CUSTOM library Summary
All customers wish to: Remove fields, buttons, tabs, etc. from the screen because they never use them Re-label fields, buttons, tips to match their terminology Change the default value of fields Allow easy access from one form to another, passing context Do any of the above for only a particular user or responsibility Do any of the above only if certain conditions are true. Do all of the above without writing code, and without violating Support agreements
WARNING! Form Personalizations allows you to fundamentally alter the behavior of the product that Oracle ships, and access any and all data. Therefore, This feature should only be made available to trusted users. Avoid building Personalizations on a production system. – Form Personalizations should first be entered and thoroughly QA’ed on a test system before they are loaded to a production system
Select Help > Diagnostics > CustomCode > Personalize from the pulldown menu – Profiles ‘Utilities: Diagnostics’ and ‘Hide Diagnostics menu entry’ control access to this entry The Personalizations screen will now run – It will automatically query any rules if they exist for that function
Context , continued Context controls who personalizations apply to: Level: Site, Responsibility, Industry, or User Value: The specific value when level is Responsibility, Industry, or User At runtime, if the user’s context matches any context of a rule, that rule is executed.
Actions , continued Actions determine what the personalization does: Seq: an ordering from 1 (first) to 100 (last) Type: Property, Message, Builtin, or Special – Depending on the Type, the panel will change to show additional fields Description: allows you to record why you are making the change Language: a list of installed languages, and ‘ALL’ – An action associated with a specific language will only be executed in the context of that language Enabled: used to temporarily disable an action
Select By Text…: choose an object by it’s onscreen text Object Type and Target Object: internal identifier of the object Property Name: the property to change Value: the new value Get Value: extract the current property value into the Value field
Menu Entry: SPECIAL1 through SPECIAL45 Menu Label: the text for the menu entry Render Line before menu: will draw a line above the menu entry Enabled In Block(s): the blocks for which the menu entry should be enabled. – Leave blank for all blocks. Icon Name: the name of a .ico file
Working with Strings Every property that takes a string can work one of two ways If the string you type does not start with ‘=’, then it be used exactly as you typed it If the string you type starts with ‘=’, then it will be evaluated at runtime. You can refer to: – bind variables, like :block.field – SQL operators, such as ||, TO_CHAR(), DECODE(), and NVL() – Server-side functions that do not have OUT parameters
Getting it right Various features and functions are available to assist you: Trigger and Target Objects are validated ‘Add <object>’ buttons: allow you to select objects within the form using lists ‘Apply Now’: applies the current action immediately so you can see it’s effect ‘Validate’: for fields that support string evaluation, processes it immediately: – ‘Condition’ will return True, False, or an Error – ‘Value’ will return the resulting string, or an Error Add messages of Type ‘Debug’ – They will only display when ‘Show Debug Messages’ is checked
Getting it right, continued It is possible that a change you make completely breaks a form, to the point that it will not even run! Here’s how to recover: On the pulldown menu, choose Help > Diagnostics > Custom Code > Off – This will disable all callouts to Forms Personalization Run the form of interest – It should run now, because your changes were skipped Invoke the Personalization screen and correct the problem On the pulldown menu, choose Help > Diagnostics > Custom Code > Normal to re-enable processing of Personalizations
Putting it all Together This is a step-by-step example of changing a prompt. In this case, we will modify the 'Users' form, and change the prompt ‘User Name’ to ‘Clerk Name’: Open the Users form Select Help > Diagnostics > Custom Code > Personalize from the pulldown menu. Create a rule with the following values: Seq: 1 Description: Change prompt of User Name Accept the defaults for all other values of the Rule and Context
Putting it all Together, continued Select the Actions Tab and enter the following values: • Seq: 1 • Press the ‘Select By Text’ button and choose the ‘User Name’ row from the LOV • Property Name: PROMPT_TEXT • Value: Clerk Name Accept the defaults for all other values of the Actions 3. Save 4. Activate the Users form, then close it. 5. Re-open the Users form. You should see that the prompt is now ‘Clerk Name’. 6. To disable this Rule, set Enabled to unchecked (at either the Rule or Action level), or just delete the Rule, then Save.
Limitations Although it is faster than a speeding bullet, it is not able to leap over tall buildings: You can only change what Forms allows at runtime: – Cannot create new items – Cannot move items between canvases – Cannot display an item which is not on a canvas – Cannot set certain properties – Cannot change frames, graphics, boilerplate You can only respond to certain Trigger Events: – WHEN-NEW-FORM-INSTANCE, WHEN-NEW-BLOCK- INSTANCE, WHEN-NEW-RECORD-INSTANCE, WHEN- NEW-ITEM-INSTANCE – WHEN-VALIDATE-RECORD (not in all forms) – Product-specific events
product code Expected user is an Admin/Developer – Knowledge of Oracle Developer is extremely desirable – Knowledge of PL/SQL, Coding Standards and/or APIs required in some cases Normal rules for customizations apply – Extensive testing in a Test environment is required!
receives Trigger Events. Customers are free to add any code they like to it. CUSTOM and Form Personalizations drive off the same Trigger Events – Form Personalizations are processed first, then the event is sent to CUSTOM CUSTOM can do more because it has complete access to all PL/SQL and SQL But for most changes, Form Personalizations is adequate and is significantly simpler.
Summary In this module, you should have learned how to: Invoke the Personalizations form Build a Rule and Action Select objects by their current on-screen text Make simple changes like changing prompts and hiding objects Get the current value for properties Apply changes immediately to test their effect Disable personalizations