Announcements
No record found.
hi,
I have added the business rule to change the default value of owner field on load. But it is always default to logged in user. So how can i update the default value of owner field.
*This post is locked for comments
Hi Dynamics User,
Can you please post your Business Rule? I would not implement this functionality with a Business Rule, so I am interested to see what you have created.
Setting the owner of a record is actually more complicated than just changing a field name. Behind the scenes, the system will attempt to assign the record to another User or Team. It is important to consider that if the User assigning the record does not have permission to assign the record to the target User or Team, then this will result in an error. Due to the complexity of this task, my recommendation is to implement this functionality with a Plugin or JavaScript instead of a Business Rule.
IF
Owner does not contain data
THEN
Set default value of Owner to "test user"
Can you let me know how to do the same with javascript
You can use the following function:
function setLookupField(fieldName, lookupId, lookupName, entityName) {
var lookupData = new Array();
var lookupItem = new Object();
lookupItem.id = lookupId;
lookupItem.name = lookupName;
lookupItem.entityType = entityName;
lookupData[0] = lookupItem;
Xrm.Page.getAttribute(fieldName).setValue(lookupData);
}
call it like this:
setLookupField("ownerid", {GUID_OF_USER}, "Test User", "systemuser");
Hope this helps.
Your Business Rule is not working because of its condition. This Business Rule will only hit the action when the Owner does not contain any data, but this will not occur because a record has to have an owner when it is created, and it can never have no owner.
Hey Dynamics User,
Use this condition in the business rule.
ThanksNitin Res
Hi Nitin Res,
While your Business Solution is an improvement on Dynamics User's Business Rule, I do not think it is what Dynamics User is after.
Correct me if I am wrong, but my understanding is that:
Changing the ownership of a record to the logged in user will require the logged in user to reassign the ownership of records to themselves. This can cause problems if the logged in user does not have permissions to do this. From a design standpoint, I do not think automatically assigning the ownership of a record to a user whenever they open a record is a good idea. This can be built, but I think it will lead to many issues in the system.
My requirement is when I am opening the new form let say lead the owner field is set as default . The default value is logged in user. My requirement is to set default value to some other user let say testuser1 instead of default user.
In that case, you can use the Business Rule Nitin Res developed, but you can remove the status check from it.
Hi,
I agree with Adrian & Nitin. You can simply check if the owner field is equal to your <Default User>; if not then set your default user as owner.
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.