Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Processing Images in a Sandbox plugin

Posted on by

Hello,

I am trying to compress a jpg picture in a plugin reading the data from the DocumentBody of an annotation , I tried different libraries and methods but I still get the same error  : 

The specified domain does not exist or cannot be contacted

An unexpected error occurred from ISV code.

This is very likely due to sandbox limitations, I think the main problems is with the library system.drawing.

Has anybody ever archived this?

Should I look to different approaches: web service or a night job?

Thanks 

Simone

*This post is locked for comments

  • Suggested answer
    Aiden Kaskela Profile Picture
    Aiden Kaskela 19,692 on at
    RE: Processing Images in a Sandbox plugin

    Hi,

    An easy way to test if it's the trust level is to run the exact same code in a test app that's connecting to CRM. If that works, it's a strong indicator you need elevated trust to run it and you should look at alternate approaches - which approach depends on your needs.

    If you need to have these images compressed in near real-time, you should build a web service. On post-update, if the document body is set from null then call out to your service and pass in the ID of the note to update. Make sure to check what the old value was because otherwise you'll get into an infinite loop since the web service will be updating the record.

    If it's not time sensitive then you can have a windows service run nightly to update the records. A problem you'll have with this approach is that you'll need to track which ones have already been updated or not. You can't add a field to the annotation so you'll have to store it offline somewhere (or create a dummy entity in CRM that has a field for "annotationid" and if that exists then you've already processed it but that'll be a ton of overhead).

    The easiest approach would be with the web service.

    Hope this helps! I'd appreciate if you'd mark this as Answering your question.

    Thanks,

     Aiden

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans