Dynamic LOV based on Current user

How do i make a dynamic LOV based on the user id of the current user.
Also how to insert values from a form into a database
Can anyone please help me out.
Thanks

Use portal.wwctx_api.get_user to get the currently logged in userid.
The simplest example of a form manipulating data is to create the form based on a table. All DML works automagically. You can base your form on a procedure with dummy columns and do your own DML if you wish. Lots more flexibility that way...

Similar Messages

  • Creating a dynamic lov based on a column

    Hi,
    I want to create a dynamic lov based on a column in a database-table.
    Eg. the query
    'select code, description from code_table'
    is the contents of the column 'lov_query' in the table 'parameters'.
    For every parameter there can be a different lov-query, but the result is always
    two columns (code and description, number and name, etc.), exactly what you need to use in a lov.
    I've written a (dbms_sql) function that takes the parameter-id and returns the lov_query.
    create or replace function "GET_PMR_LOV"
    (pmr_id in NUMBER)
    return VARCHAR2
    is
    cur INTEGER := DBMS_SQL.OPEN_CURSOR;
    fdbk INTEGER;
    l_pmr_id NUMBER(9) := pmr_id;
    l_stmnt VARCHAR2(2000);
    begin
    DBMS_SQL.PARSE
    (cur, 'select pmr.lov_query from parameters pmr where pmr.ID ' || ' = 'L_PMR_ID', DBMS_SQL.NATIVE);
    DBMS_SQL.BIND_VARIABLE (cur, 'L_PMR_ID', l_pmr_id);
    DBMS_SQL.DEFINE_COLUMN (cur, 1, l_stmnt, 2000);
    fdbk := DBMS_SQL.EXECUTE (cur);
    fdbk := DBMS_SQL.FETCH_ROWS (cur);
    IF fdbk > 0
    THEN
    DBMS_SQL.COLUMN_VALUE (cur, 1, l_stmnt);
    return (l_stmnt);
    ELSE     
    return null;
    END IF;
    DBMS_SQL.CLOSE_CURSOR (cur);
    END;
    But now I'm stuck on how to pass on this statement in HTMLDB
    as an dynamic lov, I don't seem to be able to execute this statement
    into the two display and return columns. Any ideas?

    Hello again,
    This lov is on an updatable report-column where the user has to make a choice from an non-named, popup and query-based lov. In the lov-query box I have just put:
    "return get_pmr_lov(:p41_param_id)" (without the quotes ;-)
    Here's my latest version plus an alternative, which both seem to work fine:
    create or replace function "GET_PMR_LOV"
    (pmr_id in NUMBER)
    return VARCHAR2
    is
    cur INTEGER := DBMS_SQL.OPEN_CURSOR;
    fdbk INTEGER;
    l_pmr_id NUMBER(9) := pmr_id;
    l_stmnt VARCHAR2(1000);
    begin
    DBMS_SQL.PARSE (cur, 'select pmr.lov_query from paramaters pmr where pmr.ID ' || '= :L_PMR_ID', DBMS_SQL.NATIVE);
    DBMS_SQL.BIND_VARIABLE (cur, 'L_PMR_ID', l_pmr_id);
    DBMS_SQL.DEFINE_COLUMN (cur, 1, l_stmnt, 1000);
    fdbk := DBMS_SQL.EXECUTE (cur);
    fdbk := DBMS_SQL.FETCH_ROWS (cur);
    IF fdbk > 0 THEN
    DBMS_SQL.COLUMN_VALUE (cur, 1, l_stmnt);
    return (l_stmnt);
    ELSE
    return null;
    END IF;
    DBMS_SQL.CLOSE_CURSOR (cur);
    END;
    create or replace function "GET_PMR_LOV2"
    (pmr_id in NUMBER)
    return VARCHAR2
    is
    l_pmr_id NUMBER(9) := pmr_id;
    l_stmnt VARCHAR2(1000);
    BEGIN
    EXECUTE IMMEDIATE 'select pmr.lov_query from parameters pmr where pmr.ID = :1'
    INTO l_stmnt USING l_pmr_id;
    return l_stmnt;
    END;
    The error-message remains the same, unable to bind :p41_param_id !

  • How can I filter a Sharepoint 2007 libarry list based on current user login?

    Hi all.
    I would like to know how I can filter a SharePoint library list based on current user login.
    Suppose I have created the followings:
    1) A SharePoint form library containing bunch of uploaded InfoPath form data.
    2) The InfoPath form template contains a promoted text field called "TargetUser" to store user domain login (ex: DOMAIN\JOE) and every InfoPath form file in the library has a valid domain name stored in the "TargetUser" field.
    I have created a custom view for the form library and would like to filter this view so only items whose "TargetUser" field matches current user's login ID are displayed.
    I went to Edit View page to customize the view and tried to use the [Me] function but I got a "Filter value is not a valid text string" message instead when clicking OK. Apparently [Me] returns a Person/Group data type and the filter cannot compare its value
    to that of "TargetUser".
    I tried using text functions (ex: TEXT([Me],"") hoping to extract default string value from [Me]. The filter accepts the parameter without any error but the resulting fitlered list does not display any items at all.
    I have googled this subject for hours but I have not found any solution.
    It would be greatly appreciated if anyone can help me to create a functional filtered list.
    FYI, my SharePoint 2007 installation is just WSS 3.0 + Form Server. I do not have MOSS 2007 (so no MOSS 2007 web parts or web services).
    Thank you.
    Jason

    Here's what I usually do in order to accomplish this.  Ultimately you'll need to have 2 different fields.  There's the one you already have, with DOMAIN\username stored in it.  Then you'll need an additional field as a "person" column type. 
    Call it "TargetPerson" or something.
    Create a sharepoint designer workflow that runs each time an item is created or changed.  One action:
    Set FIELD to VALUE.
    The first FIELD is "TargetPerson", the VALUE is your "TargetUser" field. 
    Once this is done, then the person value is stored in the person field.  This is the field that you can filter by "TargetPerson" is equal to [Me]
    Laura Rogers, MCSE, MCTS
    SharePoint911: SharePoint Consulting
    Blog: http://www.sharepoint911.com/blogs/laura
    Twitter: WonderLaura

  • Controlling report output based on current user

    Hi all,
    I am building a small app with APEX for a sales team.
    We have the site and app hosted by another company.
    I have built a report showing sales summary for the company. The problem is that the report is showing all sales for all sales people.
    What I want is for the report to show data based on the user that is logged in, so that the user only sees his items.
    In fact, this would be a useful thing to learn for me, because I could use this functionality on several other pager, so this will be a good example for other situations.
    So far I have:
    I have a database table that keeps track of the sales reps.
    Each sales rep in that table is assigned a unique EMP_id, which is an autonumber column of that table, and is also the primary key.
    The table also contains a column named: "User login Name" which is their login ID (the one they use to log into the application.
    Possible solution (I think):
    when user logs into APEX, retrieve their EMP_id from the EMP table based on their login name,
    Hold the EMP_id in a variable for the duration of the session,
    pass the variable to the SQL query for the report in the where clause.
    Is this a good solution? or is there a better way to do this?
    Can anyone advise on how to get this done please,
    Thank you.

    Hi,
    Sorry - I guess I should have said where to create the function!
    You can keep those steps or keep with your own method as both should return the value you need. I usually store the result of that value in G_USER - similar to Tyson's method - when the user logs in and then use :G_USER wherever I want to use it in filters etc. However, if I need to create SQL Views, I have to use the GETCURRENTUSERID() function instead.
    Andy
    ps - I used MIN() in the function to ensure that I only get one value returned. The method SELECT .... INTO .... only allows us to set a variable to one value and, sometimes, more than one value is returned by the SELECT statement and this would generate an error. Of course, there should be just the one value that matches the current user, but I always assume the worst! The statementS:
    SELECT MIN(EMP_ID) into user_id FROM S_USERS WHERE UPPER(LOGIN_ID) = UPPER(v('APP_USER'));
    user_id := CASE WHEN user_id IS NULL THEN 9999999999 ELSE user_id END;could also be written as:
    SELECT EMP_ID into user_id FROM S_USERS WHERE UPPER(LOGIN_ID) = UPPER(v('APP_USER')) AND ROWNUM = 1;
    user_id := CASE WHEN user_id IS NULL THEN 9999999999 ELSE user_id END;or
    SELECT NVL(MIN(EMP_ID), 9999999999) into user_id FROM S_USERS WHERE UPPER(LOGIN_ID) = UPPER(v('APP_USER'));

  • Is it possible to filter list view based on current user logged in

    Hi,
    Is it possible to filter the list view results based on the current user logged in. I have a scenario wherein i want to show only those list items to the user which contains his/her name under the column Approver (a list column).
    So if i login to the page, then only those requests should show up which has my name as the Approver, and so on.
    Is it possible please ?
    Thank you.

    Hi Prajk, you could use audience targeting for this. An alternative would be to create a view and add a filter so that "Approver" is equal to [Me]
    cameron rautmann

  • Dynamic LOV based on report column

    HI,
    I've a standard report with Two columns. Column1 is standard Report Column and Column 2 is a LOV based on an SQL Query.
    Now I need to filter the LOV (add a where clause) based on the value in the column1.
    For example, consider Column1 as "country" and column2 as "state". so the in column2(LOV), user should see only the list of states belongs to the corresponding country(Column1)
    Please note that the report is based on an SQL query
    Any clue on how to do this.
    I'm using APEX4.1.
    Thanks in advance
    Prasanth

    I think you are looking for this https://forums.oracle.com/forums/search.jspa?threadID=&q=tabular+form+cascade&objID=f137&dateRange=all&userID=&numResults=15&rankBy=10001
    please search the forum before posting a question
    Thanks

  • Blazeds + Spring security: fetch data based on current user

    Hi,
    I'm currently learning flex by trying to build an application with
    flex, blazeds and Spring. My application lets users log on using
    spring security (which I will probably combine with
    AcegiLogonCommand). I would like my assemblers to return different
    data based on which user is currently logged on (for instance to show
    that specific user's to-do list). To do this, I added a userId
    property to my spring security principals (by subclassing
    org.springframework.security.userdetails.User)
    and added user_id columns to user-specific data in the database. Now
    I would like to know how I can get the currently logged on user in my
    assembler so I can use its userId to fetch the user's data.
    Is the assembler the right place to decide which data to send to my
    flex application? If so, can anyone tell me how to determine which
    user is currently logged on in my assembler? If not, what would be the
    recommended way of dealing with user-specific data in my database in
    combination with blazeds?
    The only examples I have been able to find on the Internet so far only
    use different roles to determine what a user is or is not allowed to
    do, I have yet to find any examples where users store and retrieve
    user-specific data.
    Kind regards,
    Jeroen

    Hi,
    There is a field “Target Audience” in list whenever “Target Audience” is enable in “List Settings”, it accepts the name of a SharePoint group.
    For your requirement, you will need to get the name of the group which the current user belongs to. Then perform a query in a specific list to get all the items that
    contains the specific value in “Target Audience” field.
    Here is a code snippet about how to set Target Audience for an item, there are code lines about
    how to get the value of a “Target Audience” field:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/a3ac41d8-42e9-4ec7-999f-036c4b06d3e2/programatically-set-target-audience-in-list-item
    A method about checking whether the current user is a member of the specified group:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.iscurrentusermemberofgroup.aspx
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • Filter Project Server custom field based on current user?

    I've got a Project Server 2013 custom field, and I'd like to create a view that only shows me projects where the value in that custom field equals the current user. Simply put: I'm trying to find functionality similar to the [Me] filter in SharePoint.
    Apparently, simply using [Me] doesn't work. How can I fix this?

    I am trying to do something similar. were you able to find a solution to this? I am assuming no. 
    Parthiv Bhuta . Consultant

  • Powershell: Add registry value based on current user

    I would like to automate a network printer install that uses secure print. I can push the actual install out through group policy, but I need script that will assign each persons unique ID number to the printer settings. 
    Get current user name
    Check that user name against a spreadsheet or .txt file list. This list would have hundreds of unique user names in column A, and a unique ID number in column B.
    Example:
    Column A (username)               Column B (ID Number)
    User 1 
          123456
    User 2
          789101
    Write the ID number in column B to a specific registry value.
    Any idea's??

    You would use New-ItemProperty or Set-ItemProperty to write a registry value. New-* will allow you to set the value type (you can use -Force if it already exists). Here's an example of using Set-*:
    # Set a value named 'ValueName' in the key stored in $RegPath to 'ValueGoesHere'
    Set-ItemProperty -Path $RegPath -Name ValueName -Value ValueGoesHere
    If you need to get a value, you can use Get-ItemProperty:
    # Get all values for the Windows Update service's key:
    Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\services\wuauserv
    # Just get the start value (returned as an object with start and extra PS properties):
    Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\services\wuauserv -Name Start
    # Just get the start value (just the value):
    Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\services\wuauserv | select -exp Start
    (Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\services\wuauserv).Start

  • Master Details form (LOV based on Detail Column of Join Condition)

    I have created a master detail form where user_id is joining master and details.
    I have created one dynamic lov based on child user_id in detail block to diplay all user who works under current user.
    Problem : When i want to select Insert detail action in detail block the dynamic lov should read the user_id which is going to be inserted when you press Save button. Means as its not getting populated till one click on save button my lov is not getting refereshed.
    Please advice what should i do.
    Thanks
    Bakulesh

    I solved myself by modifing some guru's script from this forum little bit. I am adding here for feedback or use to any.
    htp.p('<script language="JavaScript1.3">
    function getMstFieldValue(form,fieldName)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    var blkname;
    for(var i = 0; i < form.length; i++)
    slicedName = form.elements.name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    blkname = slicedName[1];
    //alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName && blkname == "MASTER_BLOCK")
    return form.elements[i].value;
    function setDetFieldValue(form,fieldName,value)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    var blkname;
    for(var i = 0; i < form.length; i++)
    slicedName = form.elements[i].name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    blkname = slicedName[1];
    //alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName && blkname == "DETAIL_BLOCK")
    form.elements[i].value = value;
    </script>');
    thanks
    Bakulesh

  • Select item on a Tabular form with a different dynamic LOV on each row

    I would like to use a tabular form where one of the columns is a dynamic LOV based Select, and where that dynamic LOV refers to one of the column values on each row.
    So if the tabular form represented a list of teams and the LOV-based Select column was the current team leader, I would want that select list to be populated only with the members of that team (different for each row). Since the list of team members is in some other table (all_players or something) I would want to populate the LOV with a query with a where clause that selected only those players records with a team-membership equal to the current tabular form's team id. So, on each row that select list's contents would be different.
    -- Justin

    I'm beating a dead horse here but I did get something to work with "less" code. My current needs do not require me to cascade drop downs, I only want 1. You can use the query like the in the first reply (but I don't have a table with joins) I created a simple two column table dept_emp with 4 records 10,null 20,null .... I want to fill the nulls with an employee but ONLY an employee that matches the dept. (Same concept of team leader and members).
    Here's the query:
    select apex_item.display_and_save(1,dept) dept,
    apex_item.select_list_from_query(2, name, 'select ename from emp where deptno='||dept) name
    from dept_emp
    I removed the code that was there already (ApplyMRU) and just put in this code:
    BEGIN
    FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
    UPDATE dept_emp
    SET
    name=HTMLDB_APPLICATION.G_F02(i)
    WHERE dept=to_number(HTMLDB_APPLICATION.G_F01(i));
    END LOOP;
    END;
    The G_F01 matches the column 1 and so forth. There's more documentation but little explanation at:
    http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/api.htm#sthref2171
    The thing I could not get to work was a dynamic message
    #MRU_COUNT# row(s) updated, #MRI_COUNT# row(s) inserted.
    Not sure when the MRU_COUNT gets populated (probably in the routine I removed ;))
    You're probably way past me by now but I like to have as little code as possible when it comes to maintaining an app. That's why I liked oracle forms so much. This kind of stuff was pretty easy to do.
    Thanks again everybody!

  • Testing a user group field with the current users group

    I have a list which has a column which contains groups.
    I want to create a view with a condition that the current users group should match the group of that field.
    for testing against current date, its [today]
    for testing against the current user, its [me]
    is that a standard way of testing against the current user.
    Tnx 

    Hi,
    According to your post, my understanding is that you want to create a standard view to filter on the current user’s group.
    Per my knowledge, it’s by designed that the [Me] function is only supported to filter on the current user in a SharePoint list view.
    If you want to filter on the current user group in the list view, I recommend that you can try to use the following methods to implement it in your environment.
    1.  Modify the query on a web part in SharePoint Designer:
    http://www.makdeniz.com/how-to-filter-sharepoint-2010-tasks-which-are-assigned-to-you-and-the-group-your-are-member-of/
    2.  To create a custom web part filter that will dynamically filter your content.
    http://christopherclementen.wordpress.com/2012/04/02/filter-a-list-dynamically/
    Whatever your choice, the query will be the following:
    <Or>
    <Membership Type=”CurrentUserGroups”>
    <FieldRef Name=”AssignedTo”/>
    </Membership>
    <Eq>
    <FieldRef Name=”AssignedTo”/>
    <Value Type=”Integer”>
    <UserID/>
    </Value>
    </Eq>
    </Or>
    For more information, you can refer to:
    http://christopherclementen.wordpress.com/2013/05/20/filter-on-current-user-and-current-user-groups/
    http://go.limeleap.com/community/bid/297846/Custom-List-View-Based-on-Current-User-Using-SharePoint-Designer
    http://spuser.wordpress.com/2012/01/13/filtering-list-items-in-sharepoint-based-on-current-user-and-current-user-groups/
    http://techtrainingnotes.blogspot.com/2012/10/sharepoint-filtering-view-by-group.html
    Best Regards,
    Yumi Fu

  • Dynamic LOV query

    Hi,
    Anyone can share with me of how to apply dynamic LOV?
    let say user choose messagechoice value = 'A' then messagelovinput will only execute query A and display the list of LOV values.
    if user choose messagechoice value = 'B' then messagelovinput will execute query B and display its LOV values.
    Pls help..

    yuchijoyce wrote:
    actually try to pass in parameter into the functions and return a list of values into the lov, is there any sample coding for reference?:( Not sure what do you mean by this??
    But if you want that to make use of a function that can give you list of value. Then you can follow the approach mentioned by Anil, thereby you will be creating a Function in database that is going to return different query based on conditions and you can base LOV vo object on this function.
    Hope it works :)
    Thanks
    AJ

  • How to get the current User Id

    Hi,
    is there any system variable containing the current "user code"
    because, based on current user code, i would like to get the branch from OUSR, so that, one query can display only those records pertaining to that branch.
    Thanks & Regards,
    Kr

    Hi
    You can create a formatted search to get and the following query:
    SELECT T0.U_NAME FROM OUSR T0 WHERE INTERNAL_K = $[USER]
    Paulo Calado
    SAP Business One Forums Team

  • Popup list manager and dynamic LOV

    I'm stumped, stuck and thought I was doing something simple. Here's what I have:
    1) Checkbox dynamically built (P3_CHECKBOX)
    2) A hidden field to store the checkbox values (P3_CHECKED)
    3) A popup list manager based on the hidden field.
    I am using JavaScript to populate the P3_CHECKED whenever P3_CHECKBOX is changed. However, my dynamic LOV based on the hidden field always returns no rows. The SQL for the LOV is:
    select application_role, role
    from roles_view
    where '%'||application||'%' LIKE to_char(:P3_CHECKED) order by 1
    Am I missing something simple? I know the hidden field is getting populated because if I change to field to text, I see the data change. There is also data in the table because executing the query using the data in P3_CHECKED returns the expected rows.
    Any help would be appreciated.
    Mike

    Mike,
    The lov query accesses the value of P3_CHECKED from session state. That isn't stored in session state until the page is submitted.
    Scott

Maybe you are looking for

  • Adobe Bridge CS3 - Favorites Disappear

    Every time I open Adobe Bridge CS3 I set up my favorites folder just the way I want them; but when I close the program down and reopen it, the favorites menu has been cleared. I tried saving my work space; But this was to no avail. The work space lay

  • Why can't Photoshop CS4 open/save as PNG?

    I recently had to downgrade to CS4 and I've been having A LOT of issues with it. The biggest one being the inability to cooperate with PNG files. Online I've seen a few sollutions and I tried them all. I have PNG.8BI in my plug-ins folder in my Progr

  • Smartview for Office 11.1.2 and Office 2010 (64 bit)

    Hi to all, does anyone have some experiences if Smart View for Office works with Office 2010 in an 64bit environment? I know this is not yet officially supported, but what could be possible issues? Regards Uli

  • I am unable to recieve any updates from Windows through Mozilla, I cant download anything

    When I want to get updates it won't go through.

  • Closed field in PR

    Dear all Partial quantity ordered and supplied against a PR. Now i do not want further material against this PR. I have checked the "closed" field in the PR. Even after this the system allow me to create PO against this PR. Not only this the system a