Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Sandboxed CRM Plugin File Handling

Posted on by 10

Hello All

I have a plugin that creates an XML file based on some fetchxml results. However since this is a plugin for CRM Online, it is sandboxed and obviously I am getting an error when I attempt a save on local drive through the code. One of the options I have come to know is to write a web service that consumes the InnerXML and creates a file in the server. Is there any other neat way to do this which is less prone to a number of points of failure? 

string _fetchXmlOutput = _xml.OuterXml;
StringReader _xmlst = new StringReader(_fetchXmlOutput);
XmlDocument _xDoc = new XmlDocument();
_xDoc.LoadXml(_fetchXmlOutput.ToString());
_xDoc.Save(@"C:\outputxml\" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xml"); //--To be replaced.



Cheers,

Kush

*This post is locked for comments

  • Suggested answer
    Andre Margono Profile Picture
    Andre Margono 2,602 on at
    RE: Sandboxed CRM Plugin File Handling

    AFAIK nope, CRM Online sandboxed plugin won't give you any access to save to server.

    I can only think of 2 options here:

    1. Save it as an attachment to a record in CRM

    2. Go with external API

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans