AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 14.10.2010, 11:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,631 / 848 (80) +++++++
Регистрация: 28.10.2006
Leon's CRM Musings: World First Exclusive: Dynamics CRM 2011 as a Games Platform
Источник: http://leontribe.blogspot.com/2010/1...-crm-2011.html
==============

You heard it here first, XNA is dead, long live Dynamics CRM 2011. Dynamics CRM 2011 is so powerful you can design games on it. Admittedly the game is hangman in this case but it is possible using the new dialogs feature. As a further testament, this took me about an hour to put together starting from a very low knowledge base of dialogs.

The Structure

First of all I created a new solution in case the boss feels a hangman game is not appropriate for our demo server



This way it is really easy for me to remove my work by simply deleting the solution.

Within Hangman there is a new entity called Word and two Dialogs (Hangman Dialog and Hangman!)



The Word Entity



The bits of interest are in the Word section (by the way to add a new section, go to insert and look for the column formatting).

Letter 1-6 defines the word of interest, Guess 1-6 stores the state of guessing and Guesses stores the number of incorrect guesses.



The Hangman Dialog

I’ve got multiple screenshots because of the limited scrolling capability within the dialog configuration form.



So this Dialog is On-Demand and a Child Process. This works the same way as Workflows. This means I can manually call the Dialog and have it loop.

I did not use the Input Arguments and Variables. To be honest I’m not sure what they do.

First there are a couple of conditional statements. The first sets the Guesses field to zero. The next checks if there have been 10 incorrect guesses and if so it spawns the Hangman! Dialog whose only function is to display the word ‘Hangman!’ and finish the Dialog.

To get a popup, we now create a ‘Page’ step.



We prompt for a letter and in the prompt add dynamic information such as the letters correctly guessed so far and the number of Incorrect Guesses. This was really hard to set up because the dynamic fields, just like in version 4 do not always get placed at the cursor. To make matters worse, if I tried to cut and paste a dynamic field it worked but on exiting, the whole text got converted to broken html and I had to start again. My tip for beta: add the dynamic fields first in the order you want them and then type the text around them.



After the page prompt a set of if statements checks whether the input value matches any of the letter values and if it does it populates the corresponding Guess field. You can access the user’s input for the conditional pretty much the same way as you access workflow attributes in workflows now i.e. through the form assistant and dropping down the referencing entity to, in this case, Dialog.



If the input matches none of the letters, the Guesses field is incremented by one (you can do this in workflows in version 4 but it is a relatively unknown feature. Click on the field and again play with the form assistant. You’ll need to use the default field and set it to one to get the increment working.

Finally I call the Dialog to loop it.







CRM Hangman in Action

First we create a word.



We only need to fill in the letter values. The name is not used but is the default attribute for the entity. If desired, the compulsory status could be removed and the field taken off the form.

You then save the record and click the Start Dialog button on the ribbon, selecting the Hangman Dialog



You then enter the letter in the text field in the blue area and hit next. The Dialog loops until you have made 10 guesses or until you give up/guess all the letters.





Things I Learned

  • You can’t spawn a Dialog from an event, like Workflows. For example, it would have been great to kick off the Dialog on the creation of the Word record. I could not figure out how to do this
  • You cannot spawn a Dialog from a Workflow but you can start a Workflow from a Dialog. I’m guessing this has to do with the asynchronous nature of Workflows
  • Given enough time it should be possible to create an Infocom-style adventure game (http://en.wikipedia.org/wiki/Infocom). I’ll leave that as an exercise for the reader. You’re in a room with exits to the North, South and West…



Источник: http://leontribe.blogspot.com/2010/1...-crm-2011.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
Теги
crm online, crm2011

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
CRM DE LA CREME! CRM 4.0 Disaster Recovery Blog bot Dynamics CRM: Blogs 2 26.02.2016 08:23
Leon's CRM Musings: Book Review: Teach Yourself Microsoft Dynamics CRM 4 in 24 Hours Blog bot Dynamics CRM: Blogs 0 21.07.2010 09:06
CRM DE LA CREME! Configuring Microsoft Dynamics CRM 4.0 for Internet-facing deployment Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05
Microsoft Dynamics CRM Team Blog: List Web Part for Microsoft Dynamics CRM 4.0 Deployment Scenarios Blog bot Dynamics CRM: Blogs 0 30.01.2009 22:05

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 22:25.