fake-xrm-easy
fake-xrm-easy copied to clipboard
Disable Systemuser with SetStateRequest but empty IsDisabled field?
I tried to test my controller, which is using the SetStateRequest to disable a user. But using this request, the field "isdisabled" won't be set in the faked context.
var request = new SetStateRequest { EntityMoniker = userReference,
//Sets the user to enabled.
State = new OptionSetValue(1),
// Required by request but always valued at -1 in this context.
Status = new OptionSetValue(-1)
};
Is there a way to set this field, without modifying the controller itself?
Hi @michaelmittermair , do you mean the "isdisabled" is a property of the systemuser entity that does not get updated after calling that SetStateRequest message?
Hi,
yes thats correct. I disabled a user in my testenvironment and loaded the properties. There the readonly-property "isdisabled" is set for the user:
Using the faked service, that property doesn't exists:
Great, thx for your feedback
I guess, mainy because SetStateRequest is just a wrapper for the update message, we could look at introducing like a proxy class that would add specific fields based on the create / update message, based on the entity your're updating, the DefaultEntityIntitializer might be a candidate for that. This could be probably part of #149