Setting Default values in portal form

I have a portal Master/Detail Form. I want to set some of the detail block columns value to the value of a field in the master block.
In the formattng option of the detail column, I tried setting default value to:
p_session.get_value_as_varchar2(p_block_name=>'MASTER_BLOCK', p_attribute_name=>'A_CLASS_CD');
and default value type to: function (I also tried expression). It compiles, but gives me an error when I ry running form. How can you set the default value (from the value of a differnt field)?

HI,
You can set the default value to value of a different field. The only way is to use javascript like onFocus.
Thanks,
Sharmila

Similar Messages

  • Setting default value of Tabular form item is not working

    Hi,
    I have a tabular form and in that I want to set the default value of the username to app_user. So in the default value of the item, I wrote v('app_user') and type Pl/SQL, but that does not seem to work. I tried the static application & page item with :app_user. That threw an error.
    Also, I wanted to populate the date field in one column. Doesn't sysdate work?
    Thanks,
    Sun

    Bob, I did read that. MY problem is that it is still not working. I am wondering if this is because the table is in execute query mode maybe? I am wondering if the default value needs to be added after the tabular data is populated through some other way? Maybe the default value would work only for static non database items?
    ThanksYou're right, I just tested that using the default setup on the column in report attributes and it did not work.
    I think you'll have to update the columns with the default value post query but I'm not sure exactly what you need to do.
    I have a form that has a weight entry column. I tried changing the query to set the default value in the query
    from..
    Select Weight
    From...
    to
    Select 999.99 Weight
    From...That appeared to work, but the 999.99 value was not populated back to the Database since it wasn't entered through the form UI. APEX maintains the entered values internally so it can do its checksumm processing and update modified rows back to the DB. I'm thinking you could update what needs to be updated using Javascript in a Dynamic Action, but I'm afraid I don't know how to do that.
    Excuse my incorrect assumption when first replying.

  • 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.

  • How to Set Default Value into a Tabular Form Element

    Hi,
    Hoping someone can assist with my Tabular Form query.
    I am using Oracle ApEx v3.0.1
    I was wondering how one can set a default value to one of my tabular form columns within Oracle ApEx v3.0.1 as I cannot see how to do it?
    Thanks.

    Hi Tony
    can you pl. help me how you resolve this? I have one tabular form and I am trying to set default value as :APP_USER, I type this in default value but somehow it is not displaying this value.
    thanks
    Dax

  • Setting default value based on Link

    I have a report with a link to a form. The link is a standard portal component link.
    The link passes in cus_id.
    I would like to set the default value of the form cus_id field to the cus_id value from the link when the form is presented in insert mode due to the expected situation where no record for the cus_id exists.
    I have tried using the following function in default value:
    NVL(portal30.wwpro_api_parameters.get_value('A_CUS_ID','LEVEL_TWO_FORM'),0)
    I have tried both CUS_ID and A_CUS_ID, but neither seems to return a value.
    Any suggestions are much appreciated!
    null

    I was able to reproduce this. The problem occurs because when referencing another page def (binding container) than the current one, this binding container needs to be "prepared" which is done by calling method refreshControl() on the binding container. For binding containers of parent groups, JHeadstart automatically prepares them as prat of the prepareModel phase of the current binding container. However, when clicking the AddRow button, this is too late, the default value expression is evakluated before the prepareModel phase.
    A simple work around is to manually add the value binding "masterField" and its iterator binding to the page definition of the detail group. You can then use the expression "#{bindings.masterfield.inputValue} and that should work.
    Note that in JHeadstart 10.1.3.3, we will add a "jhsPageDefs" managed bean that extends HashMap, which allows you to retrieve "prepared" binding containers. You can then use the expression
    #{jhsPageDefs['MasterWizardGroupPageDef'].masterfield.inputValue}
    Steven Davelaar,
    JHeadstart Team.

  • 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

  • HELP - i can't set field value in a form

    Hi,
    I created a form based on a stored procedure.
    I try to set a field value on this form( the name of the item in the wizard is 'P_GG') from the advanced PL/SQL SECTION in the wizard, and, for exact, in "... before displaying the page..." i wrote:
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_P_GG',
    p_value => '20');
    But when I run the form the field is blank
    Thank for everyone reply and help me.
    Simone Mancino

    Dmitry,
    thank u for your reply.
    I tried your solution, but there is another problem. I specified a default value for the form, using the syntax "#myfunction()".
    The first time I run the form, i get the correct value. But whenever i run the form again in the same session, I always get the FIRST value: it looks like the function is not evaluated again. For example, suppose the function is
    return to_char(SYSDATE, 'SS')
    (just to have a random dynamic value);
    you always get the value of the first run, even if you refresh the page.
    Regards
    Simone

  • I need default values for APEX form fields. How do I do this?

    Hello,
    I am trying to set a default value in my form so that there will not get a null value. I have gone to the Column Defaults page and filled out the following fields in From Defaults:
    Default Value: 0
    Required: Yes
    Help Text: Please enter a number.
    When I add a record set or update a record and do not fill in the field, neither does it prompt me to fill it in or has a default value. It is blank.
    Can someone tell me what I am doing wrong?
    Thanks
    leh

    Hi leh,
    Defaults:
    Click on the page item, go to the Default section, enter your value into the Default value area.
    Validations:
    It's not quite as automatic as you are thinking.
    You'll need to add a Validation process for the item.
    First you go to the Page Processing section, then the Validations section, click the creation icon in the Validation section. You will first have the choice to create an item level or page level validation. Either will work. Next you will select the item you want to validate. Then, select Item Not Null. On one of the next pages you will be able to enter the error message. It's all pretty straightforward.
    Tony

  • MASTER DETAIL - SET DEFAULT VALUES FOR ITEMS

    I have a master detail page where on the master I do things like updating the entered_by and entered_date fields
    by applying functions to set the item level details and the setting them to read only.
    On the detail portion of the page I'd like to do the same but I don't see the details items on the page - only the master items.
    The details portion is for comments so I'd like to have the commenter_name and commenter_date set to defined values
    when I hit the add row button on the details portion.
    Where are the detail items?
    I'm using APEX 3.2
    Thanks
    Steve

    Hi,
    When you use master detail form, APEX generate 'Detail portion' as report. So if you edit the page, you may not see actual items for 'detail portion'.
    If you want to set any default values or want to format these items, you may need to do as follows
    1> Edit 'report' of 'detail portion'
    2> Click on report attributes
    3> Click on column, you want to set default values
    4> Now here, Under 'Tabular Form Element' section you can do this by setting proper values to 'default type' and 'default' fields.
    Hope it helps
    Cheers
    Hari

  • SDK: set default value to "managed by inventory" option when item creation.

    Currently, my customer wants to set default value (as true) to "managed by inventory" option under inventory tab when item creation.
    My question.
    1. how to detect item master form in add/find.
    2. how to set option default to be true.
    Regards,
    Kenneth Tse

    Hi Kenneth
    Okay, you need to do the following.
    1) You need to see when the item menu opens and what mode it is in and then do the event. So in itemevent uou'll have code similar to
    If (FormType = "AddMov" And pval.FormMode="Your Mode") then
    ***your code
    end if
    You can also just see the form and chesh the caption of the button.
    2) to do the second part,
            Dim oitem As SAPbobsCOM.Items
            oitem = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)
            If oitem.GetByKey("Item Code") Then
                oitem.GLMethod = SAPbobsCOM.BoGLMethods.glm_WH
            End If
    Hope this helps

  • Need to set default value in table EABL.

    Hi Experts,
    How to set default value of field ATIM form 00:00 to 23:59 ion field selection screen for table EABL in transaction SE16?

    hi jazz try this way.
    forget about every thing and come from beginning.
    by now i think your are familiar with shd0.
    firstly create a variant using shd0 for your table eabl with default value and save it and activate it.
    next check whether it is working or not by opening se11 or 14 and enter table name and click display, the you can you see your default vale in your required field.
    after it is done the come to second part i.e your se16.
    now create another variant for this and save it and activate it.
    (by this i mean to say you are creating two variants )
    hope this will solve your problem.
    if your purpose is not solved yet then please write to my mbox.
    regards,
    kool.

  • Set Default Value of Multi-select list item

    I have a multi-select list item I want to default the value of to '%' (which is really '%null%') and have it selected. I tried setting default value of item, but it doesn't take '%null%'. I also tried a computation with a static of
    :P507_ITEM := '%null%'; How do you get the default value set and selected?

    Hi
    Shijesh is right, you need to change your null return value and use that return value as your default. Try and use something of the same datatype as your real return values if you plan to use '%' to display all as it will make your queries simpler. eg.
    Company A returns 1
    Company B return 2
    % returns 0
    Then your query would be...
    SELECT ...
    FROM ...
    WHERE company_id = DECODE(:P_COMPANY,1,1,2,2,0,company_id)
    Hope this makes sense.
    Cheers
    Ben

  • How to Set default value for taxonomywebtagging control with terms and nested terms

    Hi,
    I have created taxonomy control in custom aspx page and I am able to select terms but I am trying to setup default value to that control.
    Can anybody let me know how to set the default value for TaxonomyWebTagging control in custom.aspx page with nested terms?
    Any help would be greatly apprecited.
    Control code in aspx page:
    <td>
    <asp:Label runat="server" ID="lblLanguages">Field A: </asp:Label><asp:Label runat="server" ID="rfvlblLanguages" CssClass="errorMsg" ForeColor="Red">*</asp:Label>
    </td>
    <td>
    <Taxonomy:TaxonomyWebTaggingControl ID="term" Width="385px" runat="server" /></td>Mapping metedata code:TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
    //Set the Business Unit Field
    SPSite site = SPContext.Current.Web.Site;
    TermStore termStore = session.TermStores["Managed Metadata Service"];
    Group group = termStore.Groups["GROUPName"];
    TermSet termSet = group.TermSets["TERMSETNAME"];
    Term term = termSet.Terms["TermA"];
    Guid termGuid = term.Id;
    term.SspId.Add(termStore.Id);
    term.TermSetId.Add(termSet.Id);
    term.AllowFillIn = true;
    term.AnchorId = countryGuid;
    term.IsMulti = true;
    Thank you.
    AA.

    Hi,
    According to your description, you want to set default value for TaxonomyWebTaggingControl.
    I have a test in my environment. It could be achieved by setting the Text Property of TaxonomyWebTaggingControl.
    Here is the code snippet:
    TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
    SPSite site = SPContext.Current.Web.Site;
    TermStore termStore = session.TermStores["Managed Metadata Service"];
    Group group = termStore.Groups["GroupA"];
    TermSet termSet = group.TermSets["A"];
    Term term = termSet.Terms["A1"];
    TaxonomyWebTaggingControl1.SspId.Add(termStore.Id);
    TaxonomyWebTaggingControl1.SSPList = termStore.Id.ToString();
    TaxonomyWebTaggingControl1.TermSetId.Add(termSet.Id);
    TaxonomyWebTaggingControl1.TermSetList = termSet.Id.ToString();
    TaxonomyWebTaggingControl1.AllowFillIn = true;
    TaxonomyWebTaggingControl1.IsAddTerms = true;
    TaxonomyWebTaggingControl1.IsMulti = false;
    TaxonomyWebTaggingControl1.Text = string.Format("{0}|{1}", term.Name, term.Id.ToString());
    Here is a detailed article for your reference:
    http://blog.bugrapostaci.com/2010/09/23/taxonomywebtaggingcontrol-sharepoint/
    Feel free to Reply the test result.
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

  • How to set default values for boolean columns

    I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
    I've tried to set default value at column level:
    <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
    Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
    </Field>
    and at content type level:
    <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
    But in any case, when i create a new item with this content type, default value is applied.
    Can anyone tell how to set default values for boolean columns?
    Thanks in advance,
    Regards,
    Sergio

    In the field definition you can set
    <Default>1</Default>
    or
    <Default>0</Default>
    How to set the default value Null?

  • How to set default value to input field

    Hi Experts,
    I need to set default value to one input field for the transaction crmd_order as a screen variant. Guide me in doing that.
    Regards,
    Harish

    Using the transaction SHD0, you can define the screen variant. While defining the sceen variant, you are allowed to define the default values.
    Using screen variant, for the main transactoin, you can also define the transaction variant and you can use this as an independent transaction.

Maybe you are looking for

  • I can no longer publish iPhoto Journals to iCloud

    I have succesfully published and shared many iPhoto Journals to iCloud over the last few months. This was my main reason for purchasing the App. It no longer works, I just get a spinning wheel and the perpetual indication that the journal is uploadin

  • BEx: diagram missing in workbook

    Dear experts, I have included a diagram in a workbook (via menu -> layout -> diagram) and saved the workbook. When I start the workbook again (via role in SAP) the diagram is disappeared. We use BI 7.0, but the query still was created under BW 3.5. H

  • Problem in transaction SM30

    Hi, one of my colleagues gets the follwoing message when attempting to access Table/view MASE via SM30: <b>The maintenance dialog for MASE is incomplete or not defined Message no. SV037 Diagnosis The called function with the view/table MASE needs a s

  • Cannot open tabs in the new firefox

    I cannot open a new tab by using the ctrl+ T shortcut or if I even click on the little + sign next to currently open tabs. If I right click a link or a bookmark and select "open in new tab" it works but I cannot open a blank tab. I have tried deletin

  • Financial Brokerage Service demo build failing

    Hi When i try ant build this demo against OC4J bundled with JDeveloper 10.1.3 it is failing with the output given below. I tried same with OC4J bundled with JDeveloper 9.0.5.1, 9.0.5.2 and 10.1.2; but case with 10.1.3 looked more promising. Ant outpu