Ribbon Access for Custom Entities to PowerSurveyPlus Surveys

Ribbon Access for Custom Entities to PowerSurveyPlus Surveys

Do you use PowerSurveyPlus? Do you enjoy the feature that allows one-click access from the ribbon to Surveys from lead and contact records? Do you wish you could have ribbon access to surveys from other entities?

We recently implemented a simple no-code ribbon customization that gives you access to this feature on almost any entity you desire. The only limitation is that the entity must be enabled for activities, so it can’t be an Activity Entity.

We wanted a user to be able to complete an evaluation of a task as soon as they completed it, so we added the “Fill out Survey” button to the ribbon for that activity.

To implement this, you need to have PowerSurveyPlus and Ribbon Workbench installed in your CRM organization. To learn more about Ribbon Workbench see this blog.

First, create a solution that contains the entity you want to modify. You do not need to include any components, but you should check the box labeled “include entity Metadata.” For the best ribbon workbench performance, this solution should not contain any other entities.

Now export this solution as an unmanaged solution and save it as a backup – this is a best practice when using ribbon workbench. In case your ribbon becomes broken or corrupted in any way, you can re-install the entity ribbon as it was before you started, by importing this solution back into your organization.

Then open the Ribbon Workbench, and load the solution you just created:

powersurveyplus

In this case, the entity we are updating is the project task entity. Once it is loaded, drag the button from the toolbox onto the Form ribbon in the location you want your button to appear:

powersurveyplus

  • Edit the ribbon of the Work Order entity to add a button “btnGenSurveysPlus”
  • Label: “Fill Out Survey” (this can be changed to reflect the purpose of your survey, if needed)
  • Tool Tip Title: “Fill out Survey”
  • Tool Tip Description: “Choose a Survey for this call and fill it out “
  • Image 16: $webresource:posp_ContactLeadSurveyActivityImg16
  • Image 32: $webresource:posp_ContactLeadSurveyActivityImg32 (these images will be present in your org as PowerSurveyPlus is installed)
  • Sequence: this will be filled based on where you drop the button
  • Command Core: btnGenSurveyPlus.Command

powersurveyplus

  • Click on the Plus sign next to Commands() in the solution elements to create the new command
  • Edit the properties of The Command
  • Id: btnGenSurveyPlus.Command
  • Add action of type – Custom JavaScript Action
  • Library: $webresource:posp_/scripts/FillOutSurvey.js  (This script provides the chooser, and opens the Assessment for updating – this Javascript already exists in your org if PowerSurveyPLus is Loaded)
  • Function name: FillSurvey

powersurveyplus

  • Add a Display Rule: posp.posp_survey.DisplayRule0.DisplayRule
  • The Display Rule:
    • In-customized: False
    • Add a Step > FormState Rule
    • Default: False
    • State: Create
    • Invert result: True

powersurveyplus

This display rule is to control the visibility of the button. In this case, the button will not be visible on the create form, so surveys can only be created from the entity after it has been saved.

Click Publish at the top of the screen. You will be reminded to take a backup of your solution – but you already did that when you created it, right?

It may take several minutes to build the new ribbon and publish it to your org, so be patient!

Now when we open a project task, the Fill out survey button is available.

powersurveyplus

The standard CRM Lookup opens when it is clicked.

powersurveyplus

When you click the Add button, the survey opens in a new browser window for completion.

Hopefully this helps you to make collecting survey data from your users even easier with PowerSurveyPlus!

For more Dynamics 365 tips and tricks – subscribe to our blog!

Happy Dynamics 365’ing!

Published at Mon, 15 Oct 2018 18:48:24 +0000

Introducing PowerApproval: Approval Processes Built into Dynamics 365

Introducing PowerApproval: Approval Processes Built into Dynamics 365

PowerObjects is proud to announce the newest member of the PowerPack lineup – PowerApproval! This nifty add-on for Dynamics 365 for Customer Engagement gives users the power to build and run approval processes inside of their Dynamics system. Multi-step approval processes can be easily built and applied to any Dynamics record, and each approval step can be approved by a specific user, a team, the manager of the user who submitted the approval, or anyone else – it depends on your desired process.

powerapproval

powerapproval

The add-on is also easily extendable, so users can set up automated notifications, automated approval kick-off, and additional approval tracking by using Dynamics 365 workflows, charts, dashboards, and more.

As with all PowerObjects PowerPack add-ons, PowerApproval can be imported and tried, free, for 30 days. After you’ve had a chance to give the add-on a try, it can be purchased for $1/user/month. Visit the PowerApproval web page for additional details, and to get started!

Happy Dynamics 365’ing!

Published at Wed, 10 Oct 2018 17:55:32 +0000

Modify the Delete (Dustbin icon) Button in the CRM Subgrid

Modify the Delete (Dustbin icon) Button in the CRM Subgrid

Overview

Sometimes we need to modify the Delete button in the CRM Subgrid, example:

1. For preventing users to perform the delete button (but you dont want to just disable it)

2. Call another function or call custom function that needs client site programming (We can do plugin onDelete or onAssociate, but in case you want to show it in the client site)

3. To do impersonation

The Code

function modifyRibbon() 

function deleteSubgridRecord() 

function modifySubgridDeleteButtonEventHandler(subgridName, functionToCall, passGridControl)  //no need since I replaced by the previous line
            if (selectedControl.get_id() != subgridName) 
            else 
                else 
            }
        }
    }
    catch (e) 
}

Result

*After clicking the ‘Delete’ button

image

Note: This method is overwriting the CRM functions and it works for CRM 2013, for CRM 2015/2016, this function [Mscrm.GridCommandActions.deleteRecords] might have been changed, so need to find out the current function name based on your CRM Version. And again, it means it is unsupported Smile

Thanks!

Published at Tue, 06 Sep 2016 07:25:00 +0000

“Cannot read property ‘’ of null”–Error while executing a bound action from from a WebResource in Dynamics V9.0 using Xrm.WebApi.execute

“Cannot read property ‘’ of null”–Error while executing a bound action from from a WebResource in Dynamics V9.0 using Xrm.WebApi.execute

This one drove me crazy and believe these kind of things pop-up the most when you don’t expect them at all. A simple training going on and I was demoing them the wonderful Xrm.WebApi methods. Then came the turn of using Xrm.WebApi.execute to execute a bound action or entity action.

Since I worked a lot recently on Xrm.WebApi methods, was pretty confident of doing and just took this one example out of a participant wish. So here goes the requirement.

  • There is a custom entity (let’s call it Test Entity) which has N:1 relation with account. So account is a lookup on the Test Entity form.
  • There is a ribbon button on the Test Entity form which when clicked would open up a webresource which would show all the contacts related to the account in the form of HTML table.

So simple isn’t it. In the days when we moved to PowerApps and Flows, this just seems a walk in the park.

So here I started from scratch and wrote the below code onload of the HTML webresource.

var actionRequest = ;
     var crmContext = Xrm.Utility.getGlobalContext();
     var qString = crmContext.getQueryStringParameters();

    var accountId = qString.Data.replace(“}”, “”).replace(“;

    actionRequest.getMetadata = function () ,

                “DecimalParam”: ,

                “entity”:
             }
         }
     };

    Xrm.WebApi.execute(actionRequest).
         then(function (data) ,
         function (error) );

Before we look at the code above, let’s find out the action.

It’s a bound action for the account entity which has two input parameters – String Parameter & Decimal Parameter

image

Button is in place and then just as i click the button and HTML webresource pops out boom! An error flashing – Cannot read property ‘account’ of null

For readers who are curious to know how I opened the WebResource, here is the code below.

var webResourceName = “new_/pages/spa.html”;
     var windowOptions = ;

    var parentAccount = Xrm.Page.getAttribute(“new_parentaccount”).getValue();

    var parentAccountId = ”;
     if (parentAccount != null)

    Xrm.Navigation.openWebResource(webResourceName, windowOptions, parentAccountId);

Such an embarrassment in front of a big audience. Somehow I made this understand and they took it pretty well. If you are thinking that whether I included ClientGlobalContext.js.aspx, yeah I did. And did all whatever it takes to make it work. But none worked.

Searched the heck out of google, no luck as well.

Was not in a mood to leave. I started debugging, went inside all the system files stepping through each lines of the thousands of lines of system code.

And finally the Eureka moment. It was failing at the call of Xrm.Utility.getEntitySetName.

But let’s understand why? Well CRM relies on two arrays window.ENTITY_SET_NAMES  OR window.top.ENTITY_SET_NAMES  to get the entity set name from the logical name and window.ENTITY_PRIMARY_KEYS or window.top.ENTITY_PRIMARY_KEYS  to get the primary key property name of the entity.

Because the webresource is opening as a pop-up, both the arrays are coming as null and hence the error.

So before calling Xrm.WebApi.execute i just wrote the following lines.

var entNames = ;

entNames[“account”] = “accounts”;

window.ENTITY_SET_NAMES = JSON.stringify(entNames);

var primaryKeys = ;

primaryKeys[“account”] = “accountid”;

window.ENTITY_PRIMARY_KEYS = JSON.stringify(primaryKeys).

And this time when I run, what a relief. The code just ran fine and finally I could see my debugger being hit in the success block.

But please bear in mind this is unsupported and is never suggested. This post is more to highlight why it does not work in this scenario. May it start’s working in a future release.

However hope it saves some time or now you are aware before hand it will not work for this scenario

Debajit Dutta

(Dynamics MVP)

For consultation/ corporate training visit www.xrmforyou.com or reach out to us at info@xrmforyou.com

Advertisements

Published at Sat, 29 Sep 2018 13:57:56 +0000

Utilize Custom Action to Help Filtering The Lookup View in CRM Form

Utilize Custom Action to Help Filtering The Lookup View in CRM Form

Overview

Sometimes in our project, we have requirement to filter lookup based on some conditions and it can be achieved using addCustomView or addCustomFilter function.

And sometimes it is just not too easy to do it in Javascript or the complex fetch xml, so in my blog I just want to share another method to get the filtered result same as you wanted, that is using Javascript + Custom Action!

Detail

Following my previous post: http://missdynamicscrm.blogspot.sg/2014/08/crm-2013-using-addcustomfilter-to-get-filtered-lookup-field-based-on-linked-entity.html

So, considering you have this filter:
image

To get the result as per expected, you can use Custom Action.

Steps:

1. You need to create a custom action that give you output, either STRING or ENTITYCOLLECTION

2. Inside the custom action code, if you want to return string, you can use comma delimited concept, or using | as delimiter, or you can just return the Final XML Filter already.

If you use EntityCollection, you might need to parse it again.

3. Then create a javascript that can call the Custom Action, you can use this method for easy way:
http://www.magnetismsolutions.com/blog/paulnieuwelaar/2015/08/12/Call-Action-in-CRM-2015-Easily-from-JavaScript-Library

4. Then you get the result as parameter, you can just set it to the filter = “the Result” (if you use Final XML Filter as the Output) or you parse the GUID if you use the comma or | delimited concept, or if you use EntityCollection then you need to parse it back.

5. See the result

Basically, you just need to get this result:

image

Either you just easily using String as output or other method it is up to u.

But the point here is we can use Custom Action for solving complex filtering and remember that we can use impersonation also to get the data you want if it is related to the other entities as well, imagine if we also need to have multiple entities involved then it might be easier if we use Custom Action as we just replace the DLL if there is any other changes using Plugin Registration Tool.

Hope this helps!

Thanks,
Aileen

Published at Tue, 06 Sep 2016 07:26:00 +0000

Error: “Unable to Login to Dynamics CRMOrganizationWebProxyClient is nullOrganizationWebProxyClient is nullOrganizationServiceProxy is nullOrganizationServiceProxy is null” during connecting to CRM Online using Xrm.Tooling.Connector

Error: “Unable to Login to Dynamics CRMOrganizationWebProxyClient is nullOrganizationWebProxyClient is nullOrganizationServiceProxy is nullOrganizationServiceProxy is null” during connecting to CRM Online using Xrm.Tooling.Connector

It’s been long time I have not written any post.
So, now I just want to share my experience when I have error once trying to connect to the CRM Online using Xrm.Tooling.Connector

Here is there error:

“Unable to Login to Dynamics CRMOrganizationWebProxyClient is nullOrganizationWebProxyClient is nullOrganizationServiceProxy is nullOrganizationServiceProxy is null”

Here is my connection string:
image

It does seem okay since I am following the example given by SDK:
image

But I receive that error as it makes me cannot connect to the CRM.

Then, how to solve it?

It is easy, just fix the URL and ensure that’s you have correct Username, password and also AuthType parameter

So, the mistake here is just the URL, change this to your unique organization, not the friendly/display name
image

*I know it can be misleading because the example is using the display name as same as you use to type your URL when you are trying to access through your browser.

*Change to:
image

To find the Unique name, please to the Customizations –> Developer Resource and find the unique name of your organization
image

Hope this helps!
Thank you

Published at Wed, 15 Feb 2017 23:28:00 +0000

Redeploying Surveys with PowerSurveyPlus

Redeploying Surveys with PowerSurveyPlus

In case you haven’t heard, PowerSurveyPlus is an awesome, easy-to-use surveying tool, that plugs directly into Microsoft Dynamics 365. This add-on helps users send out surveys, and collect survey responses back inside of Dynamics 365.

With Microsoft making it so easy to move Dynamics 365 online from a sandbox to a production instance, or copying one Dynamics instance to another, it’s only fitting that PowerSurveyPlus follow suit. Now, if you’ve re-deployed your Dynamics 365 system, you can redeploy your surveys as well – all with the click of a button!

Once you have your other system up and running, follow the steps below:

1. Enable Plugin Trace Log for All, so that any exceptions are caught here, and can be reviewed for troubleshooting.

To enable plugin tracing, navigate to Settings > Administration > System Settings > Customization and change
“Enable logging to plug-in trace log” to All.


IMPORTANT: Remember to come back here and turn OFF plugin tracing when you’re finished, so records don’t accumulate unnecessarily in your system.

2. Navigate to and open the PowerSurveyPlus solution, and click on the Setup tab. Then, click on Deploy. The Deployment Wizard dialog box will open. Select one survey and click on the OK button.


After each survey is successfully migrated, that survey will be disabled in the dropdown list as shown in picture below.


Note: This process will need to be repeated for each survey you’d like to redeploy.

Once every survey has been migrated successfully, the Cancel button will be changed into a Done button surrounded by green line. At this point, it will be clear that all surveys have been successfully migrated. If there are any errors, please check the plugin trace log.

Don’t have PowerSurveyPlus yet? Give it a free test run for 30 days. Click here to get started!

Happy Dynamics 365’ing!

Published at Tue, 25 Sep 2018 16:52:50 +0000

DateTime Attribute Onchange event in Dynamics Portals

DateTime Attribute Onchange event in Dynamics Portals

Chandana's CRM Blog

Today’s blog title sounds to be very easy but, there lies something interesting as well. Well continued to work with Dynamics Portals, starting up with entity form and entity form attributes. I have a requirement like to calculate the age on input of date field.

So I am just trying to trigger an onchange event of date field in Entity Form. DateTime Field in entity form is usually a DateTimePicker which is evident to us. My datetime attribute schema name is “new_datefield”. So i tried simply to trigger on change event like

$(‘#new_datefield’).bind(“change”, function() );

Which doesn’t fire the change event. 😦 Simple but not working. After couple of observations over the datetime attribute. DateTime field on click or expand opens up a datetimepicker where actually I need to attach my event handler to it.

To add a custom event handler to datetimepicker if I…

View original post 94 more words

Advertisements

Published at Wed, 22 Aug 2018 06:04:41 +0000

Multiple Control ID’s Error in Dynamics 365 Portals

Multiple Control ID’s Error in Dynamics 365 Portals

Chandana's CRM Blog

Well I have started working as well as learning Dynamics 365 Portals. Seems like portals are quite interesting and bit tricky to play around. Lets move on to the scenario which I have faced.

My task is like to display a page in portal which contains account information. To achieve this I started creating a web page named “Account” which will use the entity form.

In Entity form I select account entity and account detail form to display the same on the portal. Now I am done with my changes and task as well. When I refreshed my portal to view the changes and account detail form, the portal does not show up. Indeed it throws up a weird error!!!!

Capture

I am dumbstruck, was not able to identify what actually went wrong. After some moment able to identify through error log which says like “Multiple Control ID’s…

View original post 54 more words

Advertisements

Published at Tue, 21 Aug 2018 12:41:29 +0000

Show Lookup as Dropdown in Dynamics 365 Portals–Gotchas!

Show Lookup as Dropdown in Dynamics 365 Portals–Gotchas!

I have been working and providing training a lot recently on Dynamics 365 portals. And whenever I go over Metadata configuration of entity form the option – “Render Lookup as Dropdown” option excites the participants a lot.

Well, in this article I am not going to show how you can render a lookup as dropdown. Rather I would like to highlight what features you loose when you render your lookup as dropdown.

Gotcha 1 – No Values shown in DropDown

When you render your lookup as dropdown, the first thing you observe that the list is empty. Well, this may happen because there is a bit of change in this implementation. Right now the options will only show up is you enable entity permission for the entity which is shown as lookup.

For example – Primary Contact field on the account form. When you render your Primary Contact as dropdown in Portals, you need to have an entity permission for contact entity with Append privilege for the webrole the user is logged in with. The contacts will show up then.

 

Gotcha 1 – Lookup filtering not working.

Well this is something undesirable but as of the day I am writing this blog, related records filtering does not work for lookups rendered as dropdown.

 

Short article but should put you in good stead next time your customer asks for this option.

 

Debajit Dutta

(Dynamics MVP)

For consultation/ training visit www.xrmforyou.com or reach out to us at info@xrmforyou.com

Advertisements

Published at Sun, 19 Aug 2018 17:17:04 +0000