Default value of form

How can I use a query or custom function to retrieve a forgein key field to be the default value of a field. Also, the types are different. Here is my example:
table: addresses
address varchar2(100);
city varchar2(30);
state number(10);
table: states
id number(10);
description varchar2(50);
I want to create a form on table ADDRESSES and have the state not a list of values, but a read only field that displays the contents of the description field of STATES. How can I do this? I have tried to work with default value but don't know how to reference the STATE value in a query in the default value textbox and when I get any value (select 'OK' from dual), it complains that it cannot convert 'OK' to a number.
Any thoughts? Thanks in advance.

Please give some Information as how are you planning to get the description for the field as when you will open the form based on address table ,which description (I mean for which state) you wish to get,as there will be no way to find the address in a fresh form.

Similar Messages

  • How to change default value in form

    Hi,
    I want to change the default value in form..how can i do this?
    Fo exa...in purchasing when we go to auto create..in action tab we see create been defaulted whenever we open the form and also there is one more option called add to...so whenever i open this form..i want to see add to there..
    How can we get this?please advise?
    Thanks
    Mahendra

    You can do it using forms personalization.

  • Default Value to Form using Custom Library?

    In Custom Form A, in the global variables i have store the value , How to populate default value to Form B using in custom library.
    I tried using COPY, but its not working?
    COPY('GLOBAL.EXP_PRO',':IT_QF.PROJECT_NUMBER');
    Is their any other way to do it?
    Thanks!

    Zaafran Ahmed  Posted: Oct 26, 2010 2:05 PM
    COPY(:GLOBAL.EXP_PRO,'IT_QF.PROJECT_NUMBER');user12207320 Posted: Oct 26, 2010 2:40 PM
    I tried it throws a error,bad bind variable error >
    This will throw an error because the COPY built-in takes 2 Varchar2 parameters (Source and Destination). When you use the COPY built-in, you pass references to the objects not the objects themselves. Therefore, the reference to the global variable :GLOBAL.EXP_PRO would have to be passed as a string to COPY.
    Looking at your original post, you have a COLAN in the destination string. Try the following:
    COPY('GLOBAL.EXP_PRO',':IT_QF.PROJECT_NUMBER');
    /* Change this statement to: */
    COPY('GLOBAL.EXP_PRO','IT_QF.PROJECT_NUMBER');Craig...

  • Unable to populate the default value  using form personalization

    Hi, I need to default a value in order managemnt for waybill number
    shipping -- transaction - delivery - detail --
    In Order management
    Shipping - Transactions
    Source system -- Order management
    From Order number - Any ordernumber
    say find
    I want to default this Detail ( xxxxx) as Way bill
    value of :DLVB.DETAIL_LABEL
    I have put the following condition on form personalization
    Condition tab
    Triger event
    When new record instance
    Trigger object
    dlvy_s
    Processing mode both
    Actions tab
    Property
    Object type Item
    Target Object DLVY_S.WAYBILL
    Property name Value
    Value
    :DLVB.DETAIL_LABEL
    but it is not defaulting... Appreciate if any one has idea what is wrong in this.
    Edited by: 885022 on Oct 3, 2011 11:31 AM
    Edited by: 885022 on Oct 3, 2011 11:33 AM

    yes Srini
    as we dont have any option via personalization to set the default values ,it can be done through controller extension ,
    in processRequest method of extended controllere get the control for that particular field where u want to set the default value and set the value using fieldbean.setValue(pagecontext,value);
    in case of any particular case ,please post in the forum
    thanx
    Pratap

  • Setting default value for form field assoc with a table column

    On a "Create Record" situation I was trying to set the default values of some form fields using a page level "Process". These form fields have Source Type = Database Column. It wasn't working, I could only set non-db assoc form field values no matter when the "Process" was set to exec. From some other posts it seems that this is by design, ie. not being able to programatically set the initial values of form fields that are sourced to db columns. I was hoping to have just one "Process" that would exec to set these initial values in one place rather than scattered about for each field that needed a default value. These particular default values come from ref tables and may be different for each user.
    So, it looks like I have to use a "Default Value" plsql chunk for each field on the form itself or else set their value on the calling form's Redirect in the "Set these Items" area.
    Is this correct?

    You could define a database function which accepts the name of the item and the user ID of the user running the application. Based on the item name and the user ID have the function return the appropriate initial value. Invoke this function in a "Default Value" PL/SQL block.
    Does that help in centralizing your initial values? You could have one function per page or one function per application. I would do one function per application.

  • Created by and creation date default values on form

    Hi Friends,
    I am a form newbie. I am creating a simple form.
    I have non-display column/fields:
    a.) CREATED_BY - how do I put the default value of the user login ID upon inserting record?
    b.) CREATION_DATE - how do I put the SYSDATE upon inserting the record?
    c.) UPDATED_BY - how do I put the default value of the user login ID when updating the record?
    d.) UPDATE_DATE - how do I put the SYSDATE when updating the record?
    Thanks a lot in advance

    Hi,
    In the PRE-INSERT trigger, write,
         :CREATED_BY    := GET_APPLICATION_PROPERTY(USERNAME);
         :CREATION_DATE := DATE;And in the PRE-UPDATE trigger, write,
         :UPDATED_BY  := GET_APPLICATION_PROPERTY(USERNAME);
         :UPDATE_DATE := DATE;Then your issue will be solved.
    Regards,
    Manu.
    If my response or the response of another was helpful, please mark it accordingly

  • How to make default value in form input field disappear on user click

    I have an HTML input tag with a default value.
    How can I have that value disappear when user begins to type?
    Form is here:
    http://www.kardsbykaren.us/10pack.php
    Happy Holiday and thanks.

    Have a look here http://www.matiasmancini.com.ar/ajax-jquery-validation-html5-form.html
    Gramps

  • Forms: sql with bind variable as default value to form field?

    I am using a form as a way to show details of already entered rows in a table. A report passes an id parameter to the form to get it to show the right data. No insert or update is possible. (I am using a form rather than a report because I need to display BLOBs, something reports can't do.)
    I need to execute sql statements based on the passed id to fill certain fields in the form with data from other tables. For example: The table the form is based on includes a category_id, whereas I want to display the category name which resides in another table.
    How would I best achieve this?

    Hi,
    You do this in the additional plsql code section of the form by getting the value of the category_id from the session variables and then getting its name from the cateogory table and assigning it to the category name column.
    Sample Code
    declare
    catid number;
    catnm varchar2(30);
    blk varchar2(10) := 'DEFAULT';
    begin
    catid := p_session.get_value_as_varchar2(
    p_block_name => blk,
    p_attribute_name => 'A_CATEGORY_ID');
    select category_name
    into catnm
    from cat_table
    where category_id = cat_id;
    p_session.set_value(
    p_block_name => blk,
    p_attribute_name => 'A_CATEGORY_NAME',
    p_value => catnm
    end;
    Thanks,
    Sharmila

  • Set a default value to checkbox on Active Directory form

    Hi all
    how to set a default value to checkbox UD_ADUSER_MUST on Active Directory form?
    I set the value 1 on the column default value (ADUSER form), i try the provisioning resource AD to the user and this field is not selected.
    please help me.

    hi
    My problem is solved, I tried to change the default form ADUSER, but this value was overridden by the policy form.
    I set this value in the policy form.
    thanks

  • Default Value using Custom Library?

    In Custom Form A, in the global variables i have store the value , How to populate default value to Form B using in custom library.
    I tried using COPY, but its not working?
    COPY('GLOBAL.EXP_PRO',':IT_QF.PRO_NUM');
    Is their any other way to do it?
    Thanks!

    Zaafran Ahmed  Posted: Oct 26, 2010 2:05 PM
    COPY(:GLOBAL.EXP_PRO,'IT_QF.PROJECT_NUMBER');user12207320 Posted: Oct 26, 2010 2:40 PM
    I tried it throws a error,bad bind variable error >
    This will throw an error because the COPY built-in takes 2 Varchar2 parameters (Source and Destination). When you use the COPY built-in, you pass references to the objects not the objects themselves. Therefore, the reference to the global variable :GLOBAL.EXP_PRO would have to be passed as a string to COPY.
    Looking at your original post, you have a COLAN in the destination string. Try the following:
    COPY('GLOBAL.EXP_PRO',':IT_QF.PROJECT_NUMBER');
    /* Change this statement to: */
    COPY('GLOBAL.EXP_PRO','IT_QF.PROJECT_NUMBER');Craig...

  • How to use Default value in a column in Tabular form in insertion or upda

    Hello,
    I am trying to use Default values so that user need not have to enter data, but when I select default type and put a default value, I see an error message, if I try to add a new row.
    How can I use a default value in a Column in a Tabular Form?
    Gouri
    Edited by: user1046395 on Apr 3, 2009 9:58 AM

    Gouri,
    You can just simply edit to each column's report attribute. For example,
    To set default date,
    Default Type: PL/SQL Expression of Function
    Default: sysdate
    To set default text,
    Default Type: PL/SQL Expression of Function
    Default: *'CLERK'*
    If you still have an error, what is the error message?
    Ittichai

  • How to set a default value in a form, for a current record.

    Hello,
    I have created a form to store the details of an employee, details include employee id, name and lan id. I am wondering if it's possible to set the default value for an e-mail address. The e-mail address would be in the format '[email protected]'. So If I press 'create', I am directed to a form.
    In the forename field, if i type 'stewart'
    In the surname field, if I type 'Young'
    Then in the e-mail field, I should see '[email protected]'
    Furthermore, if I change 'stewart' to 'stuart', while still in the form, the e-mail address field is automatically updated to '[email protected]'
    Would anyone be able to help with this problem?

    Hi,
    to do this you need kind of interactivity in your form.
    You can achieve this either by:
    1) using JavaScript onchange-events on forename and surname items, or
    2) use the AJAX Computations option of ApexLib, see: http://www.oracle-and-apex.com/ajax-computations-rich-client-feeling/
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com

  • How to give a default value in an inputText on a Form (Jdev 11G Preview2)

    First Test :
    In the .jspx I have a Form with an inputText :
    -id = inputText1
    -value=#{bindings.ppartId.inputValue}
    In the page Def (in the <methodAction ..for the submit button) I modified the NDValue in order to have
    <NamedData NDName="ppartId" NDType="java.lang.Integer"
    NDValue="${ParticipantInfo.participantId}"/>
    --> After clicking on the submit button I got a null value for the ppartId (in my model method) [In my ManagedBean ParticipantInfo, participantId is OK]
    Second Test
    In the .jspx I have a Form with an inputText :
    -id = inputText1
    -value=#{bindings.ppartId.inputValue}
    I replace the value
    -id = inputText1
    -value=#{ParticipantInfo.participantId}
    --> I saw the correct value when running the form but After clicking on the submit button I got a null value for the ppartId (in my model method)
    So my problem is : I just want to give a default value on an inputText on a form with a Managedbean. How to do that ?
    Could I modify the code of the action ofthe submit button to do that but how ?
    public String saisierapide_action() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("SaisieRapide");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    }

    Hi,
    if your attribute binding is bound to a variable, then you can achieve this by setting the DefaultValue attribute for the variable to the desired value. E.g.
      <variable Name="ppartIdVariable" Type="java.lang.String"
                DefaultValue="${ParticipantInfo.participantId}"/>
    <attributeValues id="ppartId" IterBinding="variables">
      <AttrNames>
        <Item Value="ppartIdVariable"/>
      </AttrNames>
    </attributeValues>HTH,
    Patrik

  • How to: username as default value in a form

    How can I use the user_name (portal user: wwsec_person.user_name) as a default value in a form. When I use #USER I get the db_user value.

    Hi,
    You can use the api portalschema.wwctx_api.get_user. This will return you the logged in user.
    Thanks,
    Sharmila

  • Using select list as default value in tabular form.

    Hi,
    I am using Application Express 4.1.0.00.32. I have two questions that are related.
    I have a Select item *'P1_SELECT'* and a tabular form My Items.
    Question 1. The My Items tabular form col1 Attributes are set Display As Text Field, and the Tabular Form Attributes are set Default Type = item(application or page item name), Default = P1_SELECT. I have checked the session state value is set on P1_SELECT ie. Fred. What I need to know is, why, when adding a row to the tabular form My Items does col1 not display 'Fred' as the default value from the select item P1_SELECT? I can change col1 of the Tabular form to be Display as Text (save state) and this will work. However that leads me on to:
    Question 2. After adding say 3 rows to the form, I then change the select P1_SELECT value to Bob and Bob is now set in session state on the P1_SELECT item, but when I again add row to the form the value Fred is still the value not Bob. It seems that the tabular form keeps the default value as Fred and not Bob. How can I get this to look or work like:
    col1_
    Fred
    Fred
    Fred
    Bob
    Your help is needed.
    Thanks.

    Howard (DBA in Training) wrote:
    Do you submit the page or set the value after changing the selection? If not, the display value seems to be Bob but the working value is still Fred. That's what you are seeing right? In the "Settings" section, what do you have for "Page Action when Value Changed". I've been using "Redirect and Set Value" because I was staying on the same page after the selection.
    Additional info which might be helpful (or NOT). ====================
    NOTE: I am just a novice's novice with APEX and I had much agony with Select Lists. It was challenging to have the Select List value displayed because there seem to be so many different sources of the Select List value, namely:
    1) the current value in the session state
    2) the value you can specify in "Source value or expression" in the "Source" section of the Select List item
    3) the value you can specify in the "Post Calculation Compution" in the "Source" section of the Select List item
    4) the value you can specify in the "Default value" of the "Default" section of the Select List item
    [Now, if I've misdescribed any of these, remember, this is from a novice's perspective.]
    It's like putting a clock (back) together. Get any of the pieces wrong and it will probably not work right.
    I had an addiitonal challenge in that I wanted the same Select List displayed on multiple pages and for the currently selected value (from the former page) to already be set on the new page when it was displayed. What fun!
    To see what I did here: http://apex.oracle.com/pls/apex/f?p=43250:101 login Dever/Ima9Dever
    Remember, I'm doing many things you will likely not need to do. I iniitalized the Select List for the first time it displayed. I copied the Select List value from old page to new page by storing it in an application item F217_SYS_NIC_NM.
    Best wishes,
    HowardHi Howard,
    You don't have submit the page for just setting one item's session state. you can use a Dynamic Action OR use Page Items to Submit property if available (this is available in various places such as sql region,chart region etc)
    In context to this question you don't have to do any of those..just see my example above
    Thanks

Maybe you are looking for

  • Iphone and Windows Vista

    Has this ever happend to anyone, i bought a new computer in Janaury plugged in the iphone after itunes and my ipod had already worked correctly. Then once the iphone was syncing the dreaded "blue screen" popped up. My computer crashed losing everyith

  • SCCM 2012- 2 Databases issue

    We recently installed SCCM 2012 for end protection manager. Now we want to use the report services side of it. After installing the report services in SQL and attempting to map it via SCCM it will not allow me to use the primary DB since its hosted i

  • Please, help me to set up wireless Internet connection. M...

             Please, help me to set up wireless Internet connection. My router is WRT54GS. I able to get online when computer is wired direct to VPN internet cable. First, I can't open password request screen on http://192.168.1.1.  Second, when "Setup w

  • FTP Publishing currently failing

    Some months back I created a website for a friend who wanted a new site for his business. His site was already with Mr. Site who supported FTP publishing, so I created his new site and transferred it to his new one, effectively replacing it. Great! W

  • Where is advanced search?

    Is there any way to force the results to be constrained to a topic? This new discussion format is driving me crazy - I can't seem to find any relevant answers to any questions...   i.e. go to the OS X forum, ask a question and get results about iPhon