locked
Can CRM Online Sandbox plug in use LINQ to select and update against the organisation context RRS feed

  • Question

  • Hi

    Can CRM Online Sandbox plug in use LINQ to select and update against the oranisation context or does the Sandbox mode prevent LINQ been used in the plug in

    Thanks

    Sunday, May 17, 2015 1:46 PM

Answers

  • There is no limitations on Sandbox to use LINQ. BTW: basic sandbox limitations:

    no access to local  system resources (files, DLL...) HTTP, or HTTPS request only and time limits on asynchronous  plugins. 

    So you can easily develop and debug plugins in Non-Isolation mode and deploy in sandbox.

    Here you have an example to use LINQ:
    https://msdn.microsoft.com/en-us/library/gg334504.aspx

    and how to update multiple  records:

    List<Contact> contacts = context.ContactSet.Where(c => c.FirstName == "Pamela").ToList();
    
    forach (Contact c in contacts)
    {
        c.new_value = "Some text";
      
        if (!context.IsAttached(c))
            context.Attach(c);
        context.UpdateObject(c);
        context.SaveChanges();
    }
    
    • Proposed as answer by Chris_Harrington Monday, May 18, 2015 12:56 PM
    • Marked as answer by Tims123 Thursday, March 31, 2016 11:30 AM
    Sunday, May 17, 2015 4:41 PM