none
SharePoint Hosted Add-in: Exception from HRESULT: 0x80131904 when saving a hyperlink field RRS feed

  • Question

  • Hi,

    There is a SharePoint hosted add-in deployed. The requirement is to display an edit link and when clicked on that hyperlink, it should redirect to the form for editing. I created a view with the a column 'Edit Link' which is a multi line text field and enabled RichTextMode="FullHtml" and RichText="TRUE" through Visual Studio.

    When giving var editLinkUrl = "<a href='" + url + "'>Edit</a>"; It is displayed as a hyperlink but the link becomes inaccessible and when tested manually to save the form link, The following error was thrown: 

    Exception from HRESULT: 0x80131904

    The search results hint at SQL server running put of space or permissions issue but it is not the case as we are using SharePoint Online. 

    Any help is greatly appreciated. 

    Thank you in advance.

    Regards

    SLS


    • Edited by SLS22 Wednesday, November 6, 2019 5:56 PM
    Wednesday, November 6, 2019 5:56 PM

All replies

  • Hi SLS22, 

    If you want to build a hyperlink to edit item, the url should be like:

    https://tenant.sharepoint.com/sites/sitename/Lists/ListName/EditForm.aspx?ID=number

    In this issue, please check if the url is valid, you could check with Browser Developer Tool to see the real url value.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Thursday, November 7, 2019 6:31 AM
  • Thank you for your reply.

    The URL is valid because when I copy and paste it in the browser, It works perfectly fine.

    Regards

    SLS

    Thursday, November 7, 2019 3:29 PM
  • Hi SLS22,

    Try to create a hyperlink field instead of Rich Text Multi-Line field in the list to store the eidt form url.

    Then test to see if it's working to access and save.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.



    Friday, November 8, 2019 9:28 AM
  • Jerry,

    The problem is that the URL contains query string parameter which is a URL again (URL within URL) as shown below:

    https://xyz.sharepoint.com/sites/qa/xyz/pages/formreport.html?SPHostUrl=https://xyz.sharepoint.com/sites/qa&SPAppWebUrl=https://xyz.sharepoint.com/sites/qa/xyz&formid=6-11-2019-15-42-41

    Tested with encodeURIComponent but no luck. 

    Any help is greatly appreciated.

    Thanks

    SLS


    Friday, November 8, 2019 2:05 PM
  • Hello SLS22,

    I tried to test with your description, add a multi line text field in a list within SharePoint hosted add-in and add a hyperlink with SPHostUrl and AppWebUrl parameter in Url:

    1. Add Multi Line field:


    2. Deploy the Add-in and test with url:

    Then save in the SharePoint Add-in list, it's working as expected in my side.

    I checked with yours, found that the SPAppWebUrl parameter is invalid, App Web Domain should be like:

    https://Tenantname-a0418b70dd29a0.sharepoint.com/sites/dev/SharePointAddIn12

    It will contain a identifier append with Tenant name using "-" symbol.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.



    Monday, November 11, 2019 9:10 AM
  • Hi Jerry,

    Thank you so much for your time and response. Sorry about the confusion but the SPAppWebUrl is valid, I missed to add the '-' in the example URL shown in my previous comment. Here is the right one:

     I did try with your reply and it saves without an error when the Form ID is not given. As you can see from the above URL, I want the hyperlink to re-direct to a specific form report identified by form ID.

     I am not sure why the URL wouldn't save and the error is seen when the form ID is specified. Greatly appreciate your help.

    Thank you in advance.

    Regards

    SLS


    Tuesday, November 12, 2019 4:43 PM
  • Hello SLS22,

    I tried to append the formid querystring in the url like the capture below:

    Still able to save without the error in the question above in my side.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, November 13, 2019 2:52 AM
  • Hi Jerry,

    Could you please mention the steps you followed. From your reply, I changed RichTextMode="FullHtml" to HTMLEncode="FullHtml" but the column did not have rich text options on top. I see that the URL is entered in the 'HTML Source' text box from your screenshot above. Please let me know how you were able to see that option. Here is my multiple lines of text column with RichText="TRUE" HTMLEncode="FullHtml".

    

    Believing the error is seen only when the formid is give in the query string url, tried and tested with ID=123 or fid=123 and it saved without an error which is surprising.

    Truly appreciate if you can walk me through the steps performed. 

    Regards

    SLS

    Wednesday, November 13, 2019 8:46 PM
  • Hi SLS22,

    My mistake, still using the RichTextMode="FullHtml" like below:

    <Field Name="MultiHtmlLink" ID="{72d6b341-4bed-4298-9479-9a554899495f}" DisplayName="MultiHtmlLink" Type="Note" RichTextMode="FullHtml" RichText="TRUE" /></Fields>

    After deploying, you will see the RichText ribbon menu like bleow:

    About the html source, I'm tracing with Browser Developer Tool (F12):

    For the querystring formid, it's actually working in my side like capture above.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Thursday, November 14, 2019 5:00 AM
  • Hi Jerry,

    Thank you for the detailed steps. I tried to test the link after giving it in the 'Insert->Link->From Address' section and it looks like the URL  is becoming invalid. Here is the error message seen when clicked on 'Try link' :

    {"readyState":4,"responseText":"","status":404,"statusText":"error"}

    But when the same URL is copied and pasted into the browser, it works perfectly alright.

    Ex: The given link works fine

    but gets converted as shown below when clicked on 'Try Link'.

    & is converting into &amp; Can this be the reason why it is failing to save?

    Regards

    SLS

    Thursday, November 14, 2019 10:36 PM
  • Hi SLS22,

    & encorded to &amp; won't be the issue.

    As in my side, the same encord happened, the url still working when click "Try Link":

    The mainly issue is the querystring formid in your side, as the error message mainly like a web service response and the 404 error means resource not found.

    I assume the formreport.html have some custom code which needs this formid, I suggest that you could if this querystring is valid.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.


    Friday, November 15, 2019 2:41 AM