Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Fetch XML to get Sharepointdocument location File Name

(0) ShareShare
ReportReport
Posted on by 477
    
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>

*This post is locked for comments

  • David Jennaway Profile Picture
    14,065 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
    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
    50,089 Moderator 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
    477 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
    50,089 Moderator 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
    477 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
    50,089 Moderator 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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,095 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans