web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Changing the default value of owner fields.

(0) ShareShare
ReportReport
Posted on by 587

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

I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    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.

  • SamiraM Profile Picture
    587 on at

    IF

    Owner does not contain data

    THEN

    Set default value of Owner to "test user"

  • SamiraM Profile Picture
    587 on at

    Can you let me know how to do the same with javascript

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    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.

  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi Dynamics User,

    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.

    • To assign a record to a user or team with JavaScript read this article and this article.
    • To assign a record to a new owner with C# look at this example.
    • To assign a record to a team with C# look at this example.
  • Suggested answer
    ntn32 Profile Picture
    401 on at

    Hey Dynamics User,

    Use this condition in the business rule.

    8831.d365.PNG

    Thanks
    Nitin Res

  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    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:

    • Dynamics User wants to set the owner of a record to the logged in user whenever the logged in User opens a record. This means that Dynamics User does not always want to set the record owner to "test user".
    • Dynamics User has developed a Business Rule that is not working as intended.
    • Dynamics User does not require a status check.

    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.

  • SamiraM Profile Picture
    587 on at

    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.

  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi Dynamics User,

    In that case, you can use the Business Rule Nitin Res developed, but you can remove the status check from it.

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    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.

    Hope this helps.

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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans