unwanted changes after clicking on a custom button created with ribbon editor - dynamics-crm-2016

in MS Dynamics CRM 2016,I've created a new button on opportunity form with Visual Ribbon editor.
my button calls a dialog in order to get some extra information about account. everything's working fine , the problem is that after finishing the dialog as it is connected to my button , it refreshes the form and a new empty opportunity will be create.
when I check all opportunities I see my created opportunity, but why it creates a new opportunity after button is clicked ?

Related

VSTO: Forcing Save Dialogue to appear when an addin custom ribbon button is clicked which updates only a Form region

Using VSTO to create an Outlook Addin, with a custom ribbon and a Form Region.
When I click one of the custom buttons, the region is updated. I need the item (MailItem or AppointmentItem) to know it's been modified so a "do you want to save" dialogue pops up.
I see there is a Saved property, but it's readonly (see https://learn.microsoft.com/en-us/office/vba/api/outlook.mailitem.saved ) is there a way to safely trigger it without a hack (e.g. not item.Subject = item.Subject)
If you are using Outlook Object Model, modifying any property will mark the item as dirty. Are you not modifying the item?
BTW, resetting the Subject property might not be safe as it can wipe out the conversation id. You can reset the MessageClass property instead.

Buttons in a view in Dynamics 365

I am new with Dynamics 365 and are not sure of how I can achieve this.
I am looking into having some buttons in a view.
Maybe a view isn't the best way of doing it, but what I want to do is to have a list of records connected to the logged in user (similar to a view)
But on each row/record I want to have multiple buttons. These buttons can be like 'Complete' (Changes status on task and updates the view) , 'Send email'(Starts a workflow) and so on.
What are some of the ways of doing this? Either with Javascript/C#/plugin or something else.
You cannot add buttons in views/subgrids directly.
That’s when we add ribbon/command bar buttons using Ribbon workbench usually.
Create a Workflow Short Cut Ribbon Button (No Code Solution!)
Update:
There is a PowerApps Components Framework (PCF - preview) coming out soon, then we can build custom grid control with the layout/buttons we want.
This can be achieved with RibbonWorkbench. My answer does not differ much with #arun vinoth answer but just added few explanation lines.
https://ribbonworkbench.uservoice.com/knowledgebase/articles/132235-create-a-workflow-short-cut-ribbon-button-no-code
If you look at view below where I have selected number of contact and then I have a Button at top "Nominieren" which is shown and clicking on it will perform whatever action is needed.
There will be java-script on click of button, from Java script you could call Action or workflow or perform operation in Java script itself.
Link for Adding new Button : https://community.dynamics.com/crm/b/crmtipsfromadeveloper/archive/2017/07/26/know-how-add-a-ribbon-button-using-ribbon-workbench
Now when you look at image below I have no contact selected and it does not show button on Ribbon.
It might be possible. I haven't tried this but you can write JavaScript for a view column now (since CRM 2016).
If you go to a view you can double click on a view column to view its properties. There are two properties you might be interested in:
Web Resource
Function
Here's a link to an MS page that explains how to use these options to add an icon. It might be possible to create a clickable button which uses CRM's WebApi to perform some actions: Docs # Microsoft

Microsoft USD - Opening a third party application in USD Tab through CRM Page button click

I have two questions here. I am using Microsoft USD 4.0 with CRM v9 and I am in a scenario where I want to open a third party desktop application within USD tab.
Now, opening the application is USD tab is not so difficult but what I want to do is open that application by push of a button inside a CRM page that is already opened inside USD.
So the scenario is like below,
1) We have a CRM Page opened inside USD.
2) Once user push a button inside that CRM Page a new tab will open.
3) The tab will be opened inside USD after we push the button inside
CRM page.
The other question is,
We are also in the stage of developing the third party application. So what points should we keep in mind to make it compatible with USD?
One of the most commonly used way of opening a tab in USD from a button click in CRM page is to trigger an USD event from JavaScript tagged to the button click.
Create an event in USD, for the hosted control associated with the CRM page.
Trigger the same event from JavaScript something like below,
window.open("http://event/?eventname=YourEventName);
Make sure you check for window.IsUSD before executing this part of code within JavaScript.
Once this event call is added to the JavaScript, you will get that triggered in USD on button click of CRM page.
Once you can track the event in USD, you should be knowing how to take it forward by adding action calls under the event which got triggered.
Hope that helps. Let us know if you have any queries regarding the same.

How do I disable a ribbon button on multiple select of records in account view in Dynamics 365?

I am working on dynamics 365. I need to disable a button, say assign, from the ribbon in case of multiple select in acccount view. How can I do that?
This can be achieved by straight forward EnableRule available named SelectionCountRule
Read more
Make sure to take a backup of Application ribbon/Entity before touching the customizations. Also you need to click the context menu “customize button” / “customize command” if you are customizing OOB button like Assign to retain the existing Rules/behavior & to add your custom rules/behavior.

How to refresh page after dialog has completed?

I'm running a dialog (the workflow-ish one, not a custom, modal window) on Customer and during the process, an instance of a related entity Project is created. All the related instances of Project are displayed in a subgrid on the Contact form.
The problem is that the most recently added instance of Project isn't view until a refresh of the page which confuses the users. How can I force the form to refresh when a dialog has run?
I've googled the issue but the only resolution I've found are to a modal dialog frames à la JavaScript. The abundance of these drowns any relevant hits, as far I can see (if there are any, that is).
I think you'll find refreshing the page after a dialog closes in CRM Online impossible in the way you describe. As such my only recommendations are to flag up to the user before the dialog closes that they will need to refresh the page or to do something custom via a ribbon button.

Resources