Add JavaScript file to ALL existing Task List pages and to newly created list pages

We have several OOTB task lists that are in use on several subsites.  We want to add JavaScript to the NewForm.aspx and EditForm.aspx for these task lists. These lists have not been customized, they are based on the standard Task Content Type.
Since there are several lists already created and in use, it would be far too much work to manually add a Content Editor web part to each page.
We put the JavaScript file in the top-level site style library.
Is there a way to programmatically attach a script reference to each existing page in all the subsites AND have the script reference placed on any NEW list pages created from the OOTB Task content type? Or, add a CEWP to all existing list pages using a feature?
I could not find any examples of this.

Hi,
A solution would be like this: Add your script into a Content Editor Web Part in a page, then add this Content Editor Web Part into the NewForm page of these Task lists using
SharePoint Object Model.
More information:
Use
SPList.Forms property to retrieve the URLs of the specific form of these Task lists:
http://sharepointcore.blogspot.com/2011/08/sharepoint-listitem-new-edit-and.html
With
SPLimitedWebPartManager object, we can retrieve the web parts of a page, choose one and add into another
page:
SPLimitedWebPartManager.WebParts
property
SPLimitedWebPartManager.AddWebPart
Another two links about this for your reference:
http://www.stefangordon.com/add-web-part-to-page-programmatically/
http://sharepoint.stackexchange.com/questions/9442/how-to-programmatically-add-a-webpart-to-a-page
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

Similar Messages

  • How to add a file to an existing package programmatically in Acrobat 8?

    Hello
    Is it possible to add a file to an existing package programmatically in Acrobat 8? (embed a pdf file in a pdf package programmatically); If so, how should I do it?
    Thanks in advance,

    Finally, I found out how to add a file to an existing package programmatically by using JavaScript (function: app.execMenuItem("AddFileAttachment")). Thanks for your help Ironsenth. However, I need to specify the file to attach programmatically and I can't figure out how to do it.
    Could you let me know where I can find this information (what document to read)? Is there any parameters for the 'AddFileAttachment' method?
    Thanks in advance,

  • HOW DO I ADD A FIELD TO "ALL" EXISTING RECORDS IN ADD BOOK

    Just trying to find an easy way to add a field to all my records...a text field....
    Any thoughts or input would be appreciated.
    THKS
    C.R.

    Hi P,
    Assuming that this, being asked in the AppleWorks community, is a question regarding an AppleWorks database document, the answer is, "Quite easily."
    Open the file, go Layout > Layout and choose the layout on which you wish the field to be placed.*
    Go Layout > Define fields (or press shift-command-D to get to the same place)
    Type the name of the new field into the Field Name box.
    Choose the type of field (Text) from the pop-up menu to the right of the box.
    Click Create.
    The new field will be added to the Field list in the dialogue.
    Repeat for each new field you want to add. When finished, click Done.
    The new field(s) will be added to all existing records, and will be placed on the active layout. You can add it/them to other layouts using Layout > Insert fields.
    Regards,
    Barry

  • How to add custom link or button to task details page to open a different t

    Dear All
    In HumanTasks Workflow, On task details page, I want to add a custom link or button. Clicking on this link or button, should load a different task details page.
    The exact business usecase is like this:
    1. We have some human tasks with very detailed payload like about 100 attributes. When the task is submitted for Approval, we send notification emails. These emails shows the Task Details with all these 100 attributes along with standard Approve, Reject buttons etc. NOW in addition to this, we want to add extra custom button/link like Custom View. When we click on this buton or link, it should replace the task details page with the Custom task details page contents. The reason is most of the managers/approvers access their emails on smart phones like iphones. So in these phones, seeing full task details (100 attributes) is very tedious. So we want to provide a simplified view of same task with very minimum attributes like about 10 with Approve, Reject buttons. Now this compact view details will have a button called Detailed View on click on which it loads details page.
    So we want to have 2 pages for a task:
    taskDetails1.jspx -> Has all 100 attributes with a custom button/link called "Compact View". Click on Compact View switch to below page.
    taskCompact1.jspx -> Has only 10 attributes with a custom button/link called "Detailed View". Click on Detailed View switch to above page.
    1. I tried implementing this using the VacationRequest sample where the payload is like creator, startdate, enddate, reason. I already have taskDetails1.jspx page, which shows this information in the email body.
    2. I want to add another button to taskDetails1.jspx so that when I click on it, I want to load a different page like taskCompact.jspx which has only say creator, reason.
    I already added a link and gave the url with parameters like taskId, taskContext etc which I got from bindings, but nothing is displayed when I click on custom button. The taskId, context values are comming correctly in the url.
    So bottom line, what is the URL that I can provide in the task details page, to load a different task details page contents. I want to pass other taskdetails jsp details.
    Please let me know, if there is any other approach to implement this usecase.
    Thanks in advance
    Ravi Jegga

    Hi,
       I am not sure if you can add your own custom buttons to the application tool bar because your table control is in a sub screen area in a standard screen so the menu area would be controlled by the standard screen and not the subscreen , but along side the table control you can give buttons for scrolling and handle the same in the subscreen if you check the FM EXIT_SAPLMEREQ_002 it has a variable IM_UCOMM which would have the ucomm set in the subscreen so here you can handle your user command to scroll on the table control.
    Regards,
    Himanshu

  • Mail (again!) .. how do I clean all existing settings of Mail and start again?

    I have (Yosemite) Mail linking into BT.  I have a problem that occurred with Mavericks and continues with Yosemite Mail. Mail works fine for a month or two then goes wrong... almost a pattern!  Usually I put it right by deleting the account and set it up again and it works for a while.  I am so frustrated because I do not understand the intricacies of software and programming.  Now it is refusing to send emails in both my and my wife's account.  iCloud works (after I deleted and set it up again).  But I need our BT separate accounts.  Is there a way of deleting all the old bits and pieces of files that might be 'remembering' bad settings and starting again? Is there a fix?  I am alarmed by the smart-alec comments of people with 'level 5/whatever' who say there is no issue.  There damned well is!

    There are a plethora of problems noted here with BT's email service, but similar could be said for various others.
    You could delete the ~/Library/Mail folder along with the containers and preferences.
    Note that deleting the Mail folder will delete all of your email stored on the Mac.
    Inside the Mail/V2 folder are folders for each account. You could start with deleting those and the Containers, Prefs.
    Containers: ~/Library/Containers/com.apple.mail
    Preferences: ~/Library/Preferences/com.apple.mail.plist
    However, if it works for a period of time, then stops working, it isn't dredging up an old setting from somewhere. The settings are what they are at the time; no history.
    What can possibly happen, and does seem to happen with Mail periodically, is that the Keychain stores multiple passwords for the accounts.
    Open Keychain Access, select login keychain, and then search for your email accounts. Delete any entries you have for the accounts.
    Then, open Mail and enter the correct passwords for the accounts. That will ensure there is only one password being attempted.

  • Files in all programs slow to open and save with Snow Leopard

    Installed Snow Leopard, now all files in all programs super slow to open and save - Photoshop, Illustrator, Quark -- all now at least 4-5X slower to open files and save -- here's what I've tried so far:
    repaired permissions
    emptied font cache - restarted up in safe mode
    re installed Snow Leopard
    renamed old preferences and restarted to create new prefs
    I'm hating Snow Leopard -- eeesh -- this is no upgrade, just a big waste of time and money, any ideas?

    See:
    Mac Maintenance Quick Assist,
    Mac OS X speed FAQ,
    Speeding up Macs,
    Macintosh OS X Routine Maintenance
    Essential Mac Maintenance: Get set up,
    Essential Mac Maintenance: Rev up your routines,
    Maintaining OS X, and
    Myths of required versus not required maintenance for Mac OS X for information.

  • Tdms-files: Is it possible to prevent LabVIEW and DIAdem from creating .tdms_index files?

    Hello,
    is it possible to prevent LabVIEW and DIAdem from creating .tdms_index files when opening/creating/editing a .tdms file?
    I think I have no benefit from the .tdms_index files because our applications create a lot of little .tdms-files (repeat measurements). With the additional .tdms_index files we have unnecessary memory consumption and it takes longer for Windows to open the containing folder. Also it´s confusing when searching for a certain file.
    Best Regards
    Daniel
    Solved!
    Go to Solution.

    Hi Baui,
    I'm afraid there's a direct way to disable creating .tdms_index file now from LabVIEW and DIAdem. You can use TDMS Advacend API in LabVIEW, which doesn't create any index file, or you can just make some simple programming and delete the .tdms_index file after closing the TDMS file. 
    This is a request for a long time, we'll consider to add this feature for TDMS in future releases.
    Yongqing Ye
    NI R&D

  • How do I add an airport extreme to existing time capsule network and be able to use the router ethernet ports?

    Good day everyone.  I recently upgraded my airport extreme network by replacing the base station with a time capsule router.  Since I now have an "extra" airport extreme router, I've set it up on the other side of the house to both extend the wireless range as well as use it's LAN ports for a home theater system in that location.  Connecting the two routers was done via ethernet.  It now appears that I need to do something "else" as the LAN ports on the now relocated airport extreme are nonfunctional.  All devices are operating well for wireless and as a review, the modem is connected to the time capsule WAN which is connected to the airport extreme via ethernet cable via LAN to it's WAN port.  What do I need to change on configurations to get the LAN ports functioning on the airport extreme?  Thank you for any help.

    Connecting the two routers was done via ethernet.  It now appears that I need to do something "else" as the LAN ports on the now relocated airport extreme are nonfunctional.
    With both base stations interconnected by Ethernet you have the basis for a "roaming" type network. If properly configured, both base stations' Ethernet ports would be enabled for wired clients.
    The key configuration items for a roaming network are as follows:
    All base stations used must be interconnected by Ethernet.
    The "main" base station; the one connected to the Internet modem, must be configured to provide both NAT & DHCP services; all other base stations used must be configured as bridges (NAT & DHCP disabled.)
    Each base station must have a unique base station name.
    Each base station must use the same wireless security type and password.

  • I upgraded from v2 and now newly created folders are not in recent list

    I used to be able to create a new folder in v2 and see it immediately in the 'recent' list, but now it does not do that in the latest and greatest version. This is something I use all the time for filing new clients.
    Thanks, Adrian

    Hi Actually I never have needed support, it works perfectly for me. It's always a shame when an upgrade removes a feature you use all the time; I was genuinely surprised by that.
    Anyway, I turned off my upgrade flag so I won't bother you again.
    Thanks, Adrian

  • SCCM 2007 R3 New DP , how to add to all existing packages

    Hi
    Is there a script which allows an SCCM 2007 R3 DP to be automatically added as a DP for all existing packages? I know this is easily done in 2012 with Powershell support or DP Groups, but was wondering how to automatically add a DP to all existing packages
    in SCCM 2007 R3
    Any help greatly appreciated!
    Thanks
    Max

    This is easily done in 2007 also without any scripting by using the Copy Packages Wizard: http://technet.microsoft.com/en-us/library/bb693746.aspx
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • Tasks re-sorting in the MPP file when synching with SharePoint task list

    When synchronizing the MPP file with the ShPt task list, we have seen tasks re-sorting in the MPP file.  Very annoying, especially with schedules with a large number of tasks.  Just wondering if anyone has experienced this issue, and if you
    could point me in the right direction for solving it.  FYI, listing below my signature the columns we are synchronizing (in case you know of an issue with one or more of these).
    FYI, we are using MS Project 2013 Pro and SharePoint 2010.  We tried using the synch feature with MSP 2010 and it did not seem to be available.
    Greatly appreciate your help on this topic.  Sincerely,
    Michael.
    Columns to map:
    Text30
    Text15
    Baseline Start
    Baseline Finish
    Duration
    Baseline Duration
    Baseline Work
    % Work Complete
    Flag8
    Critical
    Number5
    Text19
    Work
    Actual Start
    Actual Finish
    Columns to uncheck:
    Priority
    Task Status

    Hi,
    The resource is created as a new resource with no security group and no loggin account, meaning it is strictly a resource and not a user. So this resource can be assigned on others projects but cannot connect to PS in any way (thus does not consume a CAL)
    unless you convert it into a user by adding a valid account and a security group.
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • Print Individual task Lists from Project 2010

    Hi
    I have a routine which prints individual task lists from a Project Plan using VBA.  This routine is currently being piloted and they have advised that not all resources have a task list produced.  when I step through the code the Resource numbers
    appears in this order:
    1,3,18,7,8,9,11,12,13,14,18,19,20,21,22,23,24,25
    Task lists are produced for each of the above resources.  However this misses resource numbers 2,4,5,6,10,15,16,17 and I have no idea why.  I have supplied my code below.  Any advice/guidance appreciated.  You will note that the task
    lists are exported to a pre-defined spreadsheet template.
    Sub PrintResourceCharts()
    Dim xlApp As Excel.Application
    Dim xlRange As Excel.Range
    Dim rName As String
    Dim Tsk As Task
    Dim Res As Resource
    Dim Ass As Assignment
    Dim s As Worksheet
    Dim BookNam As String
    Dim Row As Integer
    Dim fName As String
    'Call SetSummaryTask - DB: commented out - run summaryname manually as required.
    Call Task_CF_To_Assignment_CF
    'Remove Existing Task List files from directory before creating new ones
    On Error GoTo Finish
    Kill "D:\Task List Templates\Task Lists\*.*"
    Finish:
    'Save File Location
    fName = "D:\Task List Templates\Task Lists\"
    'Start Excel and Create a new Workbook
    Set xlApp = CreateObject("Excel.Application")
    xlApp.Visible = True
    'Export Resource and Task details
    For Each Res In ActiveProject.Resources
    If Res.Assignments.Count > 0 Then
    Row = 5
    xlApp.Workbooks.Open ("D:\Task List Templates\Task List Template.xlsm")
    BookNam = xlApp.ActiveWorkbook.Name
    Set s = xlApp.Workbooks(BookNam).Worksheets(1)
    For Each Ass In Res.Assignments
    Set xlRange = s.Range("A5")
    If Ass.PercentWorkComplete < 100 Then
    With xlRange
    rName = Ass.ResourceName
    s.Range("A" & Row).Value = Ass.ResourceName
    s.Range("B" & Row).Value = Ass.TaskUniqueID
    s.Range("D" & Row).Value = Ass.Text1
    s.Range("E" & Row).Value = Ass.Start
    s.Range("G" & Row).Value = Ass.Finish
    End With
    End If
    Row = Row + 1
    Set xlRange = xlRange.Offset(Row, 0) 'Point to next row
    Next
    xlApp.Visible = True
    Application.DisplayAlerts = False
    If rName = "" Then
    GoTo Finished
    End If
    xlApp.ActiveWorkbook.SaveAs FileName:= _
    "D:\Task List Templates\Task Lists\" & rName & ".xlsm", FileFormat:= _
    xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
    rName = ""
    xlApp.ActiveWorkbook.Close savechanges:=False
    Application.DisplayAlerts = True
    End If
    Next
    Finished:
    xlApp.Application.Quit
    Set xlApp = Nothing
    MsgBox ("Individual Task Lists have now been produced....")
    End Sub

    Tony,
    You said you step through the code and it picks up resource 1. What happens when the loop gets to resource 2? Note: since resource 1 may have several assignments and stepping through them all could take some time, I sometimes use a stop statement in the
    outer loop to make it a little easier to "catch" what I'm looking for. For example, you could put this right after the For Each Res...
    If Res.ID = 2 then stop
    Then step through and see what happens.
    John

  • Cant add music files to iTunes

    Hi there. I have iTunes version 9.0.2.25 and unable to add music files to the existing list. I recently formatted my computer for a fresh start (which I have done previously with no iTunes issue), re-added the folder I have all my music in for iTunes but the new files won't add. It adds the 443 music files that I had on iTunes prior to formatting my computer but won't add any new single files when I use File -> Add file etc. as I did originally before the format.
    I have googled the issue and there are a lot of people with the same problem but the forums have no answers.
    Could somebody please help me with this problem as it is on my iPhone 3G which is an integral part of my work and public time.
    Regards
    Ross

    I'm having the problem of not being able to add any of my files/folders. And **** will freeze over before i do CDs again. Everytime I upgrade iTunes I have this problem. And I only upgrade when I get a new computer. I can import a CD, but I can't import files or folders from my hard drive.

  • Second Dev. Client not appearing in Project Task List

    Hi,
    While defining the CHARM Maintenance Project  in systems tab is it necessary to add all the logical components ( I have 2 development clients 130 as workbench & 100 as customizing so i need to add two logical components) before clicking 'Create Task List' button.
    I created the task for one logical component 130->330->720 first time & project defined successfully with consistency check.
    Now when I am adding 2nd logical component 100->330->730 & created IMG Project. But If I go to 'Show Task List' I am not able to find 100 client under source system development. Means 100 client is not in the Task List of Project.
    Is there any way to add the Dev Client 100 in Task List of the Project under Source Systems->Development System
    Regards
    PK

    Hi,
    While defining the CHARM Maintenance Project  in systems tab is it necessary to add all the logical components ( I have 2 development clients 130 as workbench & 100 as customizing so i need to add two logical components) before clicking 'Create Task List' button.
    I created the task for one logical component 130->330->720 first time & project defined successfully with consistency check.
    Now when I am adding 2nd logical component 100->330->730 & created IMG Project. But If I go to 'Show Task List' I am not able to find 100 client under source system development. Means 100 client is not in the Task List of Project.
    Is there any way to add the Dev Client 100 in Task List of the Project under Source Systems->Development System
    Regards
    PK

  • Loading Issue on Task list

    Hello Guys,
    I am using LSMW for loading funtional locational task list. Since I have only one operation, I prefer LSMW and also maintain the seprate file for loading the frequencies for maintenance plan as well. I have a situtation as,
    Floc A   - 1M   -   Strategy A
    Floc A   - 1W  - Strategy B
    Floc A   - 1M  - Strategy A
    Now, my plan is to load the task list first and once I get the task list group number, I will load the frequency on it. Since it has the same repetitive floc , I should have 3 different rows in my task list load file as I wanted to have three different task list numbers since I got different frequencies. But if I start loading in system, it throws the error message as soon as the first task list has been loaded. I understand this is correct because I already created the task list once in the system.
    So how do I acheieve the other two lines in the system ? I really dont want to go with increasing counters as it will have the same group number with different frequencies.
    Pls help
    Mahee

    Hello,
    I think you can not go ahead with having same Counter Number for One Group.If you are creating the FL task list it will create the Unique Group Number.after theat If you try to create the FL task List for Same FL it will suggest you the New Counter Number with Same Group Number its standard.So I think so You can create the FL task list with one Group Number and Only one counter number once that FL already have Task list booked under that number.Also process point of view it is confusing having single FL task List with same identical data with more that one in quantity so how you and system identyfies the which of the FL task list is used if all FL task List having same Identification.Thats why counter is necessary.
    Regards,
    Rakesh

Maybe you are looking for