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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Contacts -> Javascript to restrict to display only one view for Owner lookup field

(0) ShareShare
ReportReport
Posted on by 160

Hi All,

My Business case is, user should be able to manually assign a team as an owner for a contact record, if they are part of more than 1 team. As it's always team will be a owner and they should view only the team they are part of, I am expecting below behavior.

When an user clicks on the "Owner" lookup field, the entity should be locked to "Teams" and the view should only be "My Teams".

I guess, this can only be done through javascript and as I am not developer myself, can anyone share a generic javascript (if already available), so that I can manipulate it and make it work?

Thanks,

Praveen.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    I think the easiest (no code) way would be this-

    1. Create a new custom field "Owner (Team)" which would be a look up to Team entity. Make it mandatory

    2. Hide the OOB "Owner" field.

    3. Create a Business Rule which populated the values from "Owner (Team)" to "Owner" field always.

    4. You may also need to hide the "Assign command" if it is available to user as this can also change the owner.

    Hope this helps.

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

    Update

    Instead of Business Rule, you need to use real time workflow to assign the record to the team. In Business Rule, the field doesn't appear to set on owner field.

    Hope this helps.

  • Praveen Kumar Ellappa Profile Picture
    160 on at

    Hi Ravi,

    Thanks for you answer. Let me implement your recommendation and see how our team responds to it.

    Regards,

    Praveen.

  • Praveen Kumar Ellappa Profile Picture
    160 on at

    Ravi,

    Should we hide the Assign command using XRM toolbox?

  • Verified answer
    Arun Vinoth Profile Picture
    11,615 Moderator on at

    You can try any one of the options Guido recommending in this thread: community.dynamics.com/.../180992

    Other choices discussed here: community.dynamics.com/.../157459

  • Praveen Kumar Ellappa Profile Picture
    160 on at

    Arun,

    I am going for option 3. Is there a way to restrict users to view and select only the teams they are part of; i.e. only My Teams view should be there?

    Regards,

    Praveen.

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

    Hi Praveen Kumar Ellappa,

    After creating the lookup field to the team entity, you can modify the field properties so that the default view on the lookup field is set to "My Teams" and the view selector is set to off.

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

    Hi Praveen,

    You need to use Ribbon Workbench to hide the assign button.

    You can refer this thread fro the steps. Do not that you do not uncustomize after hideing it (as mentioned in the answer).

    community.dynamics.com/.../186299

    Hope this helps.

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

    Hi Preveen,

    For restricting the view to My Team view only, you can change the field properties. Refer screenshot below-

    team2.png

    team2.png

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans