Use Learning Path for your D365 v9.x Organization – Part 3 | Guided Tasks

After 2 posts to trying to summarize Learning Paths, here we are to Guided Tasks which conclude this series. We will see D365’s early adopters can get acquainted with processes in your organization and getting them to know the system.

To check the other 2 posts – Please follow the below posts

  1. Setup – Use Learning Path for your D365 v9.x Organization – Part 1 | Setup
  2. Sidebar –Use Learning Path for your D365 v9.x Organization – Part 2 | Sidebar

Configuring Guided Tasks

  1. Assuming you are already in Learning Path > Content Library. Select Guided Task.
    guidedTask
  2. Fill out the properties of the Guided Task like the name and how you want it to behave.
    guidedTaskProperties
  3. One you save, you get a Flow Editor where you can add 4 different types of Guided Task modal.
    flowEditor
  4. So, these 4 types of modals are available. Here’s what each of them do –
    1. Step with Next Button – Simple instruction in Text or Video and a Next Button
    2. Step with User action – Will make you click the button/action it is pinned to. And only then move forward.
    3. User Action with Next Button – This is a combination of A and B above. You can either select the action or skip to next step.
    4. Learning Step – It is like a tip and comes with a Button that can open another Learning Path Published item. Like, Sidebar in my case.
      stepTypes
  5. When you drag either of the above onto the screen, the D365 screen is highlighted with areas where you can drop it and it gets pinned to that item.
    skeleton
  6. On each of the types of modals, you get to either enter Text or add a Video.
    contentTypes
  7. For Learning Step modal, you get to also configure what will open when user clicks Learn More.
    learnMoreEditor
  8. In my case, I’ve opened the existing Sidebar from Part 2 of the blog series.
    sideBar

Finally, my track looks like this –

track

Previewing and Publishing

  1. Once you are done editing, Save your changes and Check In your changes.
    confirmCheckin
  2. Once you proceed, you’ll be asked in the same way as Sidebar to specify which all environments you want to publish this to.
    envSelect
  3. On publishing, you’ll see this notification.
    published

Seeing Guided Tasks Work

    1. Step with Next Button.
      stepWithNextButton
    2. Step with User Action (Notice that it doesn’t have a Next button but is asking you to click on the Gear Icon)
      userAction
    3. User Action with Next button, either of which will take you to the next step.
      nextUserButton
    4. Learning Step (Clicking on Learn More will open the Sidebar on the right hand side)
      learningStep
    5. Sidebar showed up on clicking Learn More from Step 4 above.
      LearnMoreSidebar

Hereby, I conclude Learning Task. I tried to keep it as short as possible. But then, lots of screenshots.

To summarize, you can read previous blogs in this series
1. Setup – Use Learning Path for your D365 v9.x Organization – Part 1 | Setup
2. Sidebar – Use Learning Path for your D365 v9.x Organization – Part 2 | Sidebar

Hope this gets you through Learning Path quickly! 🙂

 

Advertisements

Use Learning Path for your D365 v9.x Organization – Part 2 | Sidebar

Sidebar is a component in Learning Path where you can design a Sidebar that appears like a tray popping from the right side of the screen. You can have quick help items in it so that new users to D365 can use it to get help on the most frequently requested items in your Organization.

Before you begin, you can check my post i.e. Part 1 post of this series on setting up Learning Path in D365 – Use Learning Path for your D365 v9.x Organization – Part 1 | Setup

Also, check out Guided Tasks in this blog post – Use Learning Path for your D365 v9.x Organization – Part 3 | Guided Tasks

In my last, I setup Learning Path in D365 Org, let’s take a look at designing one of the aspects of Learning Path i.e. Sidebar

Creating a Sidebar in Learning Path

  1. Assuming you have gone through the setup of Learning Path and you are now navigated in your Org to Training > Content Library. Content Library is open and you need to select Sidebar
    createSidebar
  2. On opening the same, you’ll be asked to set preferences of what should the details of the Sidebar be
    sidebarProp
  3. On clicking Save, a designer pane will open on the right hand side of the Page like so
    editorOpened

Designing your Sidebar

Now, let’s put a few items on the Sidebar and publish it to see how it looks

  1. I’ve given a suitable Title to my sidebar, I’ll call it CFT117 Helpdesk for now. Then, when I want to first item, I’ll click on Section #1 below that and a Pencil and Delete icon will appear. I will select the Pencil Icon to start editing my first section
    editingSection1
  2. On clicking the Pencil, a menu to show what all I can add appears, for example, I select List of Links (I will just give link to a website here)
    selectContent1
  3. Once I select List of Links, editor to add Links will appear. I’ve given a title to it called as Visit Company Website and I’ll select + Add Link as shown below
    addLink
  4. After clicking on Add Link as in #3 above, I get options to specify what the link will do. For example, I’ll select Webpage since I want to redirect to the company website
    defineLink
    linkDetails
  5. After I click Next, the first Link will be set and will appear like this.
    linkSet
  6. Next, I’ll select to add a Video (you can select what you want to show in subsequent sections as mentioned in step #2 above).
    So, I’ve given a title ‘Using PSA’ and entered the URL of the video I wanted to show. Finally, my section will look like this
    videoProperties
  7. After everything is done, I’ll click on Save
    saveSidebar

Publishing Changes

  1. Next, on the button left, you can select Preview.
    preview
  2. Once someone clicks help, this is how the pane will look. Finally, if you’ve decided to publish it, you can click on Publish button on the bottom left
    previewShown
  3. And you can select which all Orgs you want to publish this Sidebar to –
    publishControls
  4. On confirmation, it will tell you that the content has been published successfully.
    published

Using Sidebar

Now, our Sidebar is ready. And once the user clicks on the Help Icon on the top right as shown below –
clickHelp

They’ll see the Sidebar as you designed
sidebarDisplayed

 

Excuse me for the unusually lengthy post. Hope this helps! Learning Path – Part 3 – Guided Tasks has been published too – Use Learning Path for your D365 v9.x Organization – Part 3 | Guided Tasks!

Use setFormNotification (Client side JS) in D365 v9 while Real-Time workflow is executing

Often, when a real-time workflow is being executed in the background, users don’t know how long it will take for the processing to finish. setFormNotifications in D365 v9 come handy!

Scenario

Here’s how I put my scenario –

  1. I call the Real-Time workflow using JS, example, on change of a certain field or the JS being called from the Ribbon button.
  2. The JS will trigger the Real-Time workflow I have.

Now, while the Real-time workflow is running, the user doesn’t know it has been called and should the user retry the same action? Here’s when the form notification is vital.

While the processing is happening, the message will remain as a notification on the form. Once the processing is complete, the notification will be cleared.

JS Implementation

For the JS code implementation, the function to call the workflow needs ProcessJS which is available on https://github.com/PaulNieuwelaar/

  1. So on the Form, I’ll add my file after ProcessJS file.
    formProperties
  2. Here’s the Account Form code I wrote. I created a JS file to call the Real-Time workflow.
    jsCode
  3. In the above code, the Xrm.Page.ui.setFormNotification(Message, Type of notification, Unique Identifier); This will set the notification.
  4. Page.ui.clearFormNotification(UniqueIdentifier); will clear the notification from screen.
  5. Using this, When the Process enters in Processing mode, the message is shown on screen as “Please wait while processing”
    messageShown
  6. And once the execution is finished successfully, the notification is cleared.
    wfExecuted
    notificationCleared

Similarly, you can even use this approach for WebAPI calls and have clearFormNotification set in the Success/Failure callbacks.

Hope this helps!

D365 Quick Tip: Rather Uninstall Plugin Profiler from the D365 Solutions

Often, I get annoyed when I finish debugging the plugin and want to uninstall the Plugin Profiler from the Plugin Registration Tool so that users can quickly go ahead and test out the fix, it takes longer in the tool for the Profiler to be uninstall.

uninstallFromTool

And if at times, there are bandwidth issues, the uninstall just times out giving you this error.

error

Solutions in D365

Same thing is available in your organization’s Solution as well.

Select it and Delete it. It happens in less time.
uninstallFromSolutions
confirm

As a test, I simply closed the browser window and solution was deleted later when I logged back in. Since it happens on the server.

Hope this quick tip saves a few minutes. 😊

Quick Tip: Cleaning Queue Items

So are you stuck with email queue that has junk of emails you don’t want? And maybe those emails are important to CRM.

Let’s say you have these emails in your Queue (imagine there are a lot many and removing them seems like a big task)

qItems.PNG

Here’s what to do:

  1. Run a Bulk Delete Job on the following:
    Queue Item entity and the required criteria you want (maybe you want to delete only old Queue Item which you no longer need to convert to other record types)
    bulkDeleteCriteria.PNG
  2. And submit the job.

Now, even if you delete the Queue Items, the Emails will still remain in CRM in Activities records and those are not lost!

Hope this was helpful! 🙂

Understanding Xrm.Page Object Model

Xrm.Page Namespace

When writing form scripts, we will interact with objects from the Xrm.Page namespace to perform the following actions:

  1. Get/Set attribute values.
  2. Show/Hide user interface elements.
  3. Reference multiple controls per attribute.
  4. Access multiple forms per entity.
  5. Manipulate form navigation items.

 

Xrm.Page Object Hierarchy

Context – Provides methods to retrieve information specific to an organization, a user, or parameters that were passed to a form as a query string.

Data – Provides access to the entity data and methods to manage data in the form.

UI – Contains methods to retrieve information about the user interface, in addition to collections for several sub components of the form.
xrm.PageObjectModel

 

Execution Context

When you register a function for an event handler, CRM lets you pass the execution context object as the first parameter to the function.

This object contains methods that allow you to managed variables you wish to share with other event handlers.

 

Collections

attributes:

  1. Page.data.entity.attributes collection provides access to each entity attribute that is available on the form. Only those attributes that correspond to fields added on the form are available.

 

controls:

  1. controls provides access to each control on the form.
  2. controls provide access to each control that have more than one control for an attribute available on the form.
  3. controls provides a collection of controls found in a section.

 

  1. items:
  2. Page.ui.navigation.items collection provides access to navigation items that are defined using the navigation area of the form editor.

 

  1. items:

If multiple forms are associated with an entity, each form can be associated with a security role and if security roles of a user enable users to see more than one form, they can select from a collection of Xrm.Page.ui.formSelector.items. A form definition is available in this case.

 

tabs:

  1. Page.ui.tabs provides access to collection of each of the tabs present on the form.

 

sections:

A tab can be organized by using more than one section. The tab sections collection provides access to these sections.

 

Hope this overview was helpful to you!

Fundamentals of JavaScript CRM Customization

JavaScript form customization is a way to interact with entity forms by using JavaScript that is executed for events that occur on the form.

JavaScript form customizations is one of many options to control business processes.

An advantage of JavaScript Form programming is that they are immediate and doesn’t need data to be submitted.

Frequent tasks performed by using form programming are:

  1. Data Validation.
  2. Automation.
  3. Process enhancement and enforcement.

 

USE FIELD AND FORM EVENTS

Scripts can be added on events like

OnLoad

OnSave

OnChange

Whereas, tabs have the event

TabStateChange

and IFRAMES have an event called

OnReadyStateComplete

 

EVENTS

OnLoad Event

OnLoad event occurs after the form has loaded. onLoad event is used to prepare the data in the form for use.

 

OnSave Event

OnSave event occurs when a form is saved. It does not correspond to standard HTML OnSubmit event. The OnSave event occurs in the following scenarios:

  1. When a user clicks on the save button at the bottom right corner of the screen.
  2. Code executes the Page.data.entity.save method, even when there is no changed data to be saved.
  3. The user navigates away from the page and there is unsaved data to be saved.
  4. When auto-save is enabled, 30 seconds after the data has been changed and there is unsaved data on the form.
  5. Code executes the Page.data.save and even if there is unsaved data on the form.
  6. Code executes the Page.data.refresh method passing true as the first parameter and there is unsaved data on the form.

 

OnChange Event

OnChange is available for every field. OnChange event requires  two conditions to be true:

  1. The data in the field must change.
  2. The field must lose focus.

There is an exception to the Two-Option (Boolean) fields. OnChange event occurs immediately when the value is changed without requiring to lose focus.

The OnChange event does not occur if the field is changed programmatically using the setValue method. Instead fireOnChange method can be used in code to trigger OnChange event.

 

TabStateChangeEvent Event

This event occurs when a tab is expanded or collapsed.

This event is important in the case that you want to use script to modify the src property of an IFRAME control.

 

OnReadyStateComplete Event

This event is fired when contents of an IFRAME have completed loading.

 

STEPS TO ADD JAVASCRIPT AS A WEB RESOURCE AND APPLY FORM CUSTOMIZATIONS

  • JavaScript files for form customization are applied as a Web Resource.
  • Navigate to Settings > Customizations > Customize the System. Then navigate to Web Resources under Components on the left navigation pane of the Default Solution (Default solution here is used as an example).

addWebResource

  • In order to add a JavaScript file, we need to create a new Web Resource.

newWebResource

A new JavaScript file could be uploaded or JavaScript code could be simply written in the Text Editor provided by CRM’s Web Resource.

  • So this way, a new Web Resource of type JavaScript could be created which then can be consumed on CRM Forms for customization purposes.
  • For registering events on OnLoad events, select Form Properties on the form.

formProperties

  • In Form Properties, Select the form libraries that we want to enable on the form level as shown below.

addEventHandler

In the above example, a library called ‘new_sampleScript’ has been included. We can now add Event Listeners (which are the functions in that library) that we want to trigger when the library is loaded.

 

handlerProperties

In the above dialog box, select the library which has the desired javascript file/code.

Enter the name of the function you want to trigger on this event.

 

As shown above, OnLoad events could be executed using JavaScript.

 

Similarly,

OnSave event listeners could be bound by simply changing the Event to OnSave as shown below.

changeEvent

For OnChange events, the Field Properties need to be changed. Steps to do so are as follows:

  1. Navigate to the desired field and select its properties.

fieldProperties

  1. Follow the steps as illustrated for OnSave and OnLoad events above.
  2. So JavaScript code registered OnChange will get triggered when the field value changes and when the field loses focus (Remember, data needn’t be saved for OnChange events to be fired).

Hope this is useful! 🙂