Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

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>

*This post is locked for comments

  • David Jennaway Profile Picture
    David Jennaway 14,063 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,085 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,085 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,085 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans