Project and Portfolio Management Support and News Forum
Showing results for 
Search instead for 
Do you mean 

Auto populate field based on another field selection

Occasional Contributor

Auto populate field based on another field selection

Seems like the best way to do this would be a rule, but not sure what the sql statment should be.
3 REPLIES
Honored Contributor Honored Contributor

Re: Auto populate field based on another field selection

The simplest case would be something like:

select 'x','x' from dual

For more complex cases, you can include a decode function, union clauses, case statements or other sql stuff that meet your needs. You can also pull data from any fields in any defined tables, like:

select user_data1,visible_user_data1 from knta_users where user_id=[SYS.USER_ID]
Highlighted
Occasional Contributor

Re: Auto populate field based on another field selection

Thats the way we have it now, I gues I just need to create a rule for each condition?
Honored Contributor Honored Contributor

Re: Auto populate field based on another field selection

One rule per condition is one option. Another would be to use a decode function:

select decode('[REQD.VP.FIELD1]','value1','newvalue1','value2','newvalue2', ... ,'default'), from dual

Other variations are useful in some cases. It depends on how the field values are related and what kind of algorithm you can design to get from one to the other.