Link to the uploaded document in RichTextHtmlField is not generated if custom document upload form is used

I have a RichTextHtmlField in a page. The user who is entering data need to upload the document for reference. I want to change the selected option of Destination Library in the form. To do so, I have copied entire content of
Upload.aspx page and created a custom action to launch the custom upload form. When I click on the custom action button I am getting the exact ouput which I want but after the upload operation completes I am not getting the link generated in the
field area, as SharePoint OOTB upload form does.
My custom action contains following code:
<CustomAction Id="Ribbon.PublishTab.Publishing.Actions.UploadDocumentButton" Location="CommandUI.Ribbon">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.EditingTools.CPInsert.Links.Controls._children" >
<Button Id="Ribbon.PublishTab.Publishing.UploadDocumentButton1" Command="UploadDocumentButton1"
Image16by16="/_layouts/15/Solution/Images/Approval_16_by_16.jpg"
Image32by32="/_layouts/15/Solution/Images/Approval_32_by_32.jpg"
LabelText="Upload File" TemplateAlias="o1" Sequence="1000" />
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler Command="UploadDocumentButton1" CommandAction="javascript:function test(){
var url = _spPageContextInfo.webAbsoluteUrl + '/_layouts/15/DiscussionBoardEventReceiver/Pages/UploadFile.aspx?UseDivDialog=true&amp;LCID=1033&amp;Source=' + _spPageContextInfo.serverRequestPath +'&amp;AssetPageFolder=true&amp;seed=0.10343389471709208';
var options = {url: url};
SP.UI.ModalDialog.showModalDialog(options);
} test();">
</CommandUIHandler>
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
The page UploadFile.aspx the exact code which is found in Upload.aspx in
\_layouts folder.
The file is uploaded successfully but the link is not getting generated. What am I missing?

Hi,
According to your description, you might want to upload a file to a library and insert the corresponding hyperlink into the RichTextHtmlField when editing a page.
Based on the code above, a modal dialog holds the custom “UploadFile.aspx” will be responsible for the file uploading, however, as there seems no code in the callback
function of the modal dialog to handle the operations after file uploaded, though file will be uploaded, there will be no hyperlink get generated and inserted into the page.
A demo about how to work with callback function of modal dialog:
https://alinimer.wordpress.com/2013/02/25/open-pages-and-forms-in-modal-dialog-for-sharepoint-2013/
As we can see, if using the OOTB feature to insert a file into the page, the corresponding HTML structure would be like this:
Thus, a possible workaround is that you can write code in the callback function to capture the dialog closing event and inject a hyperlink into the page accordingly.
About how to inject HTML into page:
http://stackoverflow.com/questions/3762385/best-way-to-inject-html-using-javascript
About how to modify the HTML source code of a page using JavaScript:
http://www.w3schools.com/js/js_htmldom_html.asp
http://njarb.com/2011/06/update-html-content-using-javascript/
Best regards
Patrick Liang
TechNet Community Support

Similar Messages

  • Is there a way to create a pdf that preserves all links from the origional document?

    Hi,
    I have a new, rather large, pdf document I need to create. After discovering that adobe will not reliably convert hyperlinks from an office document, I need a new strategy. Does anyone know of a program, other than office, that adobe will reliably convert the links in the origional document into links in the pdf? Or is there a different way to do this, other than adding links in adobe after I create the pdf?
    I have Windows 7, Office 2007, Acrobat Pro X, and IE 8 (I know... it's a work laptop)
    Thanks

    In iTunes, File>Print. Then select your options.

  • How can i do the upload file function using tomcat library??

    how can i do the upload file function using tomcat library??

    Did you read the document for the library?
    If you can't figure it out, why don't you ask the people who provide the library?
    This has nothing to do with JavaMail.

  • Allt he links in the header of any websites are not working, I reinstalled fiorefix and it s the same. No problem in others browser. the tool bar is working but not the link sinside the web page located between the top 300px height

    all the links in the header of any websites are not working, the cursor is not changing into pointer and no way to click on any link located at the top of any website page. I reinstalled firefox and it s the same. No problem in others browser. the tool bar is working but not the links inside any web page located between the top 300px height.
    So I can t tlog into any website, i cant write an email as the compose button is located in the top of the page.. Please help, i have all my bookmarks into my firefox...

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Multiple link of the same document

    1.I heard that when I buy a windows server, there comes also a free edition/foundation edition of sharepoint. Is it right?
    2. When I upload a document to the free edition of sharepoint, is there any position for me also to enter the metadata of the document to facilitate future searching of the document? Please show me some screenshots.
    3. Under ambiguous circumstances where a document can be put into two locations/folders, people suggest to set a multiple link to this document, so that when I click the link inside either one of the folders, I can get the same document. It means there is
    no need to upload the same document to both folders. It is not simply a normal shortcut which we usually come across in window explorer. Can Sharepoint do this?

    1. Yes, it's called SharePoint Foundation Server.
    2. Of course, this is a core functionality of SharePoint. See
    https://www.google.nl/search?q=sharepoint+document+library+metadata+screenshot&tbm=isch&tbo=u&source=univ&sa=X&ei=d9nIU6usNofGPNG6gPAF&ved=0CB8QsAQ&biw=1400&bih=748 for screenshots.
    3. No, although you can use the document id service to generate a permanent link and use that link in a metadata field to refer to the source doc. Not in the free version, though
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

  • Emailing persistent link to the current document version.

    I did not find a suitable answer by searching previous posts.
    We are working on a document transmittal workflow. This will email to a user, links to documents stored in a SharePoint document library. A requirement is to use out of the box features.
    If the document is an old version I use the link format
    http://site/_vti_history/UIVersion/Document Library/doc.doc. This works well as it always points to that version of the document.
    However the above format does not work when referencing the current version of the document, even if I know the document UIversion to plug into the above URL. The link has to be
     http://site/Version/Document Library/doc.doc
    The problem is when a link to the current version of the document is emailed and then the document is changed in SharePoint. 
    The email will no longer point to the version intended but rather the ‘new’ latest version. I need the link to open the correct document version.
    What I need is a persistent link to any version of a document whether the current version or an old one and to generate that at the time the email is created.
    However I cannot see a way to do this. Any help would be appreciated.
    Our current work around is to clone the document to artificially create an old version which can then be referenced. However this is not desirable.
    Thanks Richard

    Hi Richard,
    I'm afriad that it is impossible to modify the current document url(canonical path) to the last history version document url(revision path) in the workflow mail has been sent after the new current document(canonical path) generates.
    The canonical path document will always points to the lastest current version document, the persistent link of revision path document will only be available after the newer current canonical path document generates, and the revision path in workflow
    mail will not be available for the curent document item, this is how SharePoint version history works, you can read the following article.
    As a workaround, you may clone the document as you have done, or you may send the all the current version document information and the current document attachment in workflow mail as a snapshot for that time of triggering the workflow.
    http://blogs.msdn.com/b/roberthorvick/archive/2007/01/04/wss-rant-linking-to-the-latest-version-of-a-sharepoint-document-considered-harmful-lessons-6-and-7.aspx
    Thanks,
    Daniel Yang
    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]
    Daniel Yang
    TechNet Community Support

  • HT1933 'Report a problem' link in the email with purchase receipt does not work.

    While opening itunes I get an error "unable to connect to itunes",then a screen with the text: "your request produced an error.NewNullResponse".It's in-app purchase, magazine subscription.How do I report a problem if the link does not work?

    Go here:
    http://www.apple.com/support/itunes/contact/
    and follow the instructions to report your issue to the iTunes Store.
    Regards.

  • How To send the text document as a attachment using a 'So_object_send'

    Hi,
    I want to send a mail to user in sap office.
    I had used a function module 'SO_OBJECT_SEND'.
    Also, I need to send all the attachments (like files .XLS,.TXT etc) in the mail as a attachment.
    Please tell me how to pass the attachment to the Function module 'So_object_send'.
    Thanks in advance
    Regards,
    Darshana

    You should use FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail with attachments.
    Below is the code for your reference :
    Doc data
          WL_DOC_DATA-OBJ_NAME  = TEXT-031.          "Survey Data
          WL_DOC_DATA-OBJ_DESCR = TEXT-031.          "Survey Data
          WL_DOC_DATA-OBJ_LANGU = C_LANG_EN.         "E
    Receiver's details
          WL_RECEIVERS-RECEIVER  = ABCD AT XYZ DOT COM."l_survey_recipient_email.
          WL_RECEIVERS-REC_TYPE  = C_REC_TYPE.       "U
          WL_RECEIVERS-COM_TYPE  = C_COMM_TYP.       "INT
          WL_RECEIVERS-NOTIF_DEL = C_CHK.            "X
          WL_RECEIVERS-NOTIF_NDEL = C_CHK.           "X
          APPEND WL_RECEIVERS TO TL_RECEIVERS.
    Mail subject
          WL_HEADER-LINE = TEXT-036.                 "Mail
          APPEND WL_HEADER TO TL_HEADER.
          LOOP AT TL_EMAIL_TAB2 INTO WL_HEADER2.
            CONCATENATE  WL_HEADER2-MESSAGE  C_TAB INTO  L_STRING.
            CONCATENATE C_RET  L_STRING  INTO WL_OBJTXT-LINE SEPARATED BY SPACE.
            APPEND WL_OBJTXT TO TL_OBJTXT.
          ENDLOOP.                                   "LOOP AT tl_email_ta..
          DESCRIBE TABLE TL_OBJTXT LINES L_LINES.
          L_TMP = L_LINES * 255.
          MOVE L_TMP TO L_DOC_SIZE.
          CONDENSE L_DOC_SIZE.
          WL_PACK-HEAD_START  = 1.
          WL_PACK-HEAD_NUM    = 0.
          WL_PACK-BODY_START  = 1.
          WL_PACK-BODY_NUM    = L_LINES.
          WL_PACK-DOC_TYPE    = C_DOC_TYP.           "RAW
          WL_PACK-OBJ_LANGU   = C_LANG_EN.           "E
          WL_PACK-DOC_SIZE    = L_DOC_SIZE.
          APPEND WL_PACK TO TL_PACK.
    Call function module to send the email to the survey recipient
          CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
            EXPORTING
              DOCUMENT_DATA              = WL_DOC_DATA
              PUT_IN_OUTBOX              = C_CHK     "X (Check)
              COMMIT_WORK                = C_CHK     "X (Check)
            TABLES
              PACKING_LIST               = TL_PACK
              OBJECT_HEADER              = TL_HEADER
              CONTENTS_TXT               = TL_OBJTXT
              RECEIVERS                  = TL_RECEIVERS
          IF SY-SUBRC = 0.
            SUBMIT RSCONN01 WITH MODE = 'INT'
                            WITH OUTPUT = 'X'
                            AND RETURN.
          ENDIF.
    Regards,
    NaPPy

  • Skype 4.3 maximizes the upload stream when using t...

    What the title says, it maximizes the connection up stream until the connection completely dies and disconnect.
    Limiting it with tc works in the sense that it doesn't disconnect, however it still uses too much bandwidth for the video that the other party in the conversation can't hear me at all.
    Info:
    multilib/skype 4.3.0.37-3 
    Kernel 3.16 (same on 3.14, 3.15 and 3.{14,15}.*-ck)
    Arch Linux

    Only solution I found was using a patched skype 4.2 (https://aur.archlinux.org/packages/skype42/) that sends the version was 4.3 to the server.
    If microsoft can't handle multiplatform software, why the hell buy it / make it...

  • My ipod Classic hangs and freezes on the apple screen.  It will not do anything.  I tried to restore using iTunes, but came out 1415 error code, and cannot do anything about it.

    My iPod Classic which I rarely uses.  I try to refresh it and put new song into it.
    As I try with iTunes, it runs very slow and show that it had problem, need to restore it.
    When I tried, it will not and hangs, also slows my HP Win 7 system immensly.
    I tried to reset, pressing the middle and menu botton, now it hangs on the apple screen and remains there forever.
    What is the problem and how can I solve it?

    The screen is telling you to connect the iPod to your computer and restore via iTunes.
    iTunes: Backing up, updating, and restoring iOS software

  • Create links to other Pages documents

    I am a singer and have been using a binder with all my lyrics in it for shows. I got an iPad for my birthday and want to use it in the binder's place. With each show the set list changes and I'd like to be able to create a setlist document in Pages with links to other Pages documents with the corresponding lyrics. The lyrics documents would be static; the setlist document would always be changing. The links in the setlist document would be like hyperlinks of sorts, except instead of taking you to the web, they would take you to other Pages documents in the My Documents folder in Pages.
    I've searched all over the place for a solution. I've even tried using spotlight to search for the lyrics documents as a workaround, but spotlight doesn't find the Pages documents. Is this something I can set up on my MacBook and then transfer to my iPad? Is there other software besides Pages that can do this?
    Thank you in advance!

    I think it would be much simpler to save your lyrics as pdfs and use one of the many dedicated music apps that allow you to create setlists. I use forScore (love it!), but you might also check out Unreal Book and Music Reader.
    If you have a Mac, of course it's a cinch to print any file to PDF. For windows, possibly the free version of CutePDF would work for you.
    EDIT I see you already have these printed out in binders. Just scan to PDF, then.

  • Why, when I click on an email link in a PDF document, does a new tab open?

    I convert an excel spreadsheet to PDF. I click on the email link in the new document and it opens a new FF tab and two, not one, two MS outlook emails. Drives me nuts.

    I have the same problem, and I also wondered if Google toolbar has anything to do with it. There GMAIL was set as the default mail application at first. I have removed that setting, but Firefox 4.0.1 continues to use GMAIL instead of Outlook which is my selection for mailto handling.

  • Error in "Reading the Accounting document Attachments"

    Hi all,
    I have a requirement to read the attachments from the accounting document. I am using below Function Modules.
    BDS_BUSINESSDOCUMENT_GET_URL
    , to get the link of the attachments  based on the object key.
    DP_GET_STREAM_FROM_URL
    , To get the content based on the link. This is throwing a dumb.
    Here, i have tried with another set of Function Modules. But None is working.
    ARCHIV_CONNECTINFO_GET_META
    , To fetch details about attachments
    SCMS_AO_TABLE_GET
    , to get binary content.
    Propose any Function Modules if used in this regard.
    Thanks,
    Vishnu

    [redacted confused advice]
    [_Compressing and Decompressing Data using Java - with many code samples_|http://java.sun.com/developer/technicalArticles/Programming/compression/|Yes Virginia, there really are code samples]

  • Linking of FI clearing document to its scanned image stored in Open Test

    Hello Gurus,
    I have a requirement in which scanned copy of clearing document which is stored using Open text should be linked to the clearing document in SAP. I am new to this concept, can anyone help me with how to go about this. I am suppose to write a custom program as there is custom logic for selecting the clearing document for this.. how should I go about this??
    thanks for all the help..
    Thanks and Regards,
    Saurabh Chhatre

    i have emergency guys.. please help...
    - Saurabh

  • Error messege BP603 while posting the parked document budget exceeded

    Hi ,
    We are having the budget function and its for overall release.
    Budget has been relased and assigned value is less then the released budget in all conditions.
    Its throwing the error messege No BP603  while posting the parked documents. Unable to understand the reason why its behaving.
    Please let me know if anybody has faced such problem.
    We are into ECC6, EHP 4 and the SAP note 557431 is not going to help anyways.
    Regards
    N.Raju

    Hi,
    Please follow as given below:
    1. Use T.Code KO31 and enter order and deactivate the control
    2. Then try to post the parked document
    3. And use T.Code KO30 and enter the order to activate the control
    Some times system will check budget availability which already commited for parked documents.
    Hope it will work.
    Chandu

Maybe you are looking for

  • Default initial context in cluster -multi homed environment

    Hi,           Here is the configuration for our environment.           Cluster at the webserver level only.           Mutihomed Solaris.           Guest user is disabled.           I call this statement from a class which is application server.      

  • Will There be......?

    1.will there be an iphone either 3g or not.... that can be used for all countries without customize them.... or change its e.g. memory or data..... I ask because some say that in my countries the price are so $%#^^%$(don't get mad) high because of th

  • STAD + Getting Web Dynpro program names with FM SAPWL_READ_STATISTIC_FILES

    Hi, does anyone knows why I can't seem to get the report-names of a web dynrpo app with this FM? Is there maybe an other FM with which I can get the results of transaction STAD?

  • Officejet 6500 won't print when Laptop is on the network.

    We have a HP Officejet 6500 that connects to a laptop vis USB plug. It worked fine for a few weeks, but now anytime the laptop is connected to the office network by ethernet is will not print. Once you unplug the network cable from the laptop it prin

  • Transfer between Plants accounting.

    Hi experts, We are transferring a material between plants using movement type 301 (MB1B). Material price control is 'V' in both plants, nevertheless in some transfers, the accounting document shows an amount in the G/L Account informed in the transac