How to select a default year in my messagechoice, after new record
Hi,
How can I select the year we are in now when a user creates a new record.
The user goes to an empty UIX form, there is a year field, which is a
messageChoice with Enumeration Mode, containing a list of years.
I want to pre-select 2006 when the user creates a new record.
I've added the following code to my entityImpl.java class
public Number getYear() {
Number year = (Number)getAttributeInternal(YEAR);
if (year == null) {
Calendar c = Calendar.getInstance();
int y = c.get(Calendar.YEAR);
year = new Number(y);
//setYear(year);
return year;
}But my form complains there is a null value for year, if I select another year
it works.
If I enable the setYear, its starts complaining all other fields are null.
I also tried it on database level, having a default for year, but my form doesnt
know about it...
TO_NUMBER(TO_CHAR(SYSDATE, 'yyyy'))
So how Can i accomplish this?
thanks in advance
ido
anyone.... ?
Similar Messages
-
How to Select each check box values in a group of records
Hi,
I have a requirement in forms 10g. In that form there are 10 records are displaying each record has one check box is there if i click the check box on record number one and record number three and do some changes in the text field(adjustment field is number data type) then finally I want to see the total on one field called total amount.
In this my question is how to select particular records in a group of records? and finally these selected records are inserted into one table.
Because I am not able to fetch these records at a time.
Is there any Array to define a record group to fetch each of them individually for example Rec[1],Rec[2]...like that if yes please suggest me the steps how to do this.
Thanks in advance
Prasanna
Edited by: user10315107 on Dec 17, 2008 11:44 PMI'm sorry, but i didn't get your requirement in detail.
Do you want to do the summing of the selected records in forms ? Or do you just want to know which records are selected and then process them?
If you want to process the selected records in sql you could use an object-type to store the list of id's (of whatever primary key you use), loop over the block to fill it, and then afterwards process them.
For this approach, first create an object-type in the database:
CREATE OR REPLACE TYPE ID_LIST AS TABLE OF NUMBER;
/Then, in forms you could do something like this to fill a list of id's:
DECLARE
lIds ID_LIST:=ID_LIST();
BEGIN
GO_BLOCK('MYBLOCK');
FIRST_RECORD;
LOOP
EXIT WHEN :SYSTEM.RECORD_STATUS='NEW';
IF :BLOCK.CHECKBOXITEM="CHECKEDVALUE" THEN
lIds.EXTEND(1);
lIds(lIds.COUNT):=:BLOCK.PRIMARYKEYITEM;
END IF;
EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
NEXT_RECORD;
END LOOP;
-- Now you can use the object-list in SQL like :
INSERT INTO MYNEWTABLE (cols..)
SELECT (cols..)
FROM MYOLDTABLE
WHERE ID IN (SELECT COLUMN_VALUE FROM TABLE(lIds));
END;Edited by: Andreas Weiden on 18.12.2008 18:17 -
How to create a popup form applet to create a new record
Hi,
I have a requirement where on button click a popup form applet should open in new record mode by default. I will then enter details in that popup applet & on clicking the "Submit" button on that applet, the data gets saved to the corresponding table.
I tried following options:
1. Created a new control(button) on parent applet & specified the popup applet detail in its user property.
Mode - Edit
Popup - <name of the new popup applet>
Popup Dimension - 500*300
This configuration opens the new popup applet on button click but its in edit mode with the data of parent applet showing in it.
2. modified the configuration to -
changed the mode to "New".
In the applet definition web template for the Edit web template,chosen mode type as New and for Edit list web template chosen the mode type as edit list.
However, couldn't achieve what is intended. pls help.
ThanksOn Click on New button , you can invoke an applet based on VBC using showpopup and when the ok button is pressed , you can insert the record to the base bc.
Regards,
Vinod Nair -
How to select dates by year?
Hi,
Lets say I have a table(itemID, datePurchase, itemPrice)
and I want to list the sum of itemPrice based on the year of datePurchase.
eg. I want the total amount spent in the year 2007
DATEPURCHASE ITEMPRICE
04-OCT-07 300
07-NOV-07 250
17-JAN-08 125
16-NOV-08 250
27-NOV-08 250
17-DEC-09 200
How do I filter the date out by year?
Regards,
KeithHi,
Welcome to the forum!
If you're hard-coding the target date, you can do something like this:
SELECT SUM (itemprice) AS total_price
FROM table_x
WHERE datepurchase >= DATE '2007-01-01'
AND datepurchase < DATE '2008-01-01'
;If the year is in a variable, then you'll want something more like this:
VARIABLE year_wanted VARCHAR2 (4)
EXEC :year_wanted := '2007';
SELECT SUM (itemprice) AS total_price
FROM table_x
WHERE datepurchase >= TO_DATE ( year_wanted || '-01-01'
, 'YYYY-MM-DD'
AND datepurchase < TO_DATE ( year_wanted || '-12-31'
, 'YYYY-MM-DD'
) + 1
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ {message:id=9360002}
Edited by: Frank Kulash on Oct 4, 2012 12:18 PM
Added keyword DATE to date literals. -
How to select a default value in a DropDownByIndex
Hi,
I have a dropdownbyindex in a table. I need to make default selection of an item in the dropdown.
I have prepopulated dropdown from bapi result, "1", "2", "3", "4". I have another bapi result which gives me a selected value "2". I need to default this to the dropdown when my page gets loaded.
1st bapi result - (model nodes)
_input
_output
_list
attribute (1,2,3,4) (list of elements)
I have a context node created for the table items.
nodeitems
str (2) -element to be defaulted.
I am writing this code:
int lead = 0;
for(int i = 0; i < X.size; i++){
IWDNodeElement elem = wdContext.nodeDataNode().getElementAt(i);
if(X.equalsIgnoreCase("2"))
lead = i;
break;
wdContext.nodeX.setLeadSelection(lead);
For size of X, I am taking
nodeInput.nodeOutput.nodeList.size()
But this gives me size of thelist 0 whereas it is populating the whole list.
Hope I have made it clear.
Please help.
ThanksCardinality Selection Singleton
_input - 0..n 0..1 true
_output - 0..1 0..1 true
_list - 0..n 0..1 true
nodeItem - 0..n 0..1 true
Thanks -
How to load a default prefereces when a create a new profile
i need disable access for a urer creates a new profile in firefox. if it not possible block a profiler manager in firefox, other solution is when user create a new firefox profile, it load defaults preferences
hello, probably the best solution in this case is to use the ''mozilla.cfg'' file to lock certain preferences - it will work regardless of which profile is used. for more information about how to implement it please see http://kb.mozillazine.org/Locking_preferences
-
How to enable the default pdf viewer of firefox after installing acrobat 11?
I installed acrobat 11, and i dont like its pdf viewer add-on, so i want to switch back to firefox's default pdf viewe, but i cant change the action in the application option to preview in firefox. i also tried disabling the acrobat plugin.
Firefox 27, windows 8.1,thanks for the help.
-
SO FRUSTRATED SOMEONE SAVE ME PLEASEEE
What have you tried so far?
What problems are you having?
All you need to do is
Sign in to creative.adobe.com with your Adobe ID.
Download the Cloud app
Download your subscription apps -
Cannot select my fonts in Photoshop en InDesign after new install of CS 4
After a new install of CS4 I cannot select the fonts I installed in the Windows fonts folder. What to do?
I cannot find a adobefnt*.lst.
Where should it be? In the Adobe InDesign folder? Or?
I installed all my fonts in the windows font folder. Before the new install (my HD crashed) of CS4 I had no problem with selecting any of the fonts. -
How to set a default value in my DropDown using the key ?
Hello All,
Can someone advose how I can achieve the above ? I will like to know how to select a default value for the dropdown by key using the key value instead of description.
The reason why I need to do so instead o fusing description is because my application will populate the dropdown using web services based on the language selection. Hence, if I were to set the default value using description, den other languages will not work anymore.
Any help will be greatly appreciated. Thank you !!
from
KWok WeiKwok,
Assuming that:
1. You have a node NodeX, where attribute TargetAttr defined
2. You have a DropDownByKey UI control, its property selectedKey bound to NodeX.TargetAttr attribute
Then:
Place in your code:
wdContext.currentNodeXElement().setTargetAttr("yourKey");
VS
P.S. This topic was raised several times, and forum search works good enough to find an answer -
MD07 : vendor selection by default
Hi expert,
I'll give you points if you tell me how to select by default vendor in MD07.
Thanks a lot !in md07
on the vendor field, selcet f1, then click on technical details...in this subscreen you can see technical details...ypu can see a field - parameter...
If it is available, take that parameter field name and goto your user details in Su01
in userv parameter in your user details...enter this field and maintain value,,,what you want to defaiult as vendor...
pl come back if required -
How can we add the years, in Application Profile.
Hi Experts,
I have a doubt regarding the Application Profile in HFM, Here My question is, How can we add the years to application profile, After once created and attached with one application and the application is going on for past 2 years, now the requirement is add the years to application profile HFM.
1. Is there any rule required for this?, If there is a rule, please explain the rule.
Thanks & Regards.
RajaKKHi RajaKK
The below mentioned article might be helpful to you.
How to Add Additional Years to the Year Dimension in an HFM Application (Doc ID 1287575.1)
If you are in 11.1.2.1. version the utility would be available in the below location by default.
C:\Oracle\Middleware\EPMSystem11R1\products\FinancialManagement\Utilities\FMChangeNumberOfYearsForApp_x64.exe
Hope this helps,
Thank you,
Charles Babu J -
How to set a Default Value in the drop down on Account Creation ?
Hi,
i have to set a default value in the drop down as soon as a User in a particular business role clicks on New Account. I have written the following code in do_prepare_output method. But this code is executed in the 2nd server round trip after entering some value or pressing enter. so i am not getting as soon as user clicks on the New Account.
How to set that default value when user clicks on New Account ? and where should i code ?
IF lv_icwc_profile = 'ZCSALESPRO' or lv_icwc_profile = 'Z_SALESPRO' .
try.
lr_entity ?= me->typed_context->header->collection_wrapper->get_current( ).
lv_current = lr_entity->create_related_entity(
iv_relation_name = 'BuilRolesRel' ).
lv_current->set_property(
iv_attr_name = 'PARTNERROLE'
iv_value = 'BUP002' ).
CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
cx_crm_genil_model_error.
return.
ENDTRY.
Thanks and Regards
Raman KhuranaHi,
I have some idea abt it, it is also used in account life cycle.
Please refer SAP note 1097651, Defaulting a life cycle stage.
Let me know if useful.
rgds,
Vinay -
Using combination of insert into and select to create a new record in the table
Hello:
I'm trying to write a stored procedure that receives a record locator parameter
and then uses this parameter to locate the record and then copy this record
into the table with a few columns changed.
I'll use a sample to clarify my question a bit further
-- Create New Amendment
function create_amendment(p_mipr_number in mipr.mipr_number%TYPE, p_new_amendment_number in mipr.amendment_number%TYPE)
return integer is
new_mipr_id integer;
begin
THIS is causing me grief See comments after this block of code
insert into mipr
(select mipr_id from mipr where mipr_number=p_mipr_number),
(select fsc from mipr where mipr_number=p_mipr_number),
45,
(select price from mipr where mipr_number=p_mipr_number),
practical,
(select part_number from mipr where mipr_number=p_mipr_number);
THe above will work if I say the following
insert into mipr
(select * from mipr where mipr_number=p_mipr_number);
BUt, Of course this isn't what I want to do... I want to duplicate a record and change about 3 or 4 fields .
How do I use a combination of more than one select and hard coded values to insert a new record into the table.
/** Ignore below this is fine... I just put a snippet of a function in here ** The above insert statement is what I need help with
select (mipr_id) into new_mipr_id from mipr where mipr_number=p_mipr_number + amendment_number=(select max(amendment_number) + 1);
return new_mipr_id;
end;
THANK YOU IN ADVANCE!
KTfunction create_amendment(p_mipr_number in mipr.mipr_number%TYPE)
return integer is
new_mipr_id integer;
tmp_number number;
tmp_mipr_id integer;
begin
tmp_number :=(select max(amendment_number) from mipr where mipr_number=p_mipr_number);
Question:
tmp_number :=1; works..
tmp_number doesn't work with the select statement?
Obviously I'm a novice! I can't find anything in my book regarding tmp variables... What should I look under is tmp_number a
variable or what? In my Oracle book, variable means something different.
Thanks!
KT
I have the following code in my stored procedure:
Good luck,
Eric Kamradt -
How do I know where all( in which tables) the new records are created when I've updated a field in a Table.
I've updated a field it displayed. actually it updated only one row in my original table
1 row effected.
1 row effected
1 row effected.
1 row effected.
four times.
So I realized and seen the triggers defined for that table, then also I was able to find only one record inserted in a different table through record.
How to know all the tables where all my update ...cause to insert records.do you've a common field between tables or an audit column like datemodified? If yes, you can use them to find out recently inserted records from the affected tables.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
Maybe you are looking for
-
Multiple gamecenter accounts on one apple id
Before IOS 7 I was able to have multiple gamecenter accounts under one appleID. One for my phone and anohter for my son on his ipad. I have not figured out how to get his gamecenter account up and running again without settign up a new apple id, wh
-
Windows firewall needs turned on to install in Windows 7-wireless install
HP Photosmart Premium Fax e All in one printer c410A 1. Lost abilty to connect with printer & Diagnostics say to reinstall. 2. I am installing latest version, and have followed all steps meticulously but in order to install it says I have to have w
-
I have very slow internet even though my provider says the speed is fast
I am experiencing very slow internet even though my provider says that my speed is fast. The uploading of a page takes long to complete
-
Stucked in recovery mode?
During atualizaçao of Itunes my ipad stucked on recovery mode. What can i do?
-
I've tried deleting my songs but it didn't work. It worked last time. Sliding it wont work anymore. I've spent hours trying to figure out how to delete songs.