Forums

Forums / Developing Portals / Sharepoint document upload without existing CRM record

Sharepoint document upload without existing CRM record

18 posts, 1 answered
  1. Mike Cohen
    Mike Cohen avatar
    31 posts
    Registered:
    10 Aug 2021
    19 Apr 2022
    Link to this post
    Hello, 

    Is it possible to have a form create a new CRM record including uploading content to a new sharepoint doc location for this record using the "add file widget". 

    We have a form where a user fills out data and also uploads photos as a part of their submission.  The corresponding CRM record does not exist prior to their submission. 

    The file upload works for new records if we use the notes field for file uploads, but it does not work with sharepoint.   Sharepoint will work if there is a site in place.

    Not sure if this is possible or not to have sharepoint content uploaded at the same time the host record is created. 

  2. Brady Ward
    Brady Ward avatar
    92 posts
    Registered:
    19 Aug 2021
    20 Apr 2022 in reply to Mike Cohen
    Link to this post
    Hello Mike,

    I don't think this would be possible. Your workaround using the file, notes or even image widget is likely one of the few ways to accomplish this.

    The upload to Sharepoint would have to occur after the record is created.

    Hope that helps,

    Brady
    TPC Web Developer
  3. Eric Mann
    Eric Mann avatar
    59 posts
    Registered:
    16 Oct 2020
    21 Apr 2022
    Link to this post
    Another option may be Form Flow - user adds some info in Step 1, clicks next which creates record in Dynamics then Step 2 is add photo in SharePoint widget. Keeps user on same page with just a button click to Next step. 
  4. Brady Ward
    Brady Ward avatar
    92 posts
    Registered:
    19 Aug 2021
    21 Apr 2022 in reply to Eric Mann
    Link to this post
    I was also thinking you could set it up as a 2-step process.

    If you don't have form flow, you could use the TPC Submit Button to forward the newly created record ID to another page that only has the Sharepoint grid.

    Thanks for the suggestion Eric,

    Brady
    TPC Web Developer
  5. Dan Rausch
    Dan Rausch avatar
    11 posts
    Registered:
    20 Aug 2021
    21 Apr 2022
    Link to this post
    We are using the File Upload widget with SharePoint and it works when adding new records (i.e. we are able to create a new record and add documents with the same submit).  We are on TPC v6.0.7629.145 with D365 online and SharePoint online.
  6. Mike Cohen
    Mike Cohen avatar
    31 posts
    Registered:
    10 Aug 2021
    21 Apr 2022
    Link to this post
    I guess I'm not sure how to interpret the posts here  since the answers I'm seeing are conflicting. 

    If Dan is in fact doing this then it sounds like it IS possible. The only difference is that we use CRM on premise and sharepoint online instead of both online.  

    I'm not able to get it working, but I'm not sure how to proceed.Is there a logfile or debug steps that I can perform to try and determine if what I want to do is not possible, or just a config error on my end? 

    The account we are using definitely has sharepoint access.  
    We have CRM on premise and sharepoint in cloud.  and are on version 6.1 of TPC. 
  7. Brady Ward
    Brady Ward avatar
    92 posts
    Registered:
    19 Aug 2021
    26 Apr 2022 in reply to Mike Cohen
    Link to this post
    Hey Mike,

    Sorry for the late reply. I'd like to try and test this a bit and get back to you. I'll try it in a few different builds and versions of TPC and let you know the results.

    In the meantime, can you confirm what build of TPC you're on?

    All the best,

    Brady
    TPC Web Developer
  8. Mike Cohen
    Mike Cohen avatar
    31 posts
    Registered:
    10 Aug 2021
    26 Apr 2022 in reply to Brady Ward
    Link to this post
    Hi Brady , 
    we are using  TPC v6.1.7629.107

    -Mike
  9. Brady Ward
    Brady Ward avatar
    92 posts
    Registered:
    19 Aug 2021
    02 May 2022 in reply to Mike Cohen
    Link to this post
    Hey Mike,

    Sorry for not following up sooner.

    So far I haven't been able to successfully upload a file with an entity on creation in any version/build of TPC. Any time I upload a file with the creation of the entity it breaks the Sharepoint URL (the submission never fully completes and hangs on a killed thread process). My suspicion is that it's not possible out of the box currently.

    What I've been trying to do as a workaround is disable the file upload widget on pre-submit. Then in post-submit, grab the ID of the created entity, append that to the search query, re-enable the widget and submit the form again using JavaScript. Not the cleanest way but somewhat of a workaround vs. the 2 step form.

    I'll keep you updated with my progress/testing,

    Brady
    TPC Web Developer
  10. Brady Ward
    Brady Ward avatar
    92 posts
    Registered:
    19 Aug 2021
    04 May 2022 in reply to Mike Cohen
    Link to this post
    Hey Mike,

    So my issue ended up being an incorrectly configured SharePoint connection. Creating a record and using the file upload widget at the same time does actually work as Dan noted above. Once I resolved my connection issues, I was able to do it successfully as well.

    Let me know if you're running into any issues,

    Brady
    TPC Web Developer
  11. Eric Mann
    Eric Mann avatar
    59 posts
    Registered:
    16 Oct 2020
    24 May 2022 in reply to Brady Ward
    Link to this post
    Brady - you mention a SP Configuration that needed adjusting. Can you share what that was as my testing shoes that SP doesn't allow before Record Create. 
  12. Brady Ward
    Brady Ward avatar
    92 posts
    Registered:
    19 Aug 2021
    24 May 2022 in reply to Eric Mann
    Link to this post
    Hey Eric,

    My issue was the connection not being setup properly. I just needed to fix my settings to get the connection established. Are you seeing any files uploading to SharePoint at all?

    All the best,

    Brady
    TPC Web Developer
  13. Eric Mann
    Eric Mann avatar
    59 posts
    Registered:
    16 Oct 2020
    24 May 2022 in reply to Brady Ward
    Link to this post
    Yes, we have several Use Cases throughout our Portal where we have SharePoint working with the TPC SharePoint widget. I can even get the widget to work where I want after creation but not using same form at creation off of a Subgrid, the widget just doesn't show. 
  14. Brady Ward
    Brady Ward avatar
    92 posts
    Registered:
    19 Aug 2021
    24 May 2022 in reply to Eric Mann
    Link to this post
    Which widget doesn't show for you? The file upload widget?

    All the best,

    Brady
    TPC Web Developer
  15. Eric Mann
    Eric Mann avatar
    59 posts
    Registered:
    16 Oct 2020
    24 May 2022 in reply to Brady Ward
    Link to this post
    The SharePoint widget
  16. Brady Ward
    Brady Ward avatar
    92 posts
    Registered:
    19 Aug 2021
    24 May 2022 in reply to Eric Mann
    Link to this post
    Ahh, gotcha. I believe we've got some mis-communication here then! The way Dan and I were able to upload on create to SharePoint was using the file upload widget. There are settings you can adjust to upload to notes or to upload directly to SharePoint.

    Using the actual SharePoint widget, there's no way to accomplish this out of box. If you setup a separate "create" form that uses the file upload widget instead of the SharePoint grid, you should be able to accomplish uploading on create.

    All the best,

    Brady
    TPC Web Developer
  17. Eric Mann
    Eric Mann avatar
    59 posts
    Registered:
    16 Oct 2020
    Answered
    24 May 2022 in reply to Brady Ward
    Link to this post
    Yup that worked like a charm. 
  18. Mike Cohen
    Mike Cohen avatar
    31 posts
    Registered:
    10 Aug 2021
    22 Sep 2022
    Link to this post
    I'm still not able to get this working.  

    The only time the File upload widget works to sharepoint is if there is an existing record + AND that record already has a sharepoint repo created in dynamics.

    I've tried breaking the form up into form flow with the first form to create the CRM record and the second form is the upload of the document using the file upload widget to sharepoint, but this doesn't work if there is no exising sharepoint repo in dynamics first. 

    So I have to go into the record in CRM, click on "documents" so that it dynamically creates a new sharepoint space, and once this is done I can use the file upload widget to upload a file.  If this is not done first, the portal site just does nothing. 

    I know my sharepoint settings are good since I can add documents via the widget if the CRM record already has an existing sharepoint document space. 

    What diagnostics can I perform to troubleshoot this further. 

    Can the file upload widget upload a document to sharepoint if the document space in CRM hasn't been formally opened yet?  It sounds like people have this working, but I'm not able to get it and I'm not sure what to troubleshoot next?
18 posts, 1 answered