Read CRM 2013 system settings from Plugin code

820 Views Asked by At

I wonder if there is any possibility to read (not write!) the system settings from a plugin in Microsoft Dynamics CRM 2013. It can be easily done for the user settings but I couldn't find any way to do the same thing with system settings too. I would need to read the "blocked file extensions for attachments" setting.

1

There are 1 best solutions below

0
thuld On

You can load settings via the entity "organization", the following code will read the value of the Discount Calculation Method property:

 var query = new QueryExpression("organization");
 query.ColumnSet.AddColumn("discountcalculationmethod");

 var org = this.orgservice.RetrieveMultiple(query).Entities.First();


 Assert.IsNotNull(org["discountcalculationmethod"]);