How to get timesheet information in a javascript (Project Server 2013)

Hi all,
In Project Server 2013, I'm trying to customize the Timesheet ribbon. This far, I've been able to add a new button and tie an event to it. All is working well. This is all done using elements.xml and a javascripts.
Now the problem is that I want to get some informations about the timesheet (the Guid for example) and, for now, I've got no success. I know that there is an object called PS.TimeSheet, but when I try to use some PS.TimeSheet's methods I get an error.
Note that i'm in the page http://servername/pwa/timesheet.aspx (there is not Guid in the address) and all the treatments should be done in the javascript (no call to another aspx page)
Thanks !

Finally, I've found the solution.
My goal was to add a button in the timesheet ribbon to launch a special report showing some data about the timesheet. The report has the timesheet Guid as parameter.
To customize the Sharepoint ribbon, you have to do it via an xml file and a javascript (a lot of explanation is available in the internet that explains how to do it). So I had to call a function in the javascript to launch the report (which is a SSRS report).
When you are in a javascript you have access to many global variables. When the timesheet.aspx is displayed, there is a global variable called "timesheetComponent".
Using this variable we can call the method :
timesheetComponent.m_consumedApi.get_Impl()
to get an implementation of the current timesheet. This implementation has an attibute that has a lot of nice stuff about the current user and the current time sheet. This attribute is 
_headerInfo
_headerInfo is a structure that includes tsUid which contains the timesheet Guid I was looking for.
Finally, the function attached to the button goes like this :
function _LaunchReport() {
var tsUId;
var rptPath;
var tsImpl = timesheetComponent.m_consumedApi.get_Impl();
try
if (CONST_REPORT_PATH == null || CONST_REPORT_PATH == "" ) {
alert("Constant CONST_REPORT_PATH is not defined")
else {
tsUId = tsImpl._headerInfo.tsUid;
rptPath = CONST_REPORT_PATH + 'TimesheetDetails&rs:Command=Render&rc:Parameters=false&TimesheetUID=' + tsUId;
window.open(rptPath);
catch (Err) {
alert(Err)
CONST_REPORT_PATH is the path to SSRS defined elsewhere
I hope this will help some other poeple !

Similar Messages

  • How to get list of user connected to project server by day wise

    HI,
    I need to get a report as how many times user  is connected to the project server in a week.
    I have enabled web analytical reports but its showing only how many times a user is connected to site.I need date also
    Project server 2010 version.
    Can any one help me.
    EX:
    Resource name           Date                 Connected (yes/No)
    Vijay  kumar            1-11-2014             yes
    Vijay  kumar            2-11-2014             yes               
    Vijay  kumar            3-11-2014             no
    Vijay  kumar            4-11-2014             yes
    Vijay  kumar            5-11-2014             yes
    Vijay  kumar            6-11-2014              no
    Vijay  kumar            7-11-2014             yes
    Thank You, Kumar KSV

    What Badal Ratra gave you would be the basis for your query to populate your own table...Project Server does not give you a way to do a daily connect report
    One of the ways I would go about doing this would be to run a nightly query to update a table - fill it in with the necessary data and run your report off that newly created table
    High Level Steps:
    (1) Create a table in the Reporting Database call DailyVisits
    (1a) The table would have Name/Date/Connected columns 
    (1b) You wouldn't need a no answer for connected columns since the answer would always be yes, the result set would ONLY have users who connected for each day.  And really you would only need 2 columns since the "connected" column would always
    be Yes...
    (2) Create a query that would query the published database (msp_resources) for the current day and store the result set in the table DailyVisits
    (3) Put this query in a nightly task to append to the DailyVisits table @ 11:55pm (for example)
    (4) Let the query run and you'll have only the users who connected for that day - the DailyVisits table would represent users who visited every day.  
    As long as the query runs nightly you'll have the information you're looking for - the one caveat is that it will only be starting from the day you start running the query.  
    You could also append the older user (last_connect) information from the resources table from other users to populate the dates but that would only represent a single entry/single last connect date.  This "old" information would represent the
    base for the table.
    hth

  • How to consume the Calendar Exception details from Project Server 2013 to an SSRS report using PSI ?

    Hello,
    Can anyone guide me how to access the calendar exception details from Project Server using PSI?
    I need to extract calendar details of enterprise resources , like exception name, exception type, exception start date and exception end date into my SSRS report hosted in SharePoint 2013 and 2010.
    I would be helpful if I can get a sample of this. I have read through many PSI documents in fact still going through ,what  PSI does and doesn't ,  PSI methods etc. from Project Server SDK and MSDN . Moreover, I
    am a beginner in .NET programming. I am confused and have lots of questions in my mind, like which PSI service should be used in my report(is it  just Calendar.svc), can we pull the details as XML type data source my SSRS report ,are
    there any other configuration settings apart from " setting up an event handler by installing an event handler assembly on each Project Server computer in the SharePoint farm, and then configuring the event handler
    for the Project Web App instance by using the Project Server Settings page in the General Application Settings of SharePoint Central Administration" (as per prerequisites for PSI in SDK) , how can I implement authentication settings
    -(when user with proper SharePoint permission
    can accesses the SSRS report  )
    Kindly bear with me if my questions are not appropriate .
    Please do guide me, and .
    Thanks in Advance!!
    Mridhula
    Mridhula.S

    Hi Brendan,
    Project server reporting database doesn't contain the calendar info. The only supported way to use the PSI to read the calendar info from Published database.
    See this
    reply from Amit.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • How to get list of Users[MailBoxes] in Exchange Server 2013 by using EWS Managed API

    Hi all,
    I need list of Users exists in my Exchange server 2013 , i.e Mail Box Users login name.
    I was  created Full Access permissions of all users to Admin user account,  to access each user Mailbox programatically 
    i need the list of Mailboxes in exchange server .
    MailBox  mailbox = new MailBox("user");
    Please share your ideas

    Hi,
    We can run the following command in Exchange Management Shell to get all user mailboxes name and export it to a .csv file:
    Get-Mailbox -ResultSize Unlimited | Select Name,Alias,RecipientTypeDetails | Export-Csv c:\Users.csv
    If you want to retrieve the list of users by using EWS Managed API, I suggest you can ask a question in Exchange Development forum for more suggestion:
    http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/threads
    Regards,
    Winnie Liang
    TechNet Community Support

  • Getting "Unknown Error has Occurred" After Project Server 2013 DB Restore

    Hi All,
    I have restored our content and pwa databases as per Microsoft's guide, one Project Web App works fine and the other has the error "An Unknown Error has Occurred" on the projects view and also when viewing Enterprise Project Types.
    Another thing I have noticed is that only the Sys Admin has access to the project sites even though users have been added as admins etc.
    We are patched to the December 2013 CU / Hotfix and I have also run the provided service scripts by Microsoft to go with the hotfix.
    Any help on this would be greatly appreciated as we are looking to test SP1 and apply to our production environment.
    Thanks in advance...

    PowerShell has a command called. Test-SPContentDB.
    Run the TEST-SPContentDB powershell command on database and see if it provides additional information.
    Cheers
    Michael Wharton, MVP, MBA, PMP, MCT, MCTS, MCSD, MCSE+I, MCDBA
    Website http://www.WhartonComputer.com
    Blog http://MyProjectExpert.com contains my field notes and SQL queries

  • Recall and Delete timesheet in Project Server 2013

    Hi,
    How to recall a timesheet and how to delete the submitted timesheet by the user in Project Server 2013?
    K.Gokulraj

    Also, in case you would like to connect as the user and delete his timesheets, yu can use Manage Delegates.
    Then connect as the user, go to his Manage Timesheets > Recall the Timesheet > Delete the Timesheet.
    Cheers! Happy troubleshooting !!! Dinesh S. Rai - MSFT Enterprise Project Management Please click Mark As Answer; if a post solves your problem or Vote As Helpful if a post has been useful to you. This can be beneficial to other community members reading
    the thread.

  • How to get Saved Selection list in javascript?

    Hello!
    Recently I met a little problem about save selection. I want to get saved selection list so that I can used in javascript. Now I have no ideals. Hope you tell me some useful information about how to get Saved Selection list in javascript!

    Mark is right, it's not possible.
    But do you know you can assign selection to a variable, and get back to it simply like this?
    var sel = app.selection;
    app.selection = null;
    /* your codes here
    app.selection = sel;

  • How to get the value from a JavaScript and send the same to Java file?

    Hi.
    How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
    Thanks and regards,
    Leslie V

    Yes, I am trying with web application.
    In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
    How to send this 'message' with and to the 'request'?
    Thanks for the help :-)
    The actual JS code is:
    function productdeselection()
    var i=0;
    var j=0;
    var deselectedproduct = new Array(5);
    var message = "Are you sure to delete Product ";
    mvi=document.forms[0].MVI;
    mei=document.forms[0].MEI;
    lpi=document.forms[0].LPI;
    if(null != mvi)
    ++i;
    if(null != mei )
    ++i;
    if(null != lpi)
    ++i;
    if(null != mvi && mvi.checked)
    deselectedproduct[++j]="MVI?";
    if(null != mei && mei.checked)
    deselectedproduct[++j]="GAP?";
    if(null != lpi && lpi.checked)
    deselectedproduct[++j]="LPI?";
    if( 0!=j)
    if(i!=j)
    for (x=0; x<deselectedproduct.length; x++)
    if(null != deselectedproduct[x])
    message =message+ "-" +deselectedproduct[x];
    alert(message);
    else
    //alert(" You cannot remove all products!");
    return false;
    return true;
    }

  • I am new to Mac Pro but am purchasing one online.  can anyone tell me how to get the information from my Toshiba onto the Mac.  there are no stores in the state I live in.  Do I need to find a location and will they do a transfer from my I Tunes etc?

    I am new to Mac Pro and am purchasing one online  tonight.  Can anyone tell me how to get my information - Itunes, photos, and videos transferred onto the Mac from my Toshiba.  the state I live in doesn't have an Apple store but I could take it to Minneapolis when I go.  Any ideas where to begin?

    You might profit from a visit to a Minneapolis Apple store. With a brand new Mac, I think they will be most helpful - not just with transferring files, but with other advice as well. And I strongly recommend you invest in a back up drive. The Apple folk can help with that as well.

  • How to get the information of the log related to t.code generated by basis.

    In the log generated by the basis personnel we found the details of user and corresponding t.code used details.  How to get the information reg. which document he went into using this t.code? For example me29 t.code used by 'x' user.  The log is showing time date t.code and user.  By using me29n which document he attended is the requirement. How to get this information. Let me know it pl.
    TS

    Thanks all for the help.
    Here is my solution. A mix from Julian and Thomas.
    In future I will encapsulate the code in a function module.
    DATA: BEGIN OF usr_tabl OCCURS 10.
            INCLUDE STRUCTURE uinfo.
    DATA: END OF usr_tabl.
    DATA: th_opcode(1) TYPE x.
    DATA: LV_TID LIKE  SY-INDEX.
    CONSTANTS: opcode_list LIKE th_opcode VALUE 2.
    CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode_list
      ID 'TAB' FIELD usr_tabl-sys.
    CALL FUNCTION 'TH_USER_INFO'
      EXPORTING
        CLIENT = sy-mandt
        USER   = sy-uname
      IMPORTING
        TID    = LV_TID.
    read table usr_tabl with key tid = lv_tid.
    IF sy-subrc = 0.
      CASE usr_tabl-type.
        WHEN 2.
          write :/ usr_tabl-type, 'SYSTEM'." (system)
        WHEN 4.
          write :/ usr_tabl-type, 'GUI'." (Gui)
        WHEN 32.
          write :/ usr_tabl-type, 'RFC'."(RFC)
        WHEN 202.
          write :/ usr_tabl-type, 'PLUG-IN'." (Plug-in &).
      endcase.
    ENDIF.

  • How to get the selectOneRadio value in javascript

    Hi,
    I want the selectOneRadio value in javascript. Can anyone give us a solution how to get the selectOneRadio value to javascript from jspx page.
    Thanks,
    Eswari

    Hi,
    I assume you are talking about JDeveloper 10.1.3 in where there is no JavaScript API ADF Faces.Here you will have to use document.getElementById() to access the radio button component (which is a list component). You can look at the generated HTML for how the component and its ID look like.
    However, what is the usecase that you cannot handle in native JSF ?
    Frank

  • How I get a Information about how many Scheduling agree

    Dear friend,
       Can any one tell me a process ,How I get a information about how many scheduling agreement or Schedule lines created with in given time.Any standard tcode available  ?
    Regards
    Abrar AHmed

    Dear Abrar
    - To see how many scheduling agreement is created for a given period, use VA05, click on [Further sel criteria] and tick the box against [Sales Document type]  Now input the scheduling agreement type and execute.  You will get list of all scheduling agreements created within the specified period.
    - You can see how many line items are created in a sale order for a given period via VA05.
    thanks
    G. Lakshmipathi

  • How i get some informations about audio file?

    Hi to all,
    i would like to know how i get some informations about audio file, such as its artist, bitrate, file type, duration, ecc...
    Any help me?

    Ok, but which are the docs of audio format?Again, what does that have to do with Java?
    Where i can found these documents?Again, what does that have to do with Java?
    Thank you...For nothing.
    db

  • How to get Listener Information using PL/SQL code

    How to get Listener Information using PL/SQL code

    user2075318 wrote:
    How to get Listener Information using PL/SQL codeThis approach (somewhat of a hack) can be used - but it does not really provide meaningful data at application layer.
    SQL> create or replace function TnsPing( ipAddress varchar2, port number default 1521 ) return varchar2 is
      2          type THexArray is table of varchar2(2);
      3          --// tnsping packet (should be 10g and 11g listener compatible)
      4          TNS_PING_PACKET constant THexArray := new THexArray(
      5                  '00', '57', '00', '00', '01', '00', '00', '00',
      6                  '01', '39', '01', '2C', '00', '00', '08', '00',
      7                  '7F', 'FF', '7F', '08', '00', '00', '01', '00',
      8                  '00', '1D', '00', '3A', '00', '00', '00', '00',
      9                  '00', '00', '00', '00', '00', '00', '00', '00',
    10                  '00', '00', '00', '00', '00', '00', '00', '00',
    11                  '00', '00', '00', '00', '00', '00', '00', '00',
    12                  '00', '00', '28', '43', '4F', '4E', '4E', '45',
    13                  '43', '54', '5F', '44', '41', '54', '41', '3D',
    14                  '28', '43', '4F', '4D', '4D', '41', '4E', '44',
    15                  '3D', '70', '69', '6E', '67', '29', '29'
    16          );
    17 
    18          socket  UTL_TCP.connection;
    19          txBytes number;
    20          rxBytes number;
    21          rawBuf  raw(1024);
    22          resp    varchar2(1024);
    23  begin
    24          socket := UTL_TCP.open_connection(
    25                          remote_host => ipAddress,
    26                          remote_port => port,
    27                          tx_timeout => 10
    28                  );
    29 
    30          --// convert hex array into a raw buffer
    31          for i in 1..TNS_PING_PACKET.Count loop
    32                  rawBuf := rawBuf || HexToRaw( TNS_PING_PACKET(i) );
    33          end loop;
    34 
    35          --// send packet
    36          txBytes := UTL_TCP.write_raw( socket, rawBuf, TNS_PING_PACKET.Count  );
    37 
    38          --// read response
    39          rxBytes := UTL_TCP.read_raw( socket, rawBuf, 1024 );
    40 
    41          UTL_TCP.close_connection( socket );
    42 
    43          --// convert response to varchar2
    44          resp := UTL_RAW.Cast_To_Varchar2( rawBuf );
    45 
    46          --// strip the header from the response and return the text only
    47          return( substr(resp,13) );
    48  end;
    49  /
    Function created.
    SQL>
    SQL> select tnsping( '10.251.93.30' ) as TNSPING from dual;
    TNSPING
    (DESCRIPTION=(TMP=)(VSNNUM=169869568)(ERR=0)(ALIAS=LISTENER))
    SQL> select tnsping( '10.251.95.69' ) as TNSPING from dual;
    TNSPING
    (DESCRIPTION=(TMP=)(VSNNUM=0)(ERR=0)(ALIAS=LISTENER))
    SQL>

  • How to get this information for Conky

    Hi people,
    My question is how to get this information for show in Conky:
    - KDE version.
    - Last sync (pacman -Sy) and Last update (pacman -Su)
    For the first point could be use a script that execute $ kdesu --version and get information from there.
    I have no idea how get information from pacman (may be logs?).
    Any ideas?
    Thank you.

    I have had tremendous success with LUA in Conky on Arch. And all you need to to is put the text HI after the "TEXT" line. ^^;
    Examples of my LUA usage:
    http://fc02.deviantart.net/fs71/i/2010/ … usLink.png
    http://kittykatt.silverirc.com/screens/conky-HUD.png
    EDIT:  Also, I've had success with getting the KDE version by doing the following...
    kwin --version | awk '/^Qt/ {data="Qt v" $2};/^KDE/ {data=$2 " (" data ")"};END{print data}'
    This is the method I'm currently using in screenFetch. Tested it a couple of times myself, but besides that, I'm not sure if it will work or not.
    Last edited by kittykatt (2010-04-22 17:52:25)

Maybe you are looking for

  • When on the internet, how can I zoom out with out cuting off part of games and stuff?

    When I go to Mozilla Firefox, I can't see everything on the screen because it is zoomed in to much. When I go to view and zoom out, it zooms out but when I go to armorgames, part of the games I play are cut off so I can't see everything on the game.

  • Error in result query

    Hi all, I have a problem with total row for one key figure in the query Example:     customer QTY OGNEW OGOLD %OG      1000        300      50          10        4      2000        500      70          20        2,5 tot                800     120    

  • I am logged in to my Acrobat account but I can't see my files?

    I have Acrobat on my iPad which is connected to my Acrobat account. I use it to read my ebooks just fine. But when I installed Acrobat on my Android phone and logged in, I can't see the files that I have on my iPad? Is this a bug or is there somethin

  • Back ground job problem for CJI3

    Hi Iam converting the standard CJI3   TCODE   into zcji3 when I execute manually iam getting all the data. but I schedule(in the background job)   that program i am not getting  all the fields data .what could be the problem this is immd please repso

  • Oracle DataGuard - Standy Redo log on physical Standby db

    Hello Guys, A quick question on my 10.2.0.2 db with Windows 2003 x64 OSs. I have 2 machines - One for primary & the other for physical standby I have successfully setup DG with Real Time Apply and also tested switchover & failover scenarios and they