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)

Dynamic layout for creating custom views from fetch xml .

(0) ShareShare
ReportReport
Posted on by 383

Hi. i have a requirement for creating a custom views from fetch xml using plug-in. I am having a problem to creating a dynamic layout for view,  . please guide me here. Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Preeti Sharma Profile Picture
    2,678 on at

    Hi,

    Please check below links:

    1. www.c-sharpcorner.com/.../how-to-create-custom-lookup-view-in-crm2

    2. community.dynamics.com/.../203026

    Hope this helps:)

  • Verified answer
    Radu Chiribelea Profile Picture
    6,667 on at

    Hello,

    If you want to create a view from a Plug-in you need to follow this logic

    1. Create a new Entity of type savedquery new Entity("savedquery"); and set below attributes (For a list of all the attributes related to the saved query see https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/savedquery?view=dynamics-ce-odata-9)
    2. Define the layoutxml - for this you will need to know the Entity type code for the view you are creating. this looks something like this "<grid name='resultset' object='{EntityOTC}' jump='rc_name' select='1' icon='1' preview='1'>"
    3. define the fetchxml-> for this you can use the Advanced Find to generate it
    4. Define name, returnedtypecode and querytype
    5. Create the entity by calling service.Create
    6. Publish the view by calling PublishXmlRequest 

    Hope this helps,

    Radu

  • ZeroHar Profile Picture
    383 on at

    Thanks for the help. If you don't mind, can you share any sample code if you have .

  • ZeroHar Profile Picture
    383 on at

    Finally i'm able to create view in crm but, there is nothing displayed on that view. crm showing this error  "To use this saved view, you must remove criteria and columns that refer to deleted or non-searchable items. If you contact support, please provide the technical details."  .   please help me , thanks .

  • Suggested answer
    Radu Chiribelea Profile Picture
    6,667 on at

    Hi Zero,

    If you create and advanced find with the same columns in the layout xml and the same filter criteria in the fetchxml do you get the same error?

    Can you check for the columns that you have in the layout / fetch if the corresponding attributes are set to IsSearchable = yes?

    See blog.clickdimensions.com/how-to-make-fields-searchable-in-microsoft-crm

    Regards,

    Radu

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