Setting default value read from user session, for an LOV in Query component

I want to set the default value of a field in VO that participates in a named view criteria and thereby in Query component. That field is configured with an LOV by mean of a view accessor. The values are Y and N and the corresponding display strings obtained from view accessor are true and false respectively.
I am able to set the default value by setting the value of the criteria item corresponding to that field in view criteria. I am setting the value as either Y or N and I am able to corresponding display string as per the view accessor, on the query component when it is rendered.
I want to read the defauilt value from the ADF BC user session and set it as default value. I tried setting the values as "adf.userSession.userData.usageFlag". Iam ensuring that the attribute usageFlag is set before the view activity that has the query component is invoked. But this is ending up showing no default value in the Query component when rendered.
Can any one let me know how to go about with this?

I made up your table since you didn't provide some example, but I'm sure this will give you the picture:
SQL> var run_type varchar2(1)
SQL> exec :run_type := 'A'
PL/SQL procedure successfully completed.
SQL> create table my_cycles as select level cycle_id
  2                            ,      level cycle_status
  3                            from   dual connect by level <= 5;
Table created.
SQL> select cycle_id
  2  from   my_cycles
  3  where  case
  4           when :run_type = 'D' and cycle_status  = 1 then 1
  5           when :run_type != 'D' and cycle_status  in ( 2, 3 ) then 1
  6         end = 1;
  CYCLE_ID
         2
         3
2 rows selected.
SQL> exec :run_type := 'D';
PL/SQL procedure successfully completed.
SQL> /
  CYCLE_ID
         1
1 row selected.
SQL>

Similar Messages

  • Pass variable and set default value based on user's group

    Hello
    I'm using SharePoint 2010 and SQL 2012. I need to send a variable to the page and based on its value, set default value for a drop down list and send it to other web part to filter the data. Is it possible for certain users to send that value as a default
    and limit user to see only this value in the text field or drop down list; for others - to allow to see the drop down list, but also set the default value for that list?
    The main page was designed in SharePoint designer, using web parts (aspx page). I had setup a connection to Active Directory and already have the code to get user's groups and based on their group, I have that variable pulled into the web page for further
    use. But I don't know how to pass that value as a default value to the web part (currently using SharePoint Filter web part). When I tried to set a default value for the web part - it automatically puts the quotation marks around the name of the variable
    and shows it as a text instead of showing the value of the field.
    Thank you!
    P.s. I have limited knowledge of SharePoint and need guidance (links, examples, recommendations)!
    Alla Sanders

    Thank you for your response. I'll try to give you more details. On PageA I check user's groups and based on the group, assign the value and pass it to the next page (no input from the user, all done behind the scene and user is redirected to PageB).
    On the next page I read that value and would like to send it to the SharePoint List Filter Web as a default value, as well as send it to another web part that displays the list from SQL, filtered using that default value. Ideally, if the user is from Group
    A, I'd like for them to have only one value in that drop down list; if user is from Group B - give him drop down list with 40 items to choose from. Below there is a part of the code and variable fnum has the value from PageA (if I print the value on the screen
    - I do see that it has correct value, so the code that gets groups from Active directory works correctly). If I assign fnum as a default value of the list, it shows "fnum" instead of the value of variable fnum. I connect to SQL database, using external
    content - so the other list that I'm filtering based on the value in that drop down list - is XSLT Data View Web part. I also have 2 more filters on that page, that user will have full access to and based on their input, it is also sent to the XSLT web part
    to filter out more data. Since one of the filters is the date and I am filtering data starting from the date that user chooses - XSLT is the only web part that I was able to make it work with.
    I looked at the link you provided (thank you). It is using Content Query Web part. Will it work with external content, as well as accepting multiple filtering, including custom starting date? I appreciate your help!
    <%
    string fnum = Request.QueryString["field1"];
    %><table cellpadding="4" cellspacing="0" border="0" style="height: 1000px">
    <tr>
    <td id="_invisibleIfEmpty" name="_invisibleIfEmpty" colspan="2" valign="top" style="height: 101px">
    <WebPartPages:WebPartZone runat="server" Title="loc:Header" ID="Header" FrameType="TitleBarOnly"><ZoneTemplate>
    <WpNs0:SpListFilterWebPart runat="server" FilterMainControlWidthPixels="0" RequireSelection="False" ExportMode="All" PartImageLarge="/_layouts/images/wp_Filter.gif" AllowHide="False" ShowEmptyValue="True" MissingAssembly="Cannot import this Web Part." AllowClose="False" ID="g_1ccc4bca_3ba1_480b_b726_adfdb1e9e02d" IsIncludedFilter="" DetailLink="" AllowRemove="False" HelpMode="Modeless" AllowEdit="True" ValueFieldGuid="fa564e0f-0c70-4ab9-b863-0177e6ddd247" IsIncluded="True" Description="Filter the contents of web parts by using a list of values from a Office SharePoint Server list." FrameState="Normal" Dir="Default" AllowZoneChange="True" AllowMinimize="False" DefaultValue="fnum" Title="Facilities List Filter" PartOrder="2" ViewGuid="2da5d8db-6b55-4403-80a8-111e42049f8b" FrameType="None" CatalogIconImageUrl="/_layouts/images/wp_Filter.gif" FilterName="Facilities List Filter" HelpLink="" PartImageSmall="/_layouts/images/wp_Filter.gif" AllowConnect="True" DescriptionFieldGuid="2d97730a-cd0d-4cb9-8b55-424951201081" ConnectionID="00000000-0000-0000-0000-000000000000" ExportControlledProperties="True" TitleIconImageUrl="/_layouts/images/wp_Filter.gif" ChromeType="None" SuppressWebPartChrome="False" IsVisible="True" ListUrl="/Lists/FacilitiesList" AllowMultipleSelections="False" ZoneID="Header" __MarkupType="vsattributemarkup" __WebPartId="{768E2035-0461-4A09-8DDD-CA7020C2B23D}" WebPart="true" Height="" Width="615px"></WpNs0:SpListFilterWebPart>
    Alla Sanders

  • How can I set default value in a field based on a LOV?

    Here's the LOV:
    select txtName, ID
    from FAC_LK_PROJECT_PRIORITY
    order by 1
    I tried:
    select id from FAC_LK_PROJECT_PRIORITY priority where txtname = 'Medium';
    and set the default value type to be PL/SQL function body but that didn't work - I get this error:
    ORA-06550: line 2, column 1: PLS-00428: an INTO clause is expected in this SELECT statement
    Error ERR-9131 Error in PLSQL function body for item default code, item=P19_PRIORITYID
    OK
    The item is a select list w/ db column as source: PRIORITYID

    Hi Scott. thanks for answering. I get from your post that I need to declare a variable and then return something. I changed it to this
    declare v_id number := null;
    begin
      select id into v_id
          from FAC_LK_PROJECT_PRIORITY priority
          where txtname = 'Medium';
      return v_id;
    end;and it works.
    Why do you use a loop? In case there's >1 row returned by the query?

  • Set Default value in annotations for business service

    Can any one let me know how to set default value as null in annotations for a element.
    if I set it using wizard, it take "null" as string...

    In annotations ,Declare Data type as 'Entity'
    Thanks
    Amaresh

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

  • Set default value for people picker only when user checks a checkbox (Sharepoint 2010)

    The javescript in below link works for me.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/2b130f64-3db2-484a-9a53-ccbe18d2c5de/set-default-value-for-people-picker-in-list-template-current-user?forum=sharepointgenerallegacy
    However, I'd like to set default user for people picker only when user checks a checkbox. 
    I am new to  development. Could you please help me on this requirement ?
    Thank you very much. 

    Hello,
    Use this link to to validate checkbox value, if true then set the person or group value (i.e. as posted in your link).
    http://geekswithblogs.net/haniamr/archive/2011/03/10/validate-that-a-checkbox-is-checked-using-javascript.aspx
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Dump in user exist CC01 to set default value to valid from date

    Dear friends,
    Task is to set default value to valid from date field in Transaction "CC01".
    In INCLUDE ZXCCAU01 of Function 'EXIT_SAPMC29C_001' in Enhancement 'PCCD0001' I written the code like this
    DATA var LIKE sy-datum.
    var = var + 1.
    which is not related to program by creating project and activated the project.
    When I run cc01 it is giving dump.
    Error is :
    Program "SAPLXCCA" tried to use screen 1000.
    The screen does not exist.
    Can some one guide me What is the problem and How to resolve this.
    If not, Is there any other method this can be done.
    Regards,
    Venkat

    Hi venkat,
    DATA var LIKE sy-datum.
    var = var + 1.
    the code u written i guess not ok.The code used by kishan is correct. i.e
    DATA var LIKE sy-datum.
    sy-datum = sy-datum + 1.
    var =  sy-datum.
    write var.
    use the above code.
    SAPLXCCA is a functionpool not a program.please check the same.
    regards,
    Nagaraj

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

  • Can't Set Default Value for LOV Presentation DB Column

    I have a simple form. One of the fields is populated using a named, dynamic LOV with the following source query:
    SELECT USER_NAME DISPLAY_VALUE, USER_ID RETURN_VALUE
    FROM USER_ACCT
    ORDER BY 1
    I want the default user to be public, which is one of the possible values returned by the above query. However, I just can't find a good way to do this.
    If I put the following query in the Default section, nothing happens.
    SELECT USER_ID
    FROM USER_ACCT
    WHERE USER_NAME = 'PUBLIC'
    If I look up the ID and statically put the value in the Default, it works (This isn't acceptable . From environment to environment the value will differ)
    If I put the SQL in an after footer page process, it sets the value correctly in the session but, does not update the display.
    If I try to put it in the Post Calculation Computation section, it merely produces an error.
    I'm sure that I am missing something simple but, I have not spent an hour and half on this.
    Someone please help!
    -Joe

    A function I'd like to see is the ability to not only create a select list dynamically, but also set the default value of that select list's item to the first (or Nth?) value on that list. This could be specified in the builder by an item option.
    E.G., if a select list LOV returns three values: "foo", "bar", "baz", go ahead and set the value of the select list item to "foo".
    As far as I've been able to discover, there's no built-in way to do this in Application Express. I've looked through the app, the docs, and the forum. If such a method does exist, please let me know.
    Otherwise, we end up running additional processes that reissue the query so we can grab the first item as the default value. This seems inefficient to me.
    Keeping the LOV query and the "first item" query consistent can present problems as well. We usually end up pushing the LOV query into a function so it can be maintained in a single location, but this seems more like a workaround than anything else.
    While the query is probably cached, Application Express has that return value already, right? Why calculate/choose it again?

  • How to deploy a VO Bind variable to get value from user session....

    Hello everbody...
    A JSF Page has a table based on VO with two parameters. One of this parameters I will pass by operation ExecuteWithParams.
    but the other parameter I need to pass a value from User session.
    Is that possible? How would I do that? I´m using jdev10.1.3
    Thankyou...

    When you created a binding for executeWithParams in your pageDef, the action binding should have had NamedData elements for each of the parameters. These would have been assigned values from a variableIterator up in the executables section. The parameter that gets its value from user input should be left alone. For the parameter that gets its value from the user session, change the EL expression that defines its NDValue attribute so that it references the session information that you want to use. This can be a sessionScope variable that you set earlier in the session, as Frank suggests, a property of a managed bean in session scope, or some other variable.

  • CRMD_ORDER: how to set default values for Requester and Change Manager

    Hello Folks,
    how do I set default values in TA crmd_order?
    I drew my organizational hierarchy using TAs bp and ppoma_crm.
    When a new Change Request (e. g. SDHF) is created, I want the four roles (Requester, Change Manager, IT Operator and Developer) to be set automatically, not manually.
    Both Requester (= Key User) and Change Manager are derivable. I did not find anything in SPRO neither in the OSS neither here.
    Points will be rewarded as a matter of course!
    Thanx in advance!

    Hi Dirk,
    look for Define Access Sequence & Define Partner Determination Procedure in SPRO and read the IMG Activity Documentation. You can find it in the Service Desk config, but it works for the other transaction types too.
    Basically, you create Access Sequences where you tell the Partner Determination Procedure where to look for the values for the Partner Function fields.
    The Access Sequence can use lots of sources for the information, including your org structure.
    regards,
    Jason

  • Badi for setting default values in the transaction in APO.

    BADI NAME: SMOD_APOCF005 which is used for setting default values in the transaction.
    I have implemented the BADI using the below code but that BADI is not triggering. Please can you provide any solution for resolving this.
    As per my requirement I am trying to set default values for these three fields RRP_TYPE, WHATBOM, CONVH.
    DATA: LS_MATLOC LIKE LINE OF IT_MATLOC.
    LOOP AT IT_MATLOC INTO LS_MATLOC.
    LS_MATLOC-RRP_TYPE = '4'.
    LS_MATLOC-WHATBOM = '5'.
    LS_MATLOC-CONVH = '999'.
    MODIFY TABLE IT_MATLOC FROM LS_MATLOC TRANSPORTING RRP_TYPE WHATBOM CONVH.
    ENDLOOP.
    DATA: LS_MATLOCX LIKE LINE OF IT_MATLOCX.
    LOOP AT IT_MATLOCX INTO LS_MATLOCX.
    LS_MATLOCX-RRP_TYPE = 'X'.
    LS_MATLOCX-WHATBOM = 'X'.
    LS_MATLOCX-CONVH = 'X'.
    MODIFY TABLE IT_MATLOCX FROM LS_MATLOCX TRANSPORTING RRP_TYPE WHATBOM CONVH.
    ENDLOOP.

    The  BADI name: SMOD_APOCF005 .
    T.code at APO : /sapapo/mat1
    Once we enter in that T.Code with some Product and Location data.
    There under PP/DS tab.
    Under Planning Procedure there is a field PP Plng Procedure which I want to set as 4
    And under Order Creation there is Plan Explosion which needs to be set as 5
    And Under Horizons there is PP/DS Horizon which needs to be set as 999.
    BADi is implemented and active.
    And once the data is CIF from ECC to APO
    These default values are not set in the T code in APO and the BADi is not triggering.

  • Is there any way we can set default value for a Date Attribute to current date in Master Data Services

    Is there any way we can set default value for a Date Attribute to current date in Master Data Services.
    I as well wants to know that is there any posibility to show Calendar control while input data into respective date attributes.
    Thanks.

    Hi Anagha,
    So far i havent found any way to set todays date by default from MMI, but i guess this flow should work as workaroud
    1. Add buisness rule which can set a default value when Date = NULL/Blank
    2.get the entity table ,use -select EntityTable from mdm.tblEntity where Name = '<enter entity name>'
    3.Go to that table and add a after update trigger like
    if uda_<entityid>_<attributeid(Date attribute)> = default value
    update uda_<entityid>_<attributeid(Date attribute)> =getdate() where id = <LastUpdatedRow>
    I will check on this too from my side.
    By the way AFAIK i dont think so calendar control integration is possible .

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

Maybe you are looking for

  • Will the video tags in HTML 5 work inside premiere pro panel?

    Hi all,      I am working on a Premiere pro cc panel. We are using eclipse and extension builder 3 to create the html 5 panel. But the preview video option in our panel is not working. We have created the preview function using HTML 5 video tag eleme

  • Creating Recover Disc - HP Pavilion 17 - I'm a novice at this and really need support

    I downloaded information and directions for doing this procedure from the HP website.  I have a couple of questions to clarify some of my concerns. 1. Using dvd - is the writable dvd the same one you would use for burning videos or different? 2. I ju

  • Calling a class/function in a view

    Hi , I want to instantiate a external class in a view, how to achieve that ?... For say ... Need to call/instantiate function /SAPSRM/IF_PDO_DO_PARTNER_BASE~UPDATE_ITEM_PARTNERS (public) of class /SAPSRM/CL_PDO_BO_SC in the view of Webdynpro componen

  • Kerberos with sbs 2008

    Hello, I've installed VDI 3.1 EA and i am trying to configure user directory using sbs 2008, previously i established a connection to win 2000 AD but but when i change the krb5.conf to connect to sbs 2008 i can connect through command line with kinit

  • Batch Classification Setup

    My customer already has batch management & shelf life functionality in place on their ECC5 system. They now wish to introduce batch determination strategy using SLED (shelf life expiration date). Once the classification and config are been complete,