Wednesday 24 February 2016

Create A Custom DialogBox In CRM 2015/2016 Online

Hi All,

Today i am back with my new custom requirement in CRM 2015/2016 where i was required to
developer a custom Dialog Box, where we were required to get a different type of input from 
the user and that input need to used in the java script for the futher logic.

This is the sample Image of Custom Dialog Box which we develop using HTML.

To Full fill this requirement we need to follow some steps which are -:                                                                                                     
                                                     
Step 1 . First you need to develop the dialog using HTML webresource in CRM According to your         requirement what is needed. You can use CSS for the design and look.                         

Step 2. You should write all your java script logic in this web resource and pass the output result to
             the main CRM java script file.                                                                                            
            This is the sample code which we required to add in our dialog webresource to send a
            value as a return type to the main java script file.                                                               
 Mscrm.Utilities.setReturnValue(<yourReturnValue>);
       try{
        closeWindow(true);
        }
        catch(e){
        alert(e);
        }

Step 3. Now you need to call this dialog web Resource from the Main java script File.                                      Sample Code:                                                                                            
 var DialogProperty = new Xrm.DialogOptions();                                         
                        DialogProperty.width = 250;                                                                                  
                        DialogProperty.height = 350;                                                                                 

                        Xrm.Internal.openDialog("/WebResources/<dialogWebResourceName>", DialogProperty, null, null, callBackResponse);

 function callBackResponse(result) {                                                          
            if (result.length != 0)                                                           
                //Write Your Logic                                                             
                   }
                                                                                                           

                                                                                                  
Hope this is going to help you in your custom development.                                            
For Any queries regarding this post you can comment and i will be back ASAP with your query
                                        

1 comment:

  1. This text is worth everyone’s attention. How can I find out more? Can you post any video about this?

    Do you know? OPTIMIZED360 is The Top Leading Dental Websites Company in The U.S

    ReplyDelete