Chitika Add

Tuesday, August 30

Making field as mandatory using Forms Personalization


Note : this example has been taken from "http://easyoracleapps.blogspot.com/search/label/Forms%20Personalization"

For quite some time I was thinking about publishing an article about forms personalization in Oracle HRMS.
The Metalink note on Forms Personalization is helpful, but what it lacks is a pictorial approach to implementing
Forms Personalizations. I am a visual animal, so I like to explain in that manner too.

My first article in the series of Forms Personalization is in response to a question raised in Oracle Forum under Oracle Human Resources (HRMS ). As per the Oracle forum request, If the Person Type is Employee, their clients wants Person Title field to become Mandatory ( lets assume it is the title field for now).  When the Person Type field changes to a value that is anything but Employee, the person title field should then toggle back to become optional.

Please note that when Person type Employee is selected, value in field
PERSON.D_PTU_USER_PERSON_TYPE  is assigned a value of “Employee”

Now the requirement is that for “Employee” field PERSON.D_TITLE must be made mandatory.

There are two possible ways the Person Type can change.
Either by picking a dropdown list of Action (e.g. Create Employee) or by directly picking up a value from LOV on field “Person Type for Action”. Whenever the person type changes, WHEN-NEW-ITEM-INSTANCE is fired for one for the below fields(depending upon how its changed).  Hence forms personalization must check conditions for below three fields
PERWSHRG.PERSON.PTU_ACTION_TYPE
PERWSHRG.PERSON.D_PTU_USER_PERSON_TYPE
PERWSHRG.PERSON.SHOW_NUMBER

The demo below contains conditional check on “WHEN-NEW-ITEM-INSTANCE” of PERSON.PTU_ACTION_TYPE

When implementing this, you will have to replicate the steps in the demo for WNII on both PERWSHRG.PERSON.D_PTU_USER_PERSON_TYPE & PERWSHRG.PERSON.SHOW_NUMBER

I have tested the steps below myself, and they appear to work.

OK, here we go.....

STEP 1
Create Personalization as below( to make Title field mandatory)
Sequence: 50
Description: Make Person Title Mandatory when Person Type is Employee.
Trigger Event: WHEN-NEW-ITEM-INSTANCE
Trigger Object: PERSON.PTU_ACTION_TYPE
Condition: ${item.person.d_ptu_user_person_type.value} = 'Employee
Check if Person Type is Employee in When New Item Instance
Check if Person Type is Employee in When New Item Instance


Action Sequence: 10
Action Type: Property
Action Object Type: Item
Action Target Object: PERSON.D_TITLE
Action Property Name: REQUIRED
Action Value: TRUE
Make Title mandatory when Person Type is Employee
Make Title mandatory when Person Type is Employee



STEP 2
Create another Personalization as below ( to make Title field Optional)
Sequence: 51
Description: Make Person Title Mandatory when Person Type is Employee.
Trigger Event: WHEN-NEW-ITEM-INSTANCE
Trigger Object: PERSON.PTU_ACTION_TYPE
Condition: NVL(${item.person.d_ptu_user_person_type.value},'xxyyzz') != 'Employee'
Check if Person Type is anything other than Employee in When New Item Instance
Check if Person Type is anything other than Employee in When New Item Instance
 

Action Sequence: 10
Action Type: Property
Action Object Type: Item
Action Target Object: PERSON.D_TITLE
Action Property Name: REQUIRED
Action Value: FALSE
Make Title option when Person Type is not Employee
Make Title option when Person Type is not Employee

2 comments:

divya said...

Hi Jithendra,

Read your article on forms Personalization.

Its amazing!! Good Job!!

I have one doubt regarding forms personalization.

My requirement is, if user selects Type as 'EMPLOYEE' then user should not be allowed to enter a new record and if type is anything other than 'EMPLOYEE' user would be able to enter a new record.

How to achieve this. Please Guide.

My email ID is kotwani.div@gmail.com

Thanks in Advance.

Regards,
Divya

divya said...

HI Jithendra,

I read your Article on forms Personalization. Its Amazing!!

My Requirement is if user selects Person Type to be 'EMPLOYEE' then user would not be allowed to enter a new record, but if type is anything other than 'EMPLOYEE' he would be able to enter a new record.

Please guide how to achieve this.