locked
Dynamic CRM Form Controls RRS feed

  • Question

  • Hi guys/girls,

    Is there a way to have a button that adds a new set of text areas to an opportunity form.

    For example if I were to click on this "+" button it would then add another row asking for a set of text entries followed by a new "+" and a new "-" button to add/remove a row respectively.

    Any feedback would be appreciated.

    Thursday, September 12, 2013 6:47 PM

Answers

  • Please  observe is that you are actually not operating with multiple products per opportunity. That is just being used as an entry point and you are essentially using one opportunity per product (from para 3 of your message).

    Have a look at this solution and let me know if you have some functionality that isn't met

    1. Add a custom ribbon button on opportunity form.. say 'Add product/ clone oppty'. Train the user to save the opportunity and then add additional products/opptys.

    2. Call a Silverlight or Simple HTML web resource (a grid and a button) that provides the user with the described "+" / "-" to add and delete rows from a grid(Columns:DDL,Rev,Date). Note that the user is only adding or deleting rows from this page and there is no CRM operation at this stage.

    3. Have a button on the same page to 'create opportunities'. On click of this button, create the products first & then associate with a clone of the existing opportunity.

    Understand why you are not using OOB Product but would suggest maintaining products in a separate entity. It will help when the sale progresses and also in reporting. This will also help other users who would like to use the same product. IF you manage products as a text field on each opportunity then you run into the risk of user input errs and might not give you the exact rev estimates.


    If my response helps you in finding your answer then please click 'Mark as Answer' and 'Vote as Helpful'

    • Marked as answer by Bmckie Monday, September 23, 2013 3:43 PM
    Thursday, September 12, 2013 11:17 PM

All replies

  • Hi,

    You can create custom application like Silverlight that will be uploaded on form. In this application we can provide Add and Remove buttons. On click of Add button new row will be added and on click of Remove button the selected row will be deleted.

    Hope this helps!

    Thursday, September 12, 2013 6:52 PM
  • To make sure I understand I would need to make a Silverlight resource in VS.  And this resource can dynamically add text boxes that don't actually exist in the CRM and will work with CRM Online?
    Thursday, September 12, 2013 7:18 PM
  • Out of the box way:

    Create a new entity "E" with text fields for each of the text areas that you need to add.

    Add a 1:N relationship between the opportunity entity and the new entity "E".

    Add a subgrid on the opportunity form to display the related "E" entity records.

    If a new set of Text areas need to be added, the user clicks on add new "E" record from the ribbon which will popup a form to enter this data.

    With code:

    I've done this before by embedding an IFrame with custom javascript to display, edit the related entity records. This will take some amount of effort to implement though.

    Thursday, September 12, 2013 7:27 PM
  • Sorry to be blunt but I don't think it is a good design to add fields to a CRM entity by the user using the entity form. You can programatically create fields in CRM but you will have to deal with UI issues amongst others.

    Why are you looking for such a thing? have you explored other options like

    1. having additional fields in the entity and toggling the visibility

    2. create a custom entity with fields for a row and use the subgrid to have the new/delete functionality


    If my response helps you in finding your answer then please click 'Mark as Answer' and 'Vote as Helpful'

    Thursday, September 12, 2013 7:31 PM
  • We are looking to be able to handle multiple products in an opportunity(Our products are just descriptions due to the nature of how they are constructed and the inability to have a set price per unit). Each of these product lines will have their own ship date and their own estimated revenue.

    This will allow us to report earnings to the fiscal period each part of the order ships out in.  So when the user presses the "+" it will bring up 1. a DDL with product lines, 2. est. revenue and 3. a calendar.

    Once the user saves it will create multiple opportunities all with the same basic information, only difference is that each of the added products will be in its own opportunity.

    I hope I explained this clearly and that its not to confusing.

    Thursday, September 12, 2013 7:40 PM
  • You can use Javascript or JQuery to add the text box dynamically. Basically, you have to find where you will add the text box. I use the following code to add table header in a section. It find the table id then it create a header and append the html I want.

     var html = "<tr><td colspan=4><b>RISK TYPE - LOWER (Lower risk level products do not require approval)</b></td><td colspan=2><b>RISK TYPE - MEDIUM</b></td><td colspan=2><b>RISK TYPE - HIGHER</b></td></tr>";

            var mytable = $('table[id*=754a55b8-8e88-75ea-bc21-c703826cb608]');

            mytable.prepend(document.createElement('thead'));

            $('table[id*=754a55b8-8e88-75ea-bc21-c703826cb608] thead').append(html);

    I hope you get the idea.


    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Thursday, September 12, 2013 8:35 PM
  • Please  observe is that you are actually not operating with multiple products per opportunity. That is just being used as an entry point and you are essentially using one opportunity per product (from para 3 of your message).

    Have a look at this solution and let me know if you have some functionality that isn't met

    1. Add a custom ribbon button on opportunity form.. say 'Add product/ clone oppty'. Train the user to save the opportunity and then add additional products/opptys.

    2. Call a Silverlight or Simple HTML web resource (a grid and a button) that provides the user with the described "+" / "-" to add and delete rows from a grid(Columns:DDL,Rev,Date). Note that the user is only adding or deleting rows from this page and there is no CRM operation at this stage.

    3. Have a button on the same page to 'create opportunities'. On click of this button, create the products first & then associate with a clone of the existing opportunity.

    Understand why you are not using OOB Product but would suggest maintaining products in a separate entity. It will help when the sale progresses and also in reporting. This will also help other users who would like to use the same product. IF you manage products as a text field on each opportunity then you run into the risk of user input errs and might not give you the exact rev estimates.


    If my response helps you in finding your answer then please click 'Mark as Answer' and 'Vote as Helpful'

    • Marked as answer by Bmckie Monday, September 23, 2013 3:43 PM
    Thursday, September 12, 2013 11:17 PM