Home » Developer & Programmer » Forms » Initial value should be dynamic based on the available list element months (EBS R12.1.3,Forms 10g.)
Initial value should be dynamic based on the available list element months [message #618608] Mon, 14 July 2014 04:37 Go to next message
afzaa2yahoocom
Messages: 24
Registered: April 2011
Location: Dubai
Junior Member
Hi All,
We are using E-Business Suite R12.1.3
Forms 10g.
Database 11g.

I have a list item field in custom form, where I have all the months entered in the list manually.

I want initial value(month) to be populated auto based on the sysdate. eg: July (from the list)
Thanks in advance.



Tested when-new-item-instance as :XXFUJOTHRS.OT_MONTH := 'فبراير';--arabic text for February month name.
(All the names of months in the list are in arabic) FRM-30188: No initial value given, and other values are not allowed (item XXFUJOTHRS.OT_MONTH).

Regards,
Afzal.

Re: Initial value should be dynamic based on the available list element months [message #618609 is a reply to message #618608] Mon, 14 July 2014 04:49 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
List items have two sets of values - the values they display and the value they store.
When you want to assign a value to a list item you need to specify the value stored.
Judging from the error message you're probably trying to set it to the value displayed.

[Updated on: Mon, 14 July 2014 04:49]

Report message to a moderator

Re: Initial value should be dynamic based on the available list element months [message #618610 is a reply to message #618609] Mon, 14 July 2014 04:57 Go to previous messageGo to next message
afzaa2yahoocom
Messages: 24
Registered: April 2011
Location: Dubai
Junior Member
Hi
Thanks for the reply.

Tested with when-new-item-instance as :XXFUJOTHRS.OT_MONTH := 02;
getting blank in the field.

Regards,
Afzal.
Re: Initial value should be dynamic based on the available list element months [message #618611 is a reply to message #618610] Mon, 14 July 2014 05:03 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Is 02 a valid value?
Re: Initial value should be dynamic based on the available list element months [message #618612 is a reply to message #618611] Mon, 14 July 2014 05:04 Go to previous messageGo to next message
afzaa2yahoocom
Messages: 24
Registered: April 2011
Location: Dubai
Junior Member
Yes it is.
It stores normally in backend as 02 for feb month.
Kindly suggest what trigger, code need to use to get the same.

Regards,
Afzal.
Re: Initial value should be dynamic based on the available list element months [message #618646 is a reply to message #618612] Mon, 14 July 2014 10:36 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Did you try to move
:XXFUJOTHRS.OT_MONTH := '02';  -- you are missing single quotes in your example
into a WHEN-NEW-RECORD-INSTANCE trigger instead? Because, WHEN-NEW-ITEM-INSTANCE trigger won't fire if user passes through that item (i.e. doesn't stop to enter a value).
Re: Initial value should be dynamic based on the available list element months [message #618713 is a reply to message #618646] Tue, 15 July 2014 00:43 Go to previous messageGo to next message
afzaa2yahoocom
Messages: 24
Registered: April 2011
Location: Dubai
Junior Member
Resolved the issue as below.

1. Kept initial value as 'January' --in arabic actually as it is in item list.
2. Under block trigger, when-new-record-instance
gave :XXFUJOTHRS.OT_MONTH := TO_CHAR((to_date(trunc(sysdate),'DD-MON-YYYY')),'MM');--'02';

Thanks a lot to all of you.

Regards,
Afzal.

Re: Initial value should be dynamic based on the available list element months [message #618817 is a reply to message #618713] Tue, 15 July 2014 17:03 Go to previous message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
This:
TO_CHAR((to_date(trunc(sysdate),'DD-MON-YYYY')),'MM')

Is just wrong and will give an error, or even the wrong result, if you change your NLS_DATE_FORMAT.
sysdate is a date, trunc(sysdate) is also a date.
to_date does not accept a date parameter.
So oracle has to implicitly to_char the date before to_dateing it.

The above should simply be:
to_char(sysdate, 'MM')
Previous Topic: Non Base Table detail Block
Next Topic: Query with DD and month only.
Goto Forum:
  


Current Time: Fri Apr 26 20:09:42 CDT 2024