CAML query to get task assigned to current logged in user

I want to know the CAML query to get tasks assigned to the currently logged in user
Nour

Hi,
This is the query that worked for me
<Where>
<And>
<Or>
<Membership Type=’CurrentUserGroups’>
<FieldRef Name=’AssignedTo’ />
</Membership>
<Eq>
<FieldRef Name=’AssignedTo’  LookupId=’TRUE’ />
<Value Type=’Lookup’>123</Value>
</Eq>
</Or>
<Neq>
<FieldRef Name=’Status’ />
<Value Type=’Text’>Completed</Value>
</Neq>
</And>
</Where>
Regards,
Nishant Rana
http://nishantrana.wordpress.com https://twitter.com/#!/nishantranacrm

Similar Messages

  • Query or Profile Option to find Current logged in user in oracle apps R12

    Query or Profile Option to find Current logged in user in oracle apps R12.
    I want to get value of current user who is logged in to that particular session, based on the value of user_id or user_name returned i have to do a Forms Personalization.
    Plz help.
    Regards,
    Sadiya P.

    Hi Sadiya,
    do you have the answer for this? please send it to me because i am also have same requirement. so plz post it here....

  • How to get the name of currently logged in user in the network

    Hi all,
    I want to know if there's a way to get the name of the currently logged in user in the network.
    SYS_CONTEXT('USERENV','OS_USER') won't work for me because our users do not loggin in portal.
    Any ideas?
    Thanks in advance.
    Brett

    Hello, I had the same problem. Here is a smaller version to find the Group of the current User.
    The VI get the members of a Group and match it with the Username.
    Note :
    If the User belongs to multiple Groups the the VI returns only the 1st Groupname
    If the User belongs to no Group then the VI returns "unknown Group"
    The VI is written with LabVIEW 2010 and TestStand 4.2.1
    Attachments:
    current user group.vi ‏20 KB
    TestStand get Group of current User.PNG ‏43 KB

  • GPUpdate /force in Task Sequence as current logged on user

    Hi,
    I am currently trying to "upgrade" around 800 installations of Microsoft Office Standard 2010 to Microsoft Office 2010 Professional Plus. To do this, I'll have to:
    1: Install Office 2010 ProPlus
    2: Uninstall Office 2010 Standard
    3: Repair Office 2010 ProPlus
    Due to these steps, I've decided to make a task sequence to do the magic.
    So far, so good, the "upgrade" is installing, and the MAP toolkit reports are showing the correct results from my test lab.
    During the repair of Office 2010 ProPlus, the Office applications cannot
    run, so I've created a task to copy a custom group policy to %systemroot%\System32\GroupPolicy to deny the affected users to start the applications.
    After applying the group policies, I manually run a gpupdate /force on my test computer. The applications are not starting. Also - so far so good.
    Ok, so here is my challenge:
    Since the Task Sequence is running in context of the SYSTEM account, the applied group policy will not refresh the GPO's of the current logged on user. Meaning; during the installation / repair of Office 2010, the user can open all the applications regardless
    of the applied GPO's, and I'd very much like to avoid that. The TS will fail otherwise. Yes, I know I can perform a restart to apply the policies, but I'd like to avoid that as well.
    Any idea how can I solve this?

    I think you're making it very complex for yourself. I think that the PowerShell App Deployment Toolkit would be very benificial for a situation like this. For more information have a look here:
    https://psappdeploytoolkit.codeplex.com/
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • My Tasks View in my custom task list fails to display the tasks assigned to me (that is the currently logged in user)

    Hi
    I am new to sharepoint 2010.
    I created a custom task list, where I  have many tasks assigned to users (I had tasks assigned to me as well). I created a view as "My tasks "and having a filter as Assigned To is equal to [Me]. When I do that my view fails to show the
    tasks assigned to me. This happens same with the Sharepoints 'My Tasks' view as well. I tested by creating some test tasks under my name and when I selected 'My Tasks' view no tasks are getting displayed.
    Please help.
    Thanks,
    Gokulkumar.

    Hi,
    According to your post, my understanding is that you wanted to display the tasks assigned the current logged in user.
    In my environment, if I used the System Account, My Task view didn’t display any tasks.
    However , if I used other users except the System Account, My Task view could display current user tasks correctly.
    I recommend to use other accounts except System Account to log in site. Then everything will work well.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Checking to see if current logged in user is delegated by user on a task

    Hello all.
    I am looking to produce a report that will be run from a users home page (and thus can't take input at run time). It is to show the status of all tasks and appointments.
    The tricky bit is that I need it only to show tasks where the currently logged in user is the user who last delegated the task. I can make this work for the "owner" but not "delegated by".
    As a fall back position I might be able to get away with it looking to check if the current logged in user is the same as the "created by" user, as activities will only rarely be reassigned on.
    Any help appreciated.
    Bob.

    Hi,
    I am writing in to see if there is any update regarding this issue.
    Thanks,
    Linda
    Linda Li
    TechNet Community Support

  • Get username and password of the currently logged-in user in CRM and pass it to the plugin

    Hi,
    I am integrating CRM Online and SharePoint Online. Right now I am using Office365 trial version for both. Hence, the same username and password works for both.
    I want to create sub-site in SharePoint on create of an entity record. Currently, I am passing the admin credentials. But, I want to pass the credentials of the currently logged-in user in CRM to the plugin which is getting executed on create of account entity.
    So that I can then create sub-site in SharePoint using the current user credentials instead of admin credentials.
    Is there way to achieve this?

    Hello,
    You would not be able to get login/password of currently logged in user. I believe usage of admin credentials is the best way to achieve your goal.
    Dynamics CRM MVP
    My blog

  • How to get tasks assigned to me or group in which I belong to using Search Query?

    Hello,
    I want to get the tasks assigned to me or tasks assign to me in which I belong to. I know how to get it using CAML query however I want to get it in my custom search display template using Content Search Web Part.
    <Or>
    <Membership Type="CurrentUserGroups">
    <FieldRef Name="AssignedTo"/>
    </Membership>
    <Eq>
    <FieldRef Name="AssignedTo"/>
    <Value Type="Integer">
    <UserID/>
    </Value>
    </Eq>
    </Or>
    Please let me know how to filter tasks assign to group in which I belong to.
    Here is query which shows tasks assign to me but not to tasks assign to my groups
    (ContentType:Task OR ContentType:RequestTaskContentType OR ContentType:DelegacyAccountingContentType) AND
    AssignedTo:{User.Name} AND
    -Status:Completed AND -Status:Closed AND Status:"Not Applicable"
    Thanks & Regards,
    Jay
    Jayesh Prajapati

    Hi Jay,
    No, you can filter tasks assign to group in which you belong to using Content Search Web Part. Because there is no Query variable for current user group in SharePoint 2013 Search Query. You can have a look at the article:
    https://technet.microsoft.com/en-in/library/jj683123.aspx?f=255&MSPPError=-2147217396
    For a workaround, you can use the My Tasks web part outside of MySites:
    http://bernado-nguyen-hoan.com/2013/03/03/making-my-tasks-web-part-available-outside-of-mysites/
    http://yalla.itgroove.net/2014/04/27/use-sharepoint-tasks-web-part-outside-sites/
    Best Regrads,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • CAML Query to get Items based on Year and Month From Date Column

    Hi All,
           * As we knew that there are default columns in calendar like Stattdate,Title,Location..etc.
            * I required the CAML Query to get the list items of calender of particular Month and Year,So that I can get number of items or evetns are in Calendar
    Can any one help me how can I do this using caml query
    Samar

    Hi Stuart,
                 Thanks for your response,I had chosen 2nd option of our above mention suggestion.But when I try to fetech the data from a calendar it is showing below error .I
    had checked the below code with oter lists by changing Type to text and it worked fine.Can you please help me how can I fetech for the calulated columns
    Error
    "One or more field
    types are not installed properly. Go to the list settings page to delete these
    fields. "
    Code:
     string year="2014";
                string month="February";
                SPSite mysite = SPContext.Current.Site;
                SPWeb myweb = mysite.OpenWeb();
                try
                    SPList mylist = myweb.Lists["Calendar"];
                    SPQuery myquery = new SPQuery();
                    myquery.Query = @"<Where>
                                          <And>
                                           <Eq>
                                             <FieldRef Name='Year'/>
                                             <Value Type='Calculated'>"
    + year + @"</Value>
                                          </Eq>
                                          <Eq>
                                             <FieldRef Name='Month'
    />
                                             <Value Type='Calculated'>"
    + month + @"</Value>
                                          </Eq>
                                         </And>
                                      </Where>";
                    SPListItemCollection totaltiems = mylist.GetItems(myquery);
                   Label1.Text= "Total Number of Items is "+" "+totaltiems.Count.ToString();
                catch (Exception ee)
                    Label1.Text = ee.Message;
                finally
                    myweb.Dispose();
    Calculated Columns
    Samar

  • CAML query to get itemcount from sharepoint list based on Month/Year

    Hi,
     I have a SharePoint list with date field. Now I wan't to get item count for each month in Fiscal Year using SP Services. Hence, need a CAML query to get item count . Any suggestions will be appreciated.
    Thanks in Advance.

    When you have your month, you'll need to calculate the first day and last day of the month and convert them to the ISO using to ISOString.
    startDate.toISOString();
    endDate.toISOString();
    function searchList(startDate, endDate) {
        var nURL = "/_vti_bin/lists.asmx";
        var soapEnv = "<?xml version=\"1.0\" encoding=\"utf-8\"?> \
                                 <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
                                  xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
                                  xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">
                                  <soap:Body> \
                                  <GetListItems xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\">
                                  <listName>{YourList}</listName> \
                                  <viewFields></viewFields> \
                                  <query><Query><Where><And><Geq><FieldRef Name='DateField'
    /><Value Type='DateTime'>" + startDate +"</Value></Geq><Leq><FieldRef Name='DateField'><Value Type='Datetime'>"+endDate+"</Leq></And></Where></Query></query> \
                                  <queryOptions><QueryOptions><ViewAttributes Scope='Recursive'/></QueryOptions></queryOptions>
                                  </GetListItems> \
                                      </soap:Body> \
                                  </soap:Envelope>";
        $.ajax({
            url: nURL,
            beforeSend: function(xhr) {
                xhr.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/GetListItems");
            type: "POST",
            dataType: "xml",
            data: soapEnv,
            complete: processResults,
            contentType: "text/xml; charset=utf-8"
    function processResults(xData, status)
      var i;
       result = $(xData.responseText).find("z\\:row, row");
        if (result == undefined) {
            result = $(xData.responseXML).find("z\\:row, row");
        $(result).each(function(i, data) {
        //Magic   
          i++; 
        return i;
    Brandon James SharePoint Developer/Administrator

  • How to get current logged-in user name in data access driver or in universe

    In universe, to get the current log in user is via @Variable('BOUSER').
    Right now, I need to be able to get the user name in the data access driver. I am writing a customized data access driver because we need to patch some where clause on the the query generated by the universe based on the logged-in user info. I only think of using end_sql parameter or adding an universe level filter to patch the @Variable('BOUSER') to the query, which would not work if user want to use customized query.
    Can anyone tell me how to get currentBO user name from connection server ? or how @Variable('BOUSER') is translated into the logged-in user name in the universe?

    I do not know your EJB Service. But you should pass the credentials of the current logged on portal user to your service. That's not by default I think.
    I had a similar problem with CAF developed webservices. I had to turn on permission checks in my web service and passed the credentials via logon ticket.
    Regards, Bernd

  • Need query to determine current logged in user

    Because I see no way in sccm 2012 to determine if someone is currently logged into a domain joined computer.  Does anyone have a query or know of a way to get the current logged in user of a computer? I am surprised that SCCM does not show that information
    when looking at the particular device.  I did find a powershell query that I use that tells me the last logged in user but it gives me no indication if the user is currently logged in or if it was a week ago.
    Thank you.

    This PowerShell script queries a remote machine to obtain the current logged on user.  It's available on the Repository (https://gallery.technet.microsoft.com/scriptcenter/d46b1f3b-36a4-4a56-951b-e37815a2df0c).
    function Get-LoggedOnUser {
    #Requires -Version 2.0
    [CmdletBinding()]
    Param
    [Parameter(Mandatory=$true,
    Position=0,
    ValueFromPipeline=$true,
    ValueFromPipelineByPropertyName=$true)]
    [String[]]$ComputerName
    )#End Param
    Begin
    Write-Host "`n Checking Users . . . "
    $i = 0
    }#Begin
    Process
    $ComputerName | Foreach-object {
    $Computer = $_
    try
    $processinfo = @(Get-WmiObject -class win32_process -ComputerName $Computer -EA "Stop")
    if ($processinfo)
    $processinfo | Foreach-Object {$_.GetOwner().User} |
    Where-Object {$_ -ne "NETWORK SERVICE" -and $_ -ne "LOCAL SERVICE" -and $_ -ne "SYSTEM"} |
    Sort-Object -Unique |
    ForEach-Object { New-Object psobject -Property @{Computer=$Computer;LoggedOn=$_} } |
    Select-Object Computer,LoggedOn
    }#If
    catch
    "Cannot find any processes running on $computer" | Out-Host
    }#Forech-object(Comptuters)
    }#Process
    End
    }#End
    }#Get-LoggedOnUser

  • OIM11gr2 - How to get currently logged in user details using oim api

    Hi All,
    I have a requirement to retrieve currently logged in users profile in the process adapter.
    I have tried with getSelfProfile in tcUserOperation and also ContextManager.getOIMUser API's however, in both the cases i am getting xelsysadm details only.
    Also as know request details in Process task mapping doesnot work for OIM11g onwards (its returning column not found exception )
    DOes any one has idea how to achieve this.
    PS. - i am using platform to retrieve API's.
    Thanks & Regards
    Swati Pandey

    You can get the logged in user name using the below java code:
    ADFContext adfCtx = ADFContext.getCurrent();
    SecurityContext secCntx = adfCtx.getSecurityContext();
    String user = secCntx.getUserPrincipal().getName();
    HTH

  • Current logged-in user in workflow-task

    Hi,
    I'm working on an approval task where I've got some problems in determining the items an aprovee may approve.
    The structure is as followed:
    A user requests something that his manager and the manager's manager have to approve sequentially. The manager and the manager's manager should only be able to approve requests of users that have a direct connection to them (regarding business units).
    What I am now searching for is a variable oder method to determine the current logged-in user (MSKEY or Unique ID) in the worklow system so that I can create a filter for approvees (SQL statement) to filter out all not direct linked users.
    I hope somebody can help me.
    Regards,
    Andreas Dietrich

    Andreas,
    Good question.  You need to have some sort of "Managed by" Attribute.  This attribute does exist in most LDAP directories and HCM packages, however there is NO guarantee that these attribues are populated.  The other possible thing to do is setup a relationship as follows:
    All members of the Sales Team are in the SALES
    The Sales Manager can be identified with a role of SALES MGR
    The Sales VP can be identified with the role SALES VP
    In the workflow, use an approval task and write a query that would reflect the fact that the SALES MGR can approve requests from SALES
    Use the Access control tab and set it up a filter sot that SALES MGR can execute on behlaf of SALES and so on.
    Hope this helps,
    Matt

  • How to get Current Logged in user in Java

    Hi All ,
    I have written a code in to get the current logged in user in the portal in an EJB service.  I have used the code
    *IUser user= UMFactory.getAuthenticator().getLoggedInUser();*. But surprisingly the userId which it returns is always is Guest. Can you please help on this issue.
    Thanks & Regards,
    Rohit

    I do not know your EJB Service. But you should pass the credentials of the current logged on portal user to your service. That's not by default I think.
    I had a similar problem with CAF developed webservices. I had to turn on permission checks in my web service and passed the credentials via logon ticket.
    Regards, Bernd

Maybe you are looking for

  • Cannot regain access to external drives.

    The USB external hard drives attached to my Mac Pro, which is running 10.6.8, are not allowing me access, saying I do not have permission. There is a lock on the desktop icon for each of them. I tried changing them in the Get Info box but all permiss

  • Can't create the file 'bled_top-1.png'

    hi, when trying to publish my site to the web, i get this message. any idea what i need to change ? says that disk might be damaged or i might have insufficient access privileges. only thing I can think of is that i had a 3 month free period and the

  • Auto Lockbox Control file directory

    Hello all, I am trying Lockbox in AR. My doubt is where I have to place the Control file and Data file. I have prepared the queries for control file, which format am I need to save. Please guide me how to clear this issue. Thanks and Regards, Muthu

  • How to retain focus in Textfield

    I have one panel which contains three textfiled and one ToolBar. on clicking tool bar button certain dialog get opened. intially foucus remained on first textfield but when i do open the dialog with tool bar button. focus doesn't get return to first

  • Prob with selected data store: OracleConnection.ConnectionString is invalid

    I am trying to do the example in "Using Oracle Providers for ASP.NET" (URL = http://www.oracle.com/technology/obe/11gr2_db_prod/appdev/dotnet/aspprovider/aspprovider_otn.htm) ... I was able to do the prereq ("Building ASP.NET Web Applications with Or