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)

Create Dynamic list with part numbers and details?

(0) ShareShare
ReportReport
Posted on by 445

Hi,


I need to create dynamic lists like below.

I need a plus sign to add multiple values in the CRM custom form. Is it possible?

Parts will be a lookup field.

Model and item description will be automatically populated based on the chosen part.

If the user clicks the plus sign, he should get a new field to add another parts details.

4762.Capture1.JPG

How to achieve this?

Thanks

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    You will have to create a html webresource and add it to the a form to achieve this.

  • Elangamban Profile Picture
    445 on at

    Hi Vikas,

    Thanks for the reply.

    I'm not familiar with the webresource topic.

    Is there any step by step guide avaliable for similar scenarios.

  • Suggested answer
    Community Member Profile Picture
    on at

    Below is the link which will help you build a simple html web resource.

    crmbook.powerobjects.com/.../html-web-resources

    After that you will have to use oData to retrieve/save/update the data in CRM using JavaScript.

  • Elangamban Profile Picture
    445 on at

    Hi,

       I've found one script in online.

    <html>
    <head>
        <script type='text/javascript'>
            function addFields(){
                // Number of inputs to create
                var number = document.getElementById("member").value;
                // Container <div> where dynamic content will be placed
                var container = document.getElementById("container");
                // Clear previous contents of the container
                while (container.hasChildNodes()) {
                    container.removeChild(container.lastChild);
                }
                
                for (i=0;i<number;i++){
                    // Append a node with a random text
                    container.appendChild(document.createTextNode("Member " + (i+1)));
                    // Create an <input> element, set its type and name attributes
                    var input = document.createElement("input");
                    input.type = "text";
                    input.name = "member" + i;
                    container.appendChild(input);
                    // Append a line break
                    container.appendChild(document.createElement("br"));
                
                }
            }
        </script>
    </head
    <body>
        <input type="text" id="member" name="member" value="">Number of members: (max. 10)<br />
        <input type="Button" id="filldetails" value ="Click" onclick="addFields()">
        <div id="container"/>
    </body>
    </html>

    This code is working fine.

    It will display one text box to enter how many textboxes to create.

    6840.Capture2.JPG

    How to display a lookup field from my entity instead of a text field?

    Say my lookup field name is "new_lookup"

    Thanks!!!

  • Suggested answer
    Community Member Profile Picture
    on at

    You will have to create dropdown fields and not text fields. Get the records by oData and fill it. Use name for dropdown option display and GUID of the member record for the dropdown option value.

  • Elangamban Profile Picture
    445 on at

    Hi Vikas,

      My requirement is to put a lookup field there.

    I've created a separate entity for storing the parts (which will act as a master data). By using a Lookup field, the user can search for the part, if not there he can add new parts, which will be updated in the master data.

  • Inogic Profile Picture
    709 on at

    You will achieve this by using below steps.

    A. Add a custom Html Page Web-resource in CRM.

    B. Then you need to add the Html Dropdown control which is used to bind the Parts

        entity records.

    C. For Dropdown there are two properties Text and Value So, you need to set Text =

         Name of Parts Record and Value = GUID of Parts record.

    D. So, now when you select the particular Parts record and click on “+” or Add  button

         then you can easily retrieve the related information of the selected Parts entity

         record using the GUID (i.e. dropdown field value) and show its details in the

         table/Grid.

    HTH

    Sam

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