Get original URL for Link to a Document content type

Hello,
I'm having a SharePoint doc library with ItemAdded event receiver attached to it and "Link to a Document" content type enabled. My general question is:
How to get URL that the link points to?
I'll show you how I'm trying to achieve that:
SPWeb parentWeb = properties.Web;
if (properties.ListItem.ContentType.Name == LinkContentTypeName)
object urlFieldValue = properties.AfterProperties["URL"];
if (urlFieldValue != null && urlFieldValue.ToString() != String.Empty)
// continue
But I always get null so I can't even get inside IF statement. I've tried to install ItemAdded event receiver as synchronous, but it didn't make a difference. I'd appreciate any ideas.
Regards
Tomasz

This is not very convenient solution, because ItemUpdated can be executed more than once. However this certainly will work, so I'll accept this as a workaround. Actually I've found another one. I'm parsing link aspx file and I'm getting the URL
from mso:URL tag:
<%@ Assembly Name='Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' %><%@ Register TagPrefix='SharePoint' Namespace='Microsoft.SharePoint.WebControls' Assembly='Microsoft.SharePoint' %><%@ Import Namespace='System.IO' %><%@ Import Namespace='Microsoft.SharePoint' %><%@ Import Namespace='Microsoft.SharePoint.Utilities' %><%@ Import Namespace='Microsoft.SharePoint.WebControls' %><html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><Head> <META Name='progid' Content='SharePoint.Link'><!--[if gte mso 9]><SharePoint:CTFieldRefs runat=server Prefix="mso:" FieldList="FileLeafRef,URL,_x0043_C1,KitId,ItemKey,Suffix_x0020_Code"><xml><mso:CustomDocumentProperties><mso:URL msdt:dt="string">http://serverUrl/sites/arrangement1/Shared Drawings/test, test</mso:URL><mso:ContentType msdt:dt="string">Link to a Document</mso:ContentType><mso:File_x0020_Title msdt:dt="string">Winding A Assembled</mso:File_x0020_Title>
<mso:Revision_x0020_Number msdt:dt="string">-</mso:Revision_x0020_Number>
<mso:Page_x0020_Size msdt:dt="string">A2</mso:Page_x0020_Size>
<mso:ContentTypeId msdt:dt="string">0x01010A0082704B66E8B222478AF2E379D8A2FFB9</mso:ContentTypeId>
<mso:ItemKey msdt:dt="string">1</mso:ItemKey>
</mso:CustomDocumentProperties></xml></SharePoint:CTFieldRefs><![endif]--></head><body><form id='Form1' runat='server'><SharePoint:UrlRedirector id='Redirector1' runat='server' /></form></body></html>
Regards
Tomasz

Similar Messages

  • Problem "Link to a document" content type within document set - Bug?

    Hello,
    I'm having an issue with the "Link to a document" content type in one of my document libraries. The issue is when you create a link to a document inside a document set:
    The result is that the users get redirected to the wrong URL (../docsethomepage.aspx instead of ../docsethomepage.aspx?ID=.......), and instead of seeing the actual document set they started from, with the new link (or any document that is already in the
    document set) the users see a default view of a generic document set - not the one they started from:
    Any suggestions on how to fix this? One library has this faults and one does not. Our SharePoint server is up-to-date.

    Hi,
    I reproduced the issue in different versions of SharePoint, it works in SharePoint Server 2013, and the issue occured to Office 365. I then tried enabling “Launch forms in a dialog”, it worked.
    I will forward the issue to our internal feedback channel. And since the issue occurs to Office 365, please create service request with online engineer for root cause.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Issue in creating a add link to a document content type on a doc lib name with , / special characters

    hi,
    i am having a  requirement to create/use "add link to a document" content type for a item in the document library.
    so i got  the code from below site :
    http://howtosharepoint.blogspot.in/2010/05/programmatically-add-link-to-document.html
    my issue is, if teh document  library names are single words - like MOM, model, procedures etc this  functionality is working fine and i am able to view the link to a document as an item. 
    but when the doc lib name contains special characters like , or  /  , this link to a  document  content type functionality is NOT working.
    can anyone pls point me whether this is the  actual  issue ? ie, if  the doc lib name contains special chars  like , or /  my
    add link to a document wont work? is there any restrictions/limitations for doc lib names in SharePoint ?
    for eg: my doc lib names are :
    1) Report and analysis, Data
    2) form / template
    3) map/ plot
    help is highly appreciated!

    hi,
     its talking abt the subsite names and  folders and NOT the document librraies.
     is there any link which gives the naming convention / restricted names for  document libs or  splists , from msdn / blogs.technet.
    thnx

  • How can we get a url for a "Meet Now" conference call from within the Windows Store App?

    Hi,
    Is it possible to get the url for the current meeting / new "Meet Now" call from within the Windows Store app?
    You have the option of inviting your current Lync contacts, but I don't see a way of giving a URL to clients that would launch Lync on their device, or take them to the web app.
    I can see how to get the link using the Outlook plugin, for pre-scheduled meetings. Is this link always the same and the one that should be used for an impromptu "Meet Now" meeting? It would still be good to know how to get this URL from within
    the store app so I can tell clients where to get it.
    Some people may be on Windows RT devices and not have access to the plugin in Outlook, and want to start a meeting at short notice and then invite others via email or pasting a link to them elsewhere.
    Any help appreciated.
    If I have answered your question, please mark it as the correct answer. If I have provided helpful information, please mark it as so.

    Hi,
    Agree with Holger, I check on my Lync Windows Store app and can't find the meeting URL as well.
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • Can I use Bridge CS6 as a central image database for linking to multiple documents?

    Can I use Bridge CS6 as a central image database for linking to multiple documents?

    It's only really good for Adobe document formats, if you want to be able to view and/or tag documents.

  • Table for link between Accounting document and Billing document

    Which is the table for link between Accounting document and Billing document ?
    Thanks & Regards

    Ø Go to SE16N, enter table BSAD
    Ø In the Reference Field (VBELN) enter the Billing Document no. 
    Tips:
    Ø Make sure that only those billing documents will be considered whose accounting documents actually exists
    Ø No Accounting documents will be displayed for Credits, Free of charge orders and those acc. Documents which have been cancelled.

  • Link to Document Content Type issue - links not relative

    I'm using the Link to Document content type in a library in order to link to documents in other libraries.  We just migrated to 2010 from WSS 3.0 (2007) and are having an issue.  We view our site internally thorough the internal machine address/name
    and also have users connecting remotely from an external url.  In 2007, it didn't matter whether we were internal or external, all links were apparently stored as relative because the "link to document" items worked fine either way.  This
    was despite entering the url fully and not relative.  When viewing/editing the properties of that item, it shows you the full url applicable to where you are viewing it...internal if internal, external if external.  
    However, after the migration to 2010, all links that existed previously are fine, but any new items created using link to document apparently no longer store them as relative so either the internal or external users get the wrong link.  For example,
    if I put in the link as http://servername/library/doc the external users get that same link and it doesn't work, since it should be like https://myurl/library/doc.  Viewing/editing the properties of the item shows an absolute url of whatever location
    the item was added.  For instance if I'm connected externally and add an item, even if i only enter it as relative, it creates the link as https://myurl/library/doc and then the internal users end up having to connect via that url and that is just a pain
    due to AD and certificate issues.  The internally created links are obviously not accessible at all from the outside. 
    I've also tried storing the link as relative when creating the item but it seems to overwrite it with the absolute link.
    This is causing quite an issue with us.  Does anyone have any insight as to what is going on and how to fix it?
    thanks!

    Hmm...I thought I had the thread set to email me if there were replies and I never received an email so I thought there were no replies.  I came back to this since another issue cropped up that is related and there were replies!
    I cannot recall how things were set up exactly in 2007 and there's no way to look back now.  I'm a novice when it comes to AAM/DNS/IIS really.  Maybe you can suggest what it should look like?
    We have our site which is accessed internally by http://machinename .  Externally, we use https://sharepoint.mydomain.com .   
    In AAM we have http://machinename listed in the default zone with the same url for internal and public.  We also have https://sharepoint.mydomain.com listed, in the internet zone and it also has the same url for both internal and public.  
    In IIS, the sharepoint site has bindings for port 80 and 443, but nothing specific to https://sharepoint.mydomain.com
    DNS....I'm not sure what should be here, if anything.  
    We can access the site just fine externally, there are just a few instances where some links do not work correctly and point to the internal url instead of external when you are external.  The original post is one time and the other, found the other
    day, is a search box webpart that points to a relative url for the results page but externally it ends up going to the internal url.
    I'd appreciate any guidance.  Thanks!

  • Cannot delete Document Content Type. Getting error "Document Content Type Still in use" powershell, sharepoint 2013

    not able to delete "Document" content type from a library. I have a custom content type. I have added the custom content type to all the items of library. also, i have added the custom columns from "Document" content type to my custom
    content type. Still cannot delete the "Document" content type. I am doing the same process in different site collections and different libraries. But not able to delete in a few say- 10 in 100. Get the error - "Document content type is still
    in use"

    Hello 
    Here you go
    http://blog.octavie.nl/index.php/2012/09/14/error-the-content-type-is-in-use-explained
    https://social.technet.microsoft.com/Forums/en-US/e81020e3-2c12-4f39-a2f4-f1fd88ba6547/content-type-is-still-in-use-on-document-library
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • PO 7.4: NW BPM: HTTP Error response for SOAP request or invalid content-type.HTTP 200 OK

    Hi Experts
    I am trying to call NW BPM scenario(File to BPM) from PI, and using below adapter config.
    I am getting below error.
    Failed to call the endpoint: Error in call over HTTP: HTTP 200 OK
    SOAP: Call failed: java.io.IOException: HTTP Error response for SOAP request or invalid content-type.; HTTP 200 OK
    SOAP: Error occurred: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: HTTP Error response for SOAP request or invalid content-type.; HTTP 200 OK
    MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: HTTP Error response for SOAP request or invalid content-type.; HTTP 200 OK
    Transmitting the message to endpoint <local> using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: HTTP Error response for SOAP request or invalid content-type.; HTTP 200 OK
    Any idea how to fix this issue?
    Thanks,
    Sandeep Maurya.

    Hi Sandeep,
    Test the URL from your browser and check the proxy settings as well.
    Refer the below links
    SOAP: call failed: java.io.IOException: invalid content type for SOAP: TEXT
    SOAP: Call failed: java.io.IOException: Failed to get the input stream from socket: java.net.SocketException: Connection…
    Regards
    Bhargava Krishna

  • Can't change column order from document content type

    Hi,
    I noticed a strange error in our SharePoint 2010 environment:
    We are using a SharePoint 2010 Enterprise Edition which was migrated from a MOSS 2007 Enterprise Edition with one central document library.
    In this library are several content types plus the given document content type which was already there.
    When I try to edit the column order in the document content type settings the following error occurs:
    Server Error in '/' Application.
    Object reference not set to an instance of an object.
    Description:
    An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and
    where it originated in the code.
    Exception Details:
    System.NullReferenceException: Object reference not set to an instance of an object.
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location
    of the exception can be identified using the exception stack trace below.
    Stack Trace:
    [NullReferenceException: Object reference not set to an instance of an object.]
    Microsoft.SharePoint.ApplicationPages.ChangeFieldOrderPage.OnLoad(EventArgs e) +376
    System.Web.UI.Control.LoadRecursive() +65
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2427
    This error only occurs with the document content type. Furthermore I am not able to reproduce this error on other libraries except when
    I am using a template from this library.
    I tried to delete this content type but every time an error occurs which is saying that the content type is still in use. I checked the entire library and all informations from the SharePoint Manager 2010 Tool but the content type is definitely no longer in
    use.
    I appreciate every little bit of help regarding this problem.
    PS:
     There is also another error concerning every content type in this library: I can’t create a new or use the standard Microsoft document information panel template because every time I try to there also occurs an error which
    states out a NullReferenceException regarding the metadata of this library. But that is another story which is next on my to-do list. First I would like to solve the first error concerning the column order.
    Thanks and regards,
    Thomas K.

    Hi TKellner,
    Thanks for your post.
    1.      
    Please try to use the code below to check whether the Content Type is in used.
    http://www.learningsharepoint.com/forum/sharepoint-2007-programming/check-where-the-content-type-is-used-in-sharepoint-site/
    2.      
    Can you open the Document Library in SharePoint Designer 2010? Also, can you open the template file correctly?
    Share the result.

  • File created with Document Content Type will not be saved back to Sharepoint library

    Recently some of our users, after upgrading to Windows 8.1 with Office 2013, intermittantly are not able to save files created using  document content types template back to sharepoint library. Instead the location is set
    to their local storage. The same templates used by Windows 7 users with Office 2010 are working fine. Setting the SP sites as Trusted location in IE and Clearing IE Cache did not help. Adding the SP site in Word Trusted Location did
    not help. Any suggestions how this can be resolved is appreciated. Thanks.     

    Hi,
    According to your post, my understanding is that you could not save office file back to the SharePoint Document library.
    It may have to something with your Word Settings. When you click new and it opens in MS Word, word treats it as unsafe because perhaps it is not saved. To make it work:
    Go to Word (2013) -> File Menu -> Options -> Trust Center -> Trust Center Settings
    -> Protected View Tab -> Uncheck "Enable Protected View for files located in potentially unsafe locations" (2nd option)
    Here is the similar post, you can take a look at:
    http://blogs.interfacett.com/word-2010-not-saving-back-to-sharepoint-2010-by-default
    If the issue persist, you can also check the event log and ULS log to see if anything unexpected occurred.
    To check event log, click the Start button and type “Event Viewer” in the Search box.
    For SharePoint 2010, by default, ULS log is at:
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to add the library document version to the parent Document content type?

    Hi All,
    I have a PWA instance with a project site for each project.
    Each project site has its own document library.
    Now I want to create several Templates to be available within each document library.
    I have created the new content Site Content Types (Site Settings > Site Content Types) to fit my needs; each content type has the "document" content type as parent type.
    Now I want include the "version" property (the dynamic value from the versioning) to each new document type, so I have tried to enable the "Information management policy settings" to the parent "document" type or the new ones,
    including the label "{Version}", but I receive this error:The label reference, Version, could not be found.
    So the only way to do this, is to open each site document library and make this change within it.
    Why I can't enable the Lable at the Site level?
    Thanks

    Hi,
    I can reproduce the issue by adding {version} or {_UIVersionString} in site content types > Document > Information Management policy settings > enable label.
    As workaround, please create a document library, then add label in document library settings > Information Management Policy settings. Now save this document library as template and create new document library based on this template, the policy settings
    will be saved for new document libraries.
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • [CS3 JS SDK] Possible to Use HTTP URLs for Links?

    I am attempting to use JavaScript to implement a connector from CS3 (InDesign/InCopy in my case) to our content management system. Our CMS provides an HTTP-based API. By using the HttpConnection object (from the Bridge code, see posts on "httpwebaccess library") I can access our repository using HTTP URLs and, for example, get an InDesign document or INX file (and the UI support in CS3 scripting makes it possible for me to build all the UI components I need without having to write a true plugin).
    However, what I *can't* seem to do is create Link objects that use a URL, rather than a File, to access resources.
    My goal is to be able to store in our repository InDesign documents that use URLs to other resources in the repository for links (e.g., to graphics and InCopy articles).
    However, as far as I can tell from the scripting documentation and my own experiments, the URL property on Link is read-only in JavaScript (even though the scripting API HTML indicates it's a read/write property) and Link instances can only be constructed using File objects.
    My question: have I missed some trick in the scripting API (or elsewhere) that would allow me to create links that use URLs instead of files (and having done so would InDesign resolve those URLs?)? Our repository does support WebDAV, so that might be an option, but it would depend on mounting WebDAV services in consistent places on client machines, which is dicey at best, given the weak nature of the WebDAV clients on both Windows and OS X).
    Or are my only options to either copy linked resources to the client's local file system (or a shared network drive) or implement a plugin that implements my desired behavior for links?
    And if the answer is a plugin, will that even work?
    This is in the context of CS3. Has the Link mechanism changed at all in CS4 such that I could do what I want in CS4 where I cannot in CS3?
    Thanks,
    Eliot

    Hi,
    It is not possible to use HTTP URLS in CS3. You will have to create a plug-in to use Custom Data Links.
    I think it is possible to use HTTP URLs in CS4 as per the User Guide.
    Regards,
    Anderson

  • Getting errors while updating links in Indesign document using javascript

    Hi,
    We are updating the links in InDesign document using javascript. After running the script, we are getting the below errors in Adobe InDesign CC debug.
    When closing the document for first time we are getting the below mentioned errors,
    ASSERT 'fRefCount == 0' in c:\development\citius\source\components\database3\revisioneddatabase\SaLRICache.tpp at line 230 failed.
    Erased item list not empty at block delete time
    blockUID = 10486786 not freed
    Internal error: 904 items were leaked!
    After that we are opening the same document for second time, then we are getting the below mentioned errors,
    ASSERT 'ts_DBPubFile->PlacementUIDIsAvailable(uid)' in c:\development\citius\source\components\database3\revisioneddatabase\SaLRIUtils.tpp at line 195 failed.
    DB failed to create UID!
    ASSERT 'this->FindInIDRangeList(fLastCreatedBlockUID) >= 0' in c:\development\citius\source\components\database3\revisioneddatabase\SaLRICache.tpp at line 476 failed.
    ASSERT 'fLastCreatedBlockUID != kInvalidUID && fLastCreatedItemID != 0' in c:\development\citius\source\components\database3\revisioneddatabase\SaLRICache.tpp at line 467 failed.
    ASSERT '(SaLRIUtils<SnapshotID , SnapshotInfo>::ts_DB)->IsValidUID(itemUID)' in ..\..\..\source\components\database3\revisioneddatabase\SnapshotCache.cpp at line 55 failed.
    Please help us to solve this error in InDesign debug.
    Thanks,
    Vimala L

    You're probably better off raising this in the SDK forum.

  • Get HTTPS URL for Web dynpro application

    We are using SSL. By default the URL generated for the Web dynpro application is HTTP.
    We went to SICF, and deactivated the HTTP service. That made the URL point to HTTPS.
    But few problems started coming because of it:
    - Our Content server became inaccessible.
    - Every time server is re-started, we need to manually go and de-activate HTTP Service.
    We even tried to set the parameter icm/icm/HTTP/redirect_0. But problem is not solved.
    I know this question is asked before, but every time the answer is to read the help document on ICM.
    What's the correct way for any webdynpro application to point to HTTPS? I don't think de-activating HTTP service is the right way.
    Any suggestions please?
    Thanks in adv.

    Thanks a lot Thomas. I'd ask the Portal Admin to try it out.
    There is another similar problem we are facing: I have embedded Webdynpro in R/3 screen. Then used the cl_gui_wdr_viewer class's load_application method passing HTTPS protocol.
    It returns HTTPS URL only, but is not showing up on users' laptops.
    Earlier we were not passing HTTPS protocol, so generated URL was HTTP, and it was not showing on users' screen (can show in ours). Reason we found out is that users' site has HTTP port blocked. They cannot show any HTTP url.
    So we changed to get HTTPS URL, but that also gives the same problem. It is still trying to get HTTP url.
    Here is the URL that the users got: (when they right click to see the URL generated)
    res://ieframe.dll/dnserrordiagoff_webOC.htm#http://abc.def.jil:8000/sap/public/myssocntl?sap-client=220
    Can give any clues on why this is going wrong? Cannot raise OSS as I know embedding Webdynpro in R/3 is not supported
    Thanks in adv.

Maybe you are looking for

  • Photo Albums in the Media menu for Numbers is a total mess and not usable.

    "Media" photo albums are now unusable in Numbers and Pages. I have 30,000 photos spanning 5 years and Numbers has created an album for every day that I have taken a photo. This is all mixed up with my own albums that I have created. How can I get rid

  • What ribbon cable should I get for my 3rd drive?

    Hi, I just installed my 3rd hard disk drive in my 933MHZ(was 733) QuickSilver G4. I recently emailed a vendor asking: "Hello, I have a Mac 733 Quick Silver computer and I just installed my third hard disk drive. I need a 40 pin 4(for later) drive scs

  • Need a way to display/toggle between data like tabbed Spry

    I want the functionality of the tabbed Spry but I don't want the tabs. I want some links and be able to toggle from link to link displaying info in an area of the page without navigating to another page. Is there a way to do this in Dreamweaver?

  • E-72 upgrade to firmware 71.004 causes no detectio...

    After I upgraded my E-72 to the latest firmware 71.004, my phone is refusing to support any headphones via the top jack connector. Bluetooth headset works fine, but not any other headphones, and I've tried 3. Anytime I plugin one, message is displaye

  • URL of PDF file

    Utilization coagulation of assays for therapeutics"?