Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Issue with apex.item( ).setValue( "*" ) and submit page

Wim MeysDec 16 2016 — edited Dec 19 2016

Hi

I'm building a form with several fields to be inserted.

Depending on the value of field with select-list, some values need to be defaulted to *

For this I used a a dynamic action like this.

p1.png

p2.png

The Javescript code looks like this.

var RuleCode = apex.item( "P321_RULE_CODE" ).getValue();

if ( RuleCode == 'STD') {
apex.item( "P321_SRC_SEC_ZONE_CODE" ).enable();
apex.item( "P321_SRC_SEC_ZONE_CODE" ).setValue( "" );
} else if ( RuleCode == 'EXC' ) {
apex.item( "P321_SRC_SEC_ZONE_CODE" ).disable();
apex.item( "P321_SRC_SEC_ZONE_CODE" ).setValue( "*" );
} else {
apex.item( "P321_SRC_SEC_ZONE_CODE" ).disable();
apex.item( "P321_SRC_SEC_ZONE_CODE" ).setValue( "" );
}

The setting and enabling & disabling of the fields works as supposed.

But when I press submit to create the records, it gives an error that the field doesn't have a value set.

> ORA-01400: cannot insert NULL into

p3.png

What am I missing?

I also tried this.

apex.item(document.getElementById('P321_SRC_SEC_ZONE_CODE')).setValue('*');

$s( "P321_SRC_SEC_ZONE_CODE", "*" );

Any help is welcome.

thx

cheers

Wim

This post has been answered by Tom Petrus on Dec 16 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 16 2017
Added on Dec 16 2016
6 comments
1,117 views