Results 1 to 5 of 5
  1. #1

    sharepoint file uploded from code not appearing with CRM record ?

    i m uploading file to sharepoint from code and then creating SharePointDocumentLocation
    record to attach document with Crm record.

    I can see file uploaded to shrepoint under this folder (example):
    So I see file if I navigate to:
    For this part first I m saving entity record, then upload document to sharepoint and in last creating SharePointDocumentLocation.

    Problem is when I go to CRM record > documents I dont see document there

    I even have tried to upload a document manually form crm but getting error

  2. #2

    sharepoint file uploded from code not appearing with CRM record ?

    Hi Maoun,
    You need to create the SharePointDocumentLocation and related it to the account record before your upload the document.
    After you do that, you will need to upload the document to the absolute url of the folder your created.
    For example:
    You created an account record called Contoso, Inc.
    You create a Document folder called contoso
    Your upload your document to
    I would also verify first that when you create the document folder, you are able to upload directly from the CRM interface and that you can access those files.
    Hope this helps.


  3. #3
    Junior Member
    Join Date
    Mar 2016

    sharepoint file uploded from code not appearing with CRM record ?

    Thanks Aric,
    I will try this now. Just a question is there an issue of security as well ? I was thinking may be my CRM do not have rights to see files, something like who own crm record and who owns sharepoint file ? Will be back and share how it was.

  4. #4

    sharepoint file uploded from code not appearing with CRM record ?

    SharePoint security is separate from CRM Security.
    I don't know if your organization has implemented certain restrictions in SharePoint which would prevent CRM Users (AD/Office 365) from seeing SharePoint documents.

  5. #5
    Join Date
    May 2015
    Thanks Aric,
    Tested from CRM was able to upload and access. So that part is good.
    I was able to upload from code and verify file in browser under this folder with url something like:
    But file did not appear in CRM again. I tried editing location from CRM and come to know CRM is checking below location:
    Missing Parent folder after site. Probably I m not creating SharepointDocumentLocation correctly.
    Here is my code:
    SharePointDocumentLocation doc = new SharePointDocumentLocation();

    doc.RegardingObjectId = new EntityReference(canas.EntityLogicalName, new Guid(recordGuid));

    doc.Name = recordGuid;

    doc.RelativeUrl= folderName; //Test%20name%203%20-%20Monthly%20Order%20-%202017_07e2fb8d-3237-e811-8181-e0071b66a1e1

    doc.ParentSiteOrLocation = new EntityReference(SharePointSite.EntityLogicalName, siteId);

    IOrganizationService org = GetOrganizationService(ref log);


    Can you please guide how I can give missing parent folder path here so CRM may be pointing to correct place ? I tried:
    doc.RelativeUrl="canas/" + folderName;

    but getting error:
    {"The relative url contains invalid characters. Please use a different name. Valid relative url names cannot ends with the following strings: .aspx, .ashx, .asmx, .svc , cannot begin or end with a dot, cannot contain consecutive dots and cannot contain any of the following characters: ~ \" # % & * : < > ? / \\ { | }."}

    Please guide how I can give entity folder name in SharePointDocumentLocation creation or if something else looks wrong.
    thanks Aric

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts