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

Similar Messages

  • Set default value based on current day value and setItems in Design studio

    Hello
    I have 2 filters on my dashboard - year and month. The default display of the dashboard should populate current year data. Is it possible to create formula to populate dynamic default value based on the current date using setSelectedValue() ?
    Also, for the calendar month, the items are set as below
    DD_MONTH.setItems(DS_1.getMemberList("0CALMONTH",
    MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 12, "ALL");
    This displays month values as 01/2014, 02/2014 ... How can I change these value to display as January if mm = 01 and February if mm = 02 etc..
    Thanks
    Sirisha

    Hi Victor,
    I have tried using below statment to populate current year as the default selection value for the dropdown. Used it on Startup, but for some reason it loads all the data when the dashboard is opened the first time. Any ideas?
    DS_1.setFilter("0CALYEAR",[Convert.subString(APPLICATION.getInfo().dateNowInternalFormat, 4,6)]);
    Thanks
    Sirisha

  • Set default value based on sql query?

    Hi,
    is it possible to set default value of an BC entity attribute by using sql expression?
    Eg. "select max(x)+1 from y where userid=?"
    Rgs
    Jernej

    Jernej,
    Yes, you can do this. Edit your entity object attribute, and in the Edit Attribute dialog select "Derived from SQL Expression". Then you can enter your expression in the Expression text box.
    Blaise

  • How to hide PNP selection windows and set default values for PNP.

    Hi expert,
         I am using HR logical database PNP, but I don't want to display selection windoes for running program on PNP, whereas I want to set default value for some selection items in the program. could you please tell me how to get those two targets?
    Many Thanks,

    Hi
    You have mentioned 2 things.
    1. Don't want selection windows for running program for PNP - this can be achieved using the HR Report category - You can get more details on HR Report Category on
    HR Report Category
    2.  I want to set default value for some selection items - This you need to achieve in initialization event of your program.
    How you can get this can be explained by INITIALIZATION (SAP Library - ABAP Programming (BC-ABA))
    Thanks,
    Sreeram

  • Set Default Printer based on user setting using Powershell script

    Hi 
    I would like to create a script that runs on user log off and captures the default printer (set manually by the user) and then another script to reapply the settings (saved upon log off) when the user logs back in.
    This is because local printers are set as default printer (PDF Creator Programs) when we all use Network Printers so this means a user has to set default printer to the network printer all the time.
    I have found this script to start with:
    $Printer = Get-WmiObject -namespace root\cimv2 -Query “select * from Win32_Printer Where Default = TRUE” -Impersonation 3 | select name | out-file C:\temp\Printer.txt
    But the out file looks like this:
    name
    \\PrinterserverName\Accounts01
    Which I dont see how it can be used on another script plus there are spaces after\Account01 
    Any Ideas please?
    M
    Maelito

    Hi Maelito,
    According to your description, you want to export the default printer name to text file, then read this printer name from text file and set the default printer via Powershell:
    #save printer name to text file
    Get-WmiObject -namespace root\cimv2 -Query “select * from Win32_Printer Where Default = TRUE” -Impersonation 3 | select -ExpandProperty name | out-file C:\temp\Printer.txt
    # read printer name from text file and set default printer
    $name=get-content C:\temp\Printer.txt
    (Get-WmiObject -Class Win32_Printer -Filter "Name='$name'").SetDefaultPrinter()
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang
    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 Support, contact [email protected]

  • Set Default Value based on Field from another table for a custom object

    I'm trying to set the default value on a custom object field to the value of an account field. I have tried the syntax 50 different ways, and just am getting no where. The account field label displays as DBA, the integration tag is ltDBA_ACCT, and it shows up in reporting fx area as Account.Text_22.
    The custom object field I'm triying to update is also called DBA, which was originally the "NAME" required field. Does the table name, Account, have to be included? Do I need a function in front of the field?
    I have been updating the external ID using the row ID with syntex <ID> (Less than ID greater than) so I know it is possible to set the Default Value, but <DBA>, <ltDBA_ACCT>, "Account"."DBA", and so on just don't not work.
    If anyone knows how to enter this I'd really appreciate the help.

    Ok, so if you want to default a field to the value from another object, you have to use the JoinFieldValue function. I think you understand that, based on your original post, but I want to be sure that you do.
    Next, this will only work as a default if the record is created from the object that you wish to join on because a default works at record creation and the ID needs to be available for it to work properly. It will not work if you choose the related object record after the custom object record is created. You could set the value as a post-default, but that does not seem to meet your requirements.
    The syntax for the Default Value would be as follows: JoinFieldValue(ref_record_type, foreign_key, field_name).
    In your case, ref_record_type is '<Account>', foreign_key is &#91;<AccountId>&#93;, and field_name is '<YourFieldName>'. The best way to determine what the field name is would be to create a new workflow for Account and use the Workflow Rule Condition expression builder to pick your field ("DBA") from the list. The value that is returned by the expression builder should be placed in the field_name variable in the JoinFieldValue function (minus the brackets and in single quotes).
    Give this a shot and let me know how you do.
    Thom

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

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

  • Trying to set attribute value based on user selection of another attribute

    I am trying to set an attribute value based on the user's selection of another attribute using JSP EditCurrentRecord. When the user chooses the AreaId from the combo box I want to look up the value of the RgnID, preferrably without the user seeing this field at all. Below is my code which does not work. When I run it I get Error Message: null. Any suggestions are appreciated!!
    <jsp:useBean id="RowEditor" class="oracle.jbo.html.databeans.EditCurrentRecord" scope="request">
    <%
    RowEditor.initialize(pageContext, "MyProject2_package1_SRSecurityModule.UsrAreaWhView");
    RowEditor.setTargetUrl("UsrAreaWhView_SubmitInsertForm.jsp");
    RowEditor.createNewRow();
    RowEditor.setDisplayAttributes("OracleId, RgnId, RegionKey, AreaId");
    RowEditor.useEditField("OracleId");
    RowEditor.getFieldRenderer("OracleId").setPromptText("Oracle ID");
    RowEditor.useEditField("AreaId");
    RowEditor.useComboBox("AreaId","AreaWhView","Area","AreaKey");
    RowEditor.getFieldRenderer("AreaId").setPromptText("Area");
    RowEditor.useEditField("RgnId");
    RowEditor.getFieldRenderer("RgnId").setPromptText("Region");
    RowEditor.getRowSet().getViewObject().getCurrentRow().setAttribute("RgnId",RowEditor.getRowSet().getViewObject().getCurrentRow().getAttribute("RegionKey"));
    RowEditor.setReleaseApplicationResources(true);
    RowEditor.render();
    %>
    </jsp:useBean>

    ok, sorry everyone for making it confusing; this is what I am
    trying to acheieve;
    I would like the user to populate my database with thier
    username AND userID. I have a dropdown box with thier username
    dynamicly populated already, what I am trying to achieve, is a way
    of when the user selects thier username either another dropdown or
    a hidden field is automatically populated with the appropiate
    userID (to match thier username). Now I could just have two
    dropdowns and they select both, but i'd rather avoid the
    possibility of mismatches, and that is why I would like it to be
    automatic and based on thier username selection...
    Does that make sense....?

  • Hide values on dashboard prompt and set defaults

    I have a prompt with 3 values,
    1) Year-Qtr
    2) Year-Qtr Start Date
    3) Year-Qtr End Date
    2 and 3 are constrained based off of what is in the Year-Qtr drop down. How can I get 2 and 3 to automatically have the values set and also be hidden to the user.
    Is this possible?

    Check this thread out for different ways of hiding dashboard prompts which is already posted in our forums:
    Hide dashboard prompts
    And regarding the populating the default values based on the value selected in the other prompt is not possible. The default value will always be a hardcoded vaule which can be in the form of presentation variable or sql results or an expression.
    Hope it helps
    Thanks
    Prash

  • How to set default value and bg color of cross tab cell?

    Hi all
    Which way can I set default value and background color for a crosstab cell where there are no any data?
    I try to pass it in following way
    if isnull(CurrentFieldValue) then
    But is has no effect.

    Hi,
    If your field is numeric
    if currentfieldvalue =0 then cryellow else crnocolor
    if the field is numeric but you don't see the 0 check check if : Suppress if zero is ticked in the Number format tab.
    Regards

  • Custom Shared Variable: Setting default values

    Hi All,
    Is there any way to set default value to a custom shared variable (2D Array of Strings) hosted in cFP-2220 target.
    Problem: Reading a custom shared variable after rebooting the target, doesn't contains the recently updated values.
    Thanks, 
    Bhaskar 

    To me the one way it is possible is to log the details to a file and upon launch read the file.

  • 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

  • Set Radio Group Default Value Based on a Select List Change Event

    Apex 4.2
    I have a radio group that is source is below. It returns 3 radio group item All,Miv,Courier
    SELECT type d, code r FROM vw_lov_depot
      WHERE svc_name = :P320_DEPOT
      ORDER BY 1
    The radio group is only populated when :P320_DEPOT gets a value, this is a select list.
    I am trying to set the radio group to  default to this value Miv it would use the statement
    SELECT type d, code r FROM vw_lov_depot
      WHERE svc_name = :P320_DEPOT
      and type ='Miv'
      ORDER BY 1
    I have tried creating a dynamic action on Select list change to populate the default value of the radio group...no joy I also tried a computation. how can I set this default value on when list changed.
    Thanks
    I have got the default Radio Group Selection working by doing a computation before region on the radio group and calling its select statement and setting the value. But the problem is now I cannot change the radtio group as I do it fire the before region trigger and sets it back to the default value....any help?

    Hi,
    Could you please create example to apex.oracle.com?
    Regards,
    Jari

  • Need to set default values for the fields plant and location in ME21N

    Hi All,
    i need to set default values for the fields plant and location in ME21N tcode.
    In accout assignment if we give 'A' then we need to create asset by clicking the Asset tab,there you have the fields plant and location.
    How to resolve this?
    Thanks in Advance

    hi .
    i needed to set default strorage location and plant in personal setting  in me21n.
    i solve it with this way.
    go to program SAPLMEPERS in se38.
    create new function in output with the sample name :MODULE ZTEST_001 OUTPUT.
    in this module write:
    if MEPOITEM_PROP-WERKS is INITIAL and  MEPOITEM_PROP-LGORT is INITIAL.
    MEPOITEM_PROP-WERKS = '1000'.
    MEPOITEM_PROP-LGORT = '0032'.
    endif.
    this is the solution.
    best regards.
    maryam

Maybe you are looking for

  • PF- Mid month employees

    Hi all, I am facing some issue in the provident fund for the Mid month joined employees. As per the client requirement, SAP is not calculating. I need your help in this. For all the employees we are maintaining the IT 0587 has whichever is less. I go

  • Conversion to epub questions

    I have IDCS5.5 and 6. I had in .id file which was done in CS3 opened and saved in 5.5 I need to convert to epub. I'm working in 5.5 using the articles window and I'm in the process of anchoring the images in. The book is 300 pages but I'm just settin

  • One iTunes account - 1 MacPro, 1 iPad, 1 iPhone, 2 iTouch, 1 iPod

    We have multiple devices on one iTunes account.  Is there away to sync Apps, Music - but have separate Contacts and Calendars? Karen

  • Debug Assertion Failed!

    Hey guys, I got this from right clicking on my desktop. https://dl.dropboxusercontent.com/u/21656944/Debug%20Assertion.png what do i do to solve this? I reinstalled my visual C++ 2008 and 2010s I looked at other threads. didn't really help. Thanks gu

  • User gets locked by an external system but which one?

    Hi, In an abap system, we have changed the password of our administration user. Afterwards, this user gets locked every 5 minutes, obviously because the user and old password has been used to set up communication from another system to the abap syste