Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Owner field 'Look for' set default to team

(0) ShareShare
ReportReport
Posted on by 1,077

Hi All,

I have two fields Case Type and Owner.  

Now my requirement is, on selection of case type value i.e.,'Help Desk', the owner field 'Look For' view auto set with Team and value auto set with 'Cloud Support' 

We have added team as 'Cloud Support' with 3 members. By default 'look for' value is user.

How can i achieve this task.

Thanks in advance.

*This post is locked for comments

  • BharatPremji Profile Picture
    BharatPremji 2,485 on at
    RE: Owner field 'Look for' set default to team

    Hi,

    I meant hide the new custom field unless Case type = Help Desk.

    What should happen to the owner field if the Case Type isnt Help Desk, should it default to the logged in user?

    The only reason I would suggest this way is that its fully supported and wont break during upgrades

  • Suresh Sorde Profile Picture
    Suresh Sorde 1,077 on at
    RE: Owner field 'Look for' set default to team

    Thanks Bharat,

    Cant create other custom field. Since if hide owner field for custom field it will auto populate login user as owner. So two fields for owner make data consistency complicated. Please guide if i am wrong.

    Thanks

  • Suresh Sorde Profile Picture
    Suresh Sorde 1,077 on at
    RE: Owner field 'Look for' set default to team

    Thanks Wei,

    Your code worked perfect for me. Thanks a ton for your great help.

    Thanks

  • Suggested answer
    BharatPremji Profile Picture
    BharatPremji 2,485 on at
    RE: Owner field 'Look for' set default to team

    Hi,

    Why not create a new lookup field to Team and using Wei's code set the value in that lookup or simply set the view to a view that contains only that team.  You can then use Business Rules to show/hide the new field on the value of Case Type.

    Then on save of the record populate the Owner field using workflow if your new field has a value.

    Regards

    Bharat

  • Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Owner field 'Look for' set default to team

    Hi,

    as mentioned earlier, that is unsupported code, meaning it has possibilities to break if newest version. Nerveless,

    I had wrote you a solution for you, take a look on above post.

  • Suresh Sorde Profile Picture
    Suresh Sorde 1,077 on at
    RE: Owner field 'Look for' set default to team

    HI Wei,

    I follow your last post reference. Its giving me Error -Object doesn't support property or method 'setLookupTypes'.

    Not able to change Look For of lookup.

    Thanks

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Owner field 'Look for' set default to team

    Hi,

    I missed your second part , set the owner.

    You can use below code to do it, you have to modify a bit.

    function setOwner()
    {
    var optionset = Xrm.Page.getAttribute("new_optionset").getValue(); // your condition field

    if ( optionset == 100000001) // condition field value
    {
    var lookupValue = new Array();

    lookupValue[0] = new Object();

    lookupValue[0].id = "92EC3861-8D59-E811-815C-080027878DE4"; //team id

    lookupValue[0].name = "Custom Team"; //team name

    lookupValue[0].entityType = "team";  

    Xrm.Page.getAttribute("ownerid").setValue(lookupValue);
    }

    else

    {

      // what you going to do

    }
    }

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Owner field 'Look for' set default to team

    Hi,

    you can use Javascript to set the owner to team

    community.dynamics.com/.../how-to-get-and-set-a-lookup-field-using-javascript-in-dynamics-365

    replace the recordid, recordname and entityname into correct value.

    Xrm.Page

  • Suresh Sorde Profile Picture
    Suresh Sorde 1,077 on at
    RE: Owner field 'Look for' set default to team

    Thanks mydeveexperience,

    yes, that's what i want.

    Thanks

  • abm abm Profile Picture
    abm abm 31 Most Valuable Professional on at
    RE: Owner field 'Look for' set default to team

    Hi,

    Do you want to auto set to owner of the record team 'Cloud Support' if case type is 'Help Desk'?  Please let me know.

    Thanks

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,309 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans