- In this walkthrough we will learn How to create a Dialog in Dynamics CRM 2011. A CRM 2011 Dialog can automate processes, force bussiness rules, and even guide the users through everyday tasks.
- We'll automate a part of the creation of a new Contact, using a custom Dialog.
- Suppose in our firm we want a new Contact belonging to certain Customer, to have not just a Bussiness phone, but also we need it to include a Mobile and Home numbers.
- In order to attain that, we'll create a Dialog which will lead the user to save a new Contact fast and comfortably, but constraining to type those phone numbers . If they're not typed, we will CRM to copy the Bussiness phone number to both Mobile and Home fields.
- Let's state that the Contacts whose Parent Customer is "Rick Deckard", will be required to state not only bussiness phone number, but also their Mobile and Home phones.
- In Customize the System, go to Processes:

- And Create a new Process:

- The Entity will be Contact, and the Category "Dialog":

- State that the Dialog will run On Demand, and Add a new Step:

- The step will Check a CONDITION:

- On the dialog that opens, select "Parent Customer":

- The "account" property of the Parent Customer, meaning the Account object...

- ... must equal...

- ...the "Rick Deckard" Account:

- Check that you established the correct conditions:

- Next, IF this condition is TRUE, we want a Page to open (is important that you click and focus the correct AREA beneath the condition, to include this step UNDER THE SCOPE of the former step, and not as a step per se):

- Enter a description for the step:

And under the scope of THIS Page, add a new "Prompt and Response" step:
- The Page will prompt to the user to enter both Mobile and Home phone numbers:

- Now, we'll add a checking to see whether the user did that:

- The CONDITION will use the current Contact entity:

- ...and its "Mobile Phone" field:

- ...and will check whether it contains data:

- This is the CONDITION ready to be saved:

- Inside the scope of this condition, we'll add a new Page containing a Prompt:

- The prompt will state to the user that because she/he didn't enter the numbers, therefore CRM proceeds to clone the Bussiness number:

- Next, and again inside the SCOPE OF THE CONDITION, we need to UPDATE our Contact to copy the numbers: so add a step to Update the Record:

- In the Contact form that opens, click on the "Home Phone" to focus:

- And select the Business Phone" from the Contact on the Form Assistant:

- You'll see that the Business Phone will be attached to the "Home Phone" field:

- Do exactly the same for the "Mobile Phone" field:

- Next, close and take a look at the final cut of the Dialog:

- Now Save and ACTIVATE the dialog:

- Now let's see how it works. Create a New Contact and enter some data in it. Remember to set the Parent Customer to "Rick Deckard", in order to fulfill the first CONDITION of the dialog:

- For the first test, let's see what happens if the user typed indeed the three phone numbers:

- Start the Dialog:

- ... selecting the dialog we created:

- ...and you'll see the first prompt appearing:

- ... and the "Next" leads the user right to the end of the dialog:

Why is that? Because the user typed the three phone numbers, and the second condition doesn't apply. - Now let's do the test without the phone numbers:

- The first prompt fires:

- But the user hasn't got the numbers, therefore the second IF condition applies:

- Save and close the Contact:

- ..and when reopening it, you'll see the phone values had been copied automatically by CRM 2011:

That's all...Enjoy Dynamics CRM
A Step-By-Step Walk-Through CRM 2011 designed for Begginer and Professional CRM Developers
Microsoft Dynamics CRM 2011
Monday, October 14, 2013
Step-By-Step How to create a Dialog in CRM 2011
Tuesday, October 8, 2013
Step-By-Step How to open a local File from a CRM Form
by Carmel Schvartzman
In this walkthrough we will learn how to open a local File from a CRM Form in Dynamics CRM 2011. We'll create a link button on the Main CRM form of the Article entity, to open a file from the local File System.
Although CRM 2011 allows us to add a link to some URL, it won't work for a link to a local file .
So if we need to open a local PDF, DOCX or PNG local file, the way to do that is to turn a string file address into an hyperlink, using a Web Resource written in javascript.
A Web Resource is a virtual html, jscript, css, picture or Silverligth file stored in the CRM database, and identified by a unique URL. After creation, a Web Resource can be used in many CRM Forms, enhancing its functionality and/or appeareance.
Our link button will open a pdf file on our Form: the following snapshop shows how the final form will appear:

In this walkthrough we will learn how to open a local File from a CRM Form in Dynamics CRM 2011. We'll create a link button on the Main CRM form of the Article entity, to open a file from the local File System.
Although CRM 2011 allows us to add a link to some URL, it won't work for a link to a local file .
So if we need to open a local PDF, DOCX or PNG local file, the way to do that is to turn a string file address into an hyperlink, using a Web Resource written in javascript.
A Web Resource is a virtual html, jscript, css, picture or Silverligth file stored in the CRM database, and identified by a unique URL. After creation, a Web Resource can be used in many CRM Forms, enhancing its functionality and/or appeareance.
Our link button will open a pdf file on our Form: the following snapshop shows how the final form will appear:

- To create the link, let's make a new Web Resource:

- Give the Resource an appropriate name, and write the " _ " before of the display name , making it easier to find our resource between hundreds of files:

The "Type" of the resource must be "Script". Open the Text Editor, and write the javascript function:
3. The function will get an "fldName" parameter containing the name of the string field to convert to a link:
Using the CRM notation, get the string inside the field: Xrm.Page.getAttribute("...").getValue(). - After checking whether the string containing the file path is not null, create an anchor html tag ( <a> ) that will hold our path, opening it in a new window ("target=_blank"):

- Next, get the control containing the field:

...and set our <a> tag as the innerHTML of the control, hiding the original text box control:
- Save the Script and Publish the Web Resource. Next, go back to the Article Main form, where we want to add our File attachment link:

On the Article's form, add a New string Field:
Select from the list only the custom fields, and drag and drop the new field to the CRM Form:

Now the field is on the form, but because it will hold a file address, let's expand it to two columns:
- Our next task is to add the Web Resource script to our form. Go to "Form Properties":

- We need to add the script as a javascript library. On the Properties dialog, go to the Libraries in the Event List:

- Inside the Look up Record list, we'll find our script on the top, just because we add the " _ " at the head of the Display name of the Web Resource:

- After we added the library, we must select which Event Handler will call the function: Select OnLoad and click "ADD":

- Select the library we just added:

- Next, type the function name we coded on the script, and the LOGIC NAME of the CRM field holding the file path (remember that the LOGIC CRM name is the same as the SCHEMA NAME but in small caps):

That's all concerning to the Web Resource. - Now let's see how it works. Create a new article. Fill up the required fields and type the address of the file:

As you can see, you can input the address in a text box. Save the Article and close the CRM form. - Now open the Article we just created, and you'll see that the address string has been converted to a link to the file:

- Click the link and the PDF file will open:

That's all...Enjoy Dynamics CRMכתב: כרמל שוורצמן
Subscribe to:
Posts (Atom)