Sharepoint list and custom add attachment form

Hello.
Is it some how possible to dynamically create a custom form, in an iFrame, with the action as "/_layouts/attachFile.aspx?ListId={12345678-1234-1234-1234-123456789012}&;ItemId=2" to add an attachment to a list item?
I tried different things but nothing seems to actually attach the file.
Or, can I override UploadAttachment() so when the user clicks a button it shows the file selector dialog directly and after they are done I get notified so I can do something?
Any ideas?
Use Case:
I have a list. The list has a title, description (memo), an image path, and a "read more" path. The image and "read more" path are single line of texts. The user would do one of two things: provide the URL to a file that is already online,
or click "browse" to select a file to be attached to the item.
It is that last part I need help with. I can edit the NewForm.aspx to add a "<input type='file'..." but I can't figure out what I need to do then.
I can't use the default attach item because I need to know what file is for what, image or "read more". Which is why I want a button for "image" and "read more" so that after the user selects a file I can store some details that
will later let me identify what file is what.
My plan was to override the "save" button so that my code runs instead of the default.
Then I would use SPServices to create the item.
Then:
 - I can't use FileReader so I cannot use the AddAttachment web service
 - I can't use the existing "/_layouts/attachFile.aspx" because it won't let me dynamically set the file path
 - I can't seem to create my own form dynamically that would attach the file
 - I can call "UploadAttachment()" but that changes screens after the user clicks "OK" I won't know so I can't save the details I need

Hi,
According to your description, you might want to add a button “browse” in the NewForm/EditForm, when clicking it, users will be able to select a file to be attached
the current item.
If this is the case, you can add the script below with the <a> tag into the NewForm/EditForm, then when user clicks the <a> tag, the OOTB file browse dialog
will show up:
<script type="text/javascript">
function AttachFile()
SP.Ribbon.PageManager.get_instance().executeRootCommand("Ribbon.ListForm.Edit.Actions.AttachFile", null, null, null);
</script>
<a onclick='javascript:AttachFile();'>browse</a>
Best regards,
Patrick
Patrick Liang
TechNet Community Support

Similar Messages

  • I have custom sharepoint list and i have displayed this list on sharepoint webpage as a webpart.

    Hi,
    i have custom sharepoint list and i have displayed this list on sharepoint webpage as a webpart.
    now, i want to display limited sharepoint list items in that webpart and remainig items i want to show in read more link in right bottom of the webpart.
    Any one help me how to do this

    Hello,
    As i understand you want to add read more link for rest of items in listview webpart. You can create new view and set item limit in that view then add that list as webpart on webpart-->edit your webpart-->select view from view selection dropdpwn-->
    save it
    Later add one CEWP and use html <a> tag to redirect to your main list when clicks on it. Here is the steps to do this:
    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/a9d036ff-04a8-4235-84a5-c90164ff5294/read-more-for-sharepoint-list
    You can also use Jquery/Javascript/ECMA script but above one is OOTB and easy solution
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • I have date type list field in sharepoint list and i have created one form in sharepoint webpage.

    Hi All,
    i have date type list field in sharepoint list and i have created one form in sharepoint webpage.
    Now i want to save that field from shareepoint webpage, its declared "t1.text" but its showing error.
    How can i save this field?

    Hi AnilKarthink, 
    I wrote a Technet Wiki article on saving data to the various SharePoint fields. You can view it here: http://social.technet.microsoft.com/wiki/contents/articles/21801.sharepoint-a-complete-guide-to-getting-and-setting-fields-using-c.aspx
    Regards, Matthew
    MCPD | MCITP
    My Blog
    View
    Matthew Yarlett's profile
    See my webpart on the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here:
    Upload and Crop User Profile Photos

  • What is difference between SharePoint List and Libraries

    What is difference between SharePoint List and Libraries

    Hello,
    You also might want to loot at here:
    http://veroniquepalmer.com/2013/02/24/the-difference-between-sharepoint-2010-lists-libraries-and-pages/
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/1d4152cd-92a6-4eed-9a52-a519ec71c674/what-is-the-difference-between-document-library-and-list-in-sharepoint
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Listing and customer orders

    Hi everyone.
    Has anybody experience with listing and customer orders in IS-Retail?
    SAP Help says:
    "Using assortments, you have...
    - the ability to associate customers with assortments when creating customer orders or deliveries by having the system check the article listings. You can have the system control whether the customers can receive only those articles in their assigned assortments, or any articles in the entire assortment, or have the checking take place through a user exit."
    I have created an assortment and have assigned a customer. As "basic listing rule", I have assigned "1 - Can only order the assortment assigned". After that, I have listed an articel into that assortment.
    But if I create a customer order via transaction VA01 for this customer, nothing happens. I can still put every article in the customer order and there is no check of the article listings.
    Does anybody have an idea, which setting(s) I am missing?

    >
    Tobias K. wrote:
    > Hi Joe,
    >
    > basically, you can use the standard SD Listing check.
    > The difference in IS-R is that it checks against Retail Listing conditions (entries in table WLK1).
    > So, you have to do the following steps:
    >
    > - create assortments and list the articles according to your requirements
    > - customize the SD Listing check (define a listing type and assign it to your sales document type)
    > - assign the customers to the assortments (transaction WSOA2, tab assortment user)
    > - the basic rule listing in the assignment has to be 1 ("can only order the assortment assigned")
    >
    > Now, in the customer order (sales document type as customized) the system should check against WLK1 if the customer is allowed to purchase this article.
    >
    > Regards
    > Tobias
    Hi,
    How did you customized customer order should check against WLK1.
    Thanks in advance
    regards
    Vijai Jain

  • Creating a custom Add Item form to a list

    I am trying to create a custom New Item form to a list in SharePoint 2013.
    I have read a few tutorials and all of them seem to have the same problem.
    I can create an application page for my custom New Item form without an issue. However SharePoint always adds in the Add Item table on render to the div id="main''. Therefore the only way I can think to really edit this is via JavaScript.
    Is there a better way? Can I manually add the textbox's and associate them with a field-  and disable SharePoitn from rendering this for me?

    Hi,
    According to your description, you might create a custom NewForm page for an existing list.
    Using JavaScript to customize the OOTB NewForm.aspx page would be an option, if you want to create a totally new one, Brij's suggestion would be helpful.
    To specify your custom form as the NewForm page of that list, we can achieve it programmatically using SharePoint Object Model.
    The link below with code demo about
    How To Change the Default EditForm, NewForm and DispForm would
    provide more information:
    http://blog.qumsieh.ca/2009/05/15/how-to-change-the-default-editform-newform-and-dispform/
    A thread with similar need for your reference:
    https://social.technet.microsoft.com/Forums/en-US/fb18812f-a543-4139-bd0a-331e69e0033d/customizing-new-item-form-for-lists?forum=sharepointdevelopmentlegacy
    Thanks 
    Patrick Liang
    TechNet Community Support

  • HTML + JQuery (CSOM) to add multiple item to a Sharepoint list and get their IDs

    Hi everyone.
    I try to use HTML + JQuery in CEWP to build some sort of analog of InfoPath's repeating table in order to be able to insert multiple items in a Sharepoint list using CSOM.
    The current task is to get the IDs of inserted items (in order to use those IDs later to add attachments to the list items) as soon as they are added to the list. I've tried several ways but couldn't get the IDs of all inserted items. Usually
    I get "-1" as an ID for every item except the last one, which returns me the correct ID. 
    Bellow is the code.
    <script src="/testsite1/SiteAssets/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="/testsite1/SiteAssets/jquery.SPServices.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    var click = 1;
    $("#btn_id_1").click(function() {
    click ++;
    $("#tr_id_1").clone().appendTo("#tbl_id_1").attr("id", "tr_id_" + click.toString()).find("input").val("");
    $("#btn_id_2").click(function() {
    Save();
    function Save() {
    var ctx = new SP.ClientContext.get_current();
    var taskList = ctx.get_web().get_lists().getByTitle('Tasks');
    var taskItemInfo = new SP.ListItemCreationInformation();
    var vendor;
    var certname;
    var certid;
    $("#tbl_id_1 tr").each(function() {
    vendor = ($(this).find(".vendor")).val();
    certname = ($(this).find(".certname")).val();
    certid = ($(this).find(".certid")).val();
    newTask = taskList.addItem(taskItemInfo);
    newTask.set_item('Title', vendor);
    newTask.set_item('Request_', certname);
    newTask.set_item('h', certid);
    newTask.update();
    ctx.load(newTask);
    ctx.executeQueryAsync(addTaskSuccess, addTaskFailure);
    //timeout();
    function timeout() {
    alert ("!!!");
    function addTaskSuccess(sender, args) {
    alert(newTask.get_id());
    //AddAttachment(newTask.get_id())
    function addTaskFailure(sender, args) {
    //alert(newTask.get_id());
    alert("no");
    window.location = window.location.pathname;
    </script>
    <div id="div_id_1" class="div_class_1">
    <table id="tbl_id_1">
    <tbody>
    <tr id="tr_id_1">
    <td>Vendor:<br><input type="text" class="vendor" /></td>
    <td>Cert. Name:<br><input type="text" class="certname" /></td>
    <td>Cert. ID:<br><input type="text" class="certid" /></td>
    <td>Attachment:<br><input type="file" class="attachment" /></td>
    </tr>
    </tbody>
    </table>
    <div><button id="btn_id_1" type="button" width="10" height="10">+</button></div>
    <div><button id="btn_id_2" type="button">Save</button></div>
    </div>

    Here's a working solution (thanks to
    this guy)
    <script src="/testsite1/SiteAssets/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="/testsite1/SiteAssets/jquery.SPServices.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    var array = [];
    $(document).ready(function() {
    var click = 1;
    $("#btn_id_1").click(function() {
    click ++;
    $("#tr_id_1").clone().appendTo("#tbl_id_1").attr("id", "tr_id_" + click.toString()).find("input").val("");
    $("#btn_id_2").click(function() {
    //Save();
    //Call();
    var asyncPromises = Save();
    asyncPromises.done(function(result) {
    //alert(array.length);
    console.log(array.length);
    for (var i=0; i<array.length; i++) {
    //alert(array[i].get_id());
    console.log(array[i].get_id());
    asyncPromises.fail(function(result) {
    function Save() {
    var buildDeferredSaves = $.Deferred(function() {
    //var array = [];
    var ctx = new SP.ClientContext.get_current();
    var taskList = ctx.get_web().get_lists().getByTitle('Tasks');
    var taskItemInfo;
    var vendor;
    var certname;
    var certid;
    $("#tbl_id_1 tr").each(function() {
    vendor = ($(this).find(".vendor")).val();
    certname = ($(this).find(".certname")).val();
    certid = ($(this).find(".certid")).val();
    taskItemInfo = new SP.ListItemCreationInformation();
    newTask = taskList.addItem(taskItemInfo);
    newTask.set_item('Title', vendor);
    newTask.set_item('Request_', certname);
    newTask.set_item('h', certid);
    newTask.update();
    ctx.load(newTask);
    array.push(newTask);
    ctx.executeQueryAsync(
    function() {
    // Successful
    buildDeferredSaves.resolve();
    function(sender, args) {
    // Failure
    buildDeferredSaves.reject(args.get_message());
    return buildDeferredSaves.promise();
    </script>
    <div id="div_id_1" class="div_class_1">
    <table id="tbl_id_1">
    <tbody>
    <tr id="tr_id_1">
    <td>Vendor:<br><input type="text" class="vendor" /></td>
    <td>Cert. Name:<br><input type="text" class="certname" /></td>
    <td>Cert. ID:<br><input type="text" class="certid" /></td>
    <td>Attachment:<br><input type="file" class="attachment" /></td>
    </tr>
    </tbody>
    </table>
    <div><button id="btn_id_1" type="button" width="10" height="10">+</button></div>
    <div><button id="btn_id_2" type="button">Save</button></div>
    </div>

  • How to autogenrate multiple items report of the SharePoint list and sent to the client id on daily basis

    Dear Support,
    As per customer requirement he want to send SharePoint list multiple items reports on daily basis by email autognrated workflow in SharePoint.
    I tried for that and created workflow for SharePoint list  on new item creation using SharePoint designer 2013 it’s working fine. But I am unable to send list multiple items report by work flow.
    Please let me know the process for SharePoint list multiple items report generation and how to sent mail to the client id on daily basis.
    Would request your support.

    Hi
    another approach
    use a powershell scheduled script which will get needed lists items, adn will sned the infos by email
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • See Also in SharePoint lists and libraries

    Kindly please help on how to disable the "See Also" inside lists and libraries
    Also, where is this getting files from ? Inside the list and libraries ??
    Thanks in advance!
    AJ MCTS: SP 2010 Configuration MCSA: Windows 7 If you find this post useful kindly please mark it as an answer :) TY

    If editing the masterpage isn't an option, active publishing features (if not a publishing template) and add that script to the Styles gallery with the !important parameter added on the end. It'll be applied locally to the whole site.
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • How to read data from SharePoint list and append to html table?

    Hi All,
    I would like to create custom view of SharePoint list, so want to append those sharepoint list  items in a custom html table design using content editor webpart.
    How to achieve this? thanks in advance!

    Content edit web part is not the right control. You can either Content Query Web Part
    or Data view web part, where you need to modify xslt template using
    SharePoint Designer and can render list data as per choice.
    For Content Query Web Part:
    Using the Content Query Web Part
    Customizing the Content Query Web Part and Item Style
    How to Customize SharePoint List Content Display using Content Query Web Part
    For Data View Web Parts
    Working with Data view Web Parts
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

  • Link Chart between New Listing and Custom OrgChart

    Hello,
    I created a new Listing and a Custom Org Chart. They're works fine.
    When I'm editing my Listing in General Settings -> Link Configuration, I marked View In OrgChart and selected my custom orgchart.
    So, when i login as user in OrgCHart, in My new Listing, I search for a Object and in Actions section I can see only Profile Option.
    I can't See View In OrgChart.
    What i forgot to do?
    Thanks Again.

    Hi João,
    Sometimes this doesn't work - you need  to edit the linkconfiguration that is named after your custom orgchart/search details panel(s). Without seeing the file I wouldn't know what to change, so if  you can paste it here that will be helpful.
    Best regards,
    Luke

  • Users in a SharePoint list and Library using powershell

    Hi,
      How to get the number of users in a list or library of a site using powershell

    Hi spadminspadmin,
    You may try following script.
    Add-PSSnapin Microsoft.SharePoint.PowerShell
    $WebUrl = Read-Host 'Please input URL address of target web'
    $Web = Get-SPWeb $WebUrl
    $ListName = Read-Host 'Please input list name'
    $List = $web.Lists[$ListName]
    $Unique = $List.hasuniqueroleassignments
    if (($List.permissions -ne $null) -and ($Unique -eq "True"))
    Write-Output "---------------------"
    Write-Output "List permission is: "
    $List.permissions | fl member, basepermissions
    elseif ($Unique -ne "True") {
    Write-Output "Inherits permissions from $Web"
    Write-Host "----------------------"
    $web.dispose()
    Thanks & Regards,
    Emir
    Emir Liu
    TechNet Community Support

  • SharePoint Apps and custom web services as remote services

    Hello,
    After reading documentation about Apps for SharePoint compared with SharePoint solutions I did not find any information about "You
    can develop your custom web services as remote services.".
    Could you please give me links or advise, where I can get information - "How to develop custom web services as remote services" using SharePoint 2013 Apps?

    Hi,
    I would suggest you to use WCF service instead of Web Service,
    also, SharePoint 2013 introduces a Representational State Transfer (REST) service that is comparable to the existing SharePoint client object models.
    Get started with the SharePoint 2013 REST service
    About develop custom web services as remote services,see Demo here:
    SharePoint 2013: Custom REST service provides data to an app for SharePoint
    Best Regards
    Guangchao chen
    TechNet Community Support

  • ALV oops - Prioritizing the events and customizing ADD icon in toolbar

    Hi Experts,
    Please help me on how to achieve the following functionalities in ALV:
    1. I have the events data_change_finished and user_command.Is it possible to trigger the event user_command first when both events are simultaneously called?
    2. I have an alv grid which initially has 3 rows of which in each row 4  cells are editable and 3 are non-editable.Now,when the user clicks on the toolbar to append a new row,I need to have only one cell as editable. For me it appends the new row which is the replica of the exiting row
    Kindly help me to resolve this issue.
    Thanks and Regards,
    Archna Raja

    Hi Archna,
    Two events can't be invoked simultaneously. So I am not quite able to visualize your scenario.
    For disabling individual cells in an ALV you can set cell properties for each cell as Disabled or Enabled.
    When a new line is added you can write the specific code to disable the additional two cells.
    Write in if you need more.

  • Creating an order form from a sharepoint list

    Hello- I need to create an order form that shows my entire sharepoint list and allows the user to select the items he/she wants and put qty's next to them. Is this possible?
    I see how to add the list into my form as a dropdown allowing me to select each on individually but i would like them all to be displayed.
    I am using infopath 2007.
    thanks - Casey

    Hello,
    You first need to create custom list in sharepoint (if not created yet) and save data into it. Later you need to add a data connection in form to connect your list with infopath form.
    Now you can bind the data with dropwdown or bind with repeating table to show all (just drag and drop the connection on form). later you can add one checkbox in repeating table so user can select the data whatever they want.
    Refer this link to drag and drop data connection as repeating table:
    http://www.enjoysharepoint.com/Articles/Details/show-sharepoint-list-data-in-repeating-table-in-infopath-2010-377.aspx#.U3rnLSjcCHM
    Refer this for checkbox:
    http://www.bizsupportonline.net/infopath2010/how-to-check-all-check-boxes-repeating-table-infopath-2010.htm
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

Maybe you are looking for