Aug 21, 2024

A big loophole in field level security !

We all use field level security as a trustworthy way of hiding selected fields from an entity where user could have the access rights for remaining fields. 

Typical scenario could be, Contact entity is a very generic type yet you could have sensitive details such as salary, bank details or marital status etc. Here field level security come in handy since you can hide only those fields for selected users.

Loophole

Well..keep in mind if users are allowed to check audit history of the record, irrespective of field level security setting, user will see all the audit details of all the fields those are enabled for auditing. This is not ideal isn't it?  :-( 

Jun 4, 2024

Hide New Look switch

Dataverse header shows a button to switch to New look as below.


Sometimes organizations would decide to hide this button due to various reasons. Basically, some users who tried this will get the new experience but organization may not be ready yet. For example, guides/ manually may not resemble this new look.

Last time when this was requested, we managed to hide the switch as per steps explained in below article. https://www.powercommunity.com/disabling-try-the-new-look-switch-in-power-apps/

Anyway, its different now and much easier. Follow below steps;

1. Browse to https://admin.powerplatform.microsoft.com/environments and select correct Environment

2. Then click Apps and select the correct App and click edit 

3. Then Click Settings in the top 

4. Click the Features

5. Go to Try the new look button and switch it off.

May 17, 2024

Execute Multiple

In some cases we need to repeat the same operation. It may be creating a collection of records or updating a collection or records. We are good to do those via available CRUD operations of the Organization Service.

However if we do a collection within a loop, we should understand we repeat the same operation that result number of server calls which is not sufficient. Particularly, if you need to do this within a synchronous process it important to complete quickly rather keeping the user waiting.

In such situations, we would do execute multiple operations. Lets check the code snippet.

var executeMultipleRequest = new ExecuteMultipleRequest
{
    Settings = new ExecuteMultipleSettings { ContinueOnError = true, ReturnResponses = false },
    Requests = new OrganizationRequestCollection()
};

for (int i = 0; i < 5; i++)
{
    var paymentevaluation = new Entity("contact")
    {
        ["firstname"] = $"Test First Name {i}",
        ["lastname"] = $"Test Last Name {i}",
    };

    executeMultipleRequest.Requests.Add(new CreateRequest { Target = paymentevaluation });
}

var data = (ExecuteMultipleResponse)service.Execute(executeMultipleRequest);

foreach (var response in data.Responses)
{
    Console.WriteLine($"{response.RequestIndex}: {response.Fault}..");
}
Notice that we add all the entities to be created and execute once in this code. This is significantly faster than going through a loop.
Notes
> Keep in mind, maximum number of requests can be added to a execution is 1000.
> This also had a limitation of 2 concurrent operations, but now its removed.

May 11, 2024

ConditionOperator "Contains" doesnt work

When retrieving data using RetrieveMultiple we use different condition operators apart from Equal which is the most used one. 

Anyway, I noticed Contains operator is not working. For example below code, though looks alright, will not work. Its disappoint error message is not helpful either.

   
var query = new QueryExpression("account")
{
    ColumnSet = new ColumnSet("accountid", "name"),
    Criteria = new FilterExpression(LogicalOperator.And),
    TopCount = 10
};
query.Criteria.AddCondition("so_groupname", ConditionOperator.Contains, "expolanka");
Solution is to you like key work instead of Contains which does the same. Anyway, one thing to keep in mind is you need to use % mark for the task your check for. Check below;
   
query.Criteria.AddCondition("so_groupname", ConditionOperator.Like, "%expolanka%");