Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

Fetch XML to get Sharepointdocument location File Name

Posted on by 475
    
Hello,
Iam trying to get File Name of attachment which i added in Sharepointdocumentlocation but when i use name attribute iam getting location name instead of attached file name . May i know how to get filename and which attribute need to use ?
<link-entity name="sharepointdocumentlocation"from="regardingobjectid" link-type="outer"to="new_caseworkdocumentid" alias="ap" >

                <attribute name="sharepointdocumentlocationid" />

                <attribute name="name" />

                <filter type="and" >

                    <condition attribute="statecode" operator="eq"value="0" />

                </filter>

            </link-entity>

  • David Jennaway Profile Picture
    David Jennaway 14,061 on at
    RE: Fetch XML to get Sharepointdocument location File Name

    Just to clarify, CRM only stores the SharePoint location (i.e. the folder). It does not store any information about the files that are stored in that location (the information about the files is stored solely in SharePoint)

  • Suggested answer
    Justinjose Profile Picture
    Justinjose 2,707 on at
    RE: Fetch XML to get Sharepointdocument location File Name

    Hi krishna prasad,

    As far as I know, Sharepoint file name is not stored in CRM.

    Thanks

    Justin Jose

  • gdas Profile Picture
    gdas 50,083 on at
    RE: Fetch XML to get Sharepointdocument location File Name

    Hi Krishhna,

    No in SharepointDocumentLocation  there is no such FileName attributes as I shared you already MSDN reference .

    Please do some alternate way which I have already suggested , it will definitely work for you .

    Otherwise you can wait for someone to reply on this .

  • dkrishna Profile Picture
    dkrishna 475 on at
    RE: Fetch XML to get Sharepointdocument location File Name

    Iam using SharepointDocumentLocation entity and i didnt find any field which has attachment Name in it .

  • Suggested answer
    gdas Profile Picture
    gdas 50,083 on at
    RE: Fetch XML to get Sharepointdocument location File Name

    This is another entity in the screenshot you shared called sharepointdocument , could you please check this entity once . I have some doubt as this is for only associated view , not sure you may try.

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
      <entity name="sharepointdocument">
        <attribute name="documentid" />
        <attribute name="fullname" />
        <attribute name="relativelocation" />
        <attribute name="sharepointcreatedon" />
        <attribute name="filetype" />
        <attribute name="modified" />
        <attribute name="sharepointmodifiedby" />
        <attribute name="title" />
        <attribute name="author" />
        <attribute name="sharepointdocumentid" />
        <attribute name="readurl" />
        <attribute name="editurl" />
        <attribute name="ischeckedout" />
        <attribute name="absoluteurl" />
        <attribute name="locationid" />
        <attribute name="iconclassname" />
        <order attribute="relativelocation" descending="false" />
      </entity>
    </fetch>


  • dkrishna Profile Picture
    dkrishna 475 on at
    RE: Fetch XML to get Sharepointdocument location File Name

    sharepoint31.jpg

    How come FileName is showing in Sharepoint locations ? What would be binding fields for Name Column here ?

  • Suggested answer
    gdas Profile Picture
    gdas 50,083 on at
    RE: Fetch XML to get Sharepointdocument location File Name

    Hello Krishna,

    Hi Krishna did you tried with retrieving  absoluteurl or relativeurl? Seems you need to extract the file name splitting from the  absolute URL /Name /relativeurl.

    Name attributes contains Name of the SharePoint document location record and not exactly  file name . Seems there no attributes contains in entity  sharepointdocumentlocation which stored only  file name .

    Please refer below msdn reference.

    msdn.microsoft.com/.../mt622442.aspx

    docs.microsoft.com/.../sharepointdocumentlocation

    Hope this helps.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,246 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,041 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans