Dynamics CRM 2015 Creating a button to start a workflow - crm

Hi I am currently trying to follow this guide:
https://ribbonworkbench.uservoice.com/knowledgebase/articles/132235-create-a-workflow-short-cut-ribbon-button-no-code
So that I can create a button on the ribbon in CRM to start a workflow. The idea being that the user will fill in part of the form and then request approval.
However I have ran into an issue which is that at one point I have to define the library for the command actions to use and the guide state that we must use the "/_static/_common/scripts/RibbonActions.js" and the "/_static/_forms/form.js" library.
However not having done this before I have no idea how to include the library in the solution, so nothing appears on the library selection screen. I have tried searching how to complete this step but to no avail. Any help would be greatly appreciated.
Thank you.

What I understood is that you are trying to call a workflow from javascript on click of a ribbon button. If you have any reference javascript assembly then both of them should be referred for the javascript method to work as expected.
Lets assume we have two different javascripts files like reference.js and actual.js And the button is supposed to call a method button_click from actual.js. In such a case we will be adding two commands as follows:
Library:reference.js and FunctionName:isNaN
Library:actual.js and FunctionName:button_click
This way the reference javascript also will be loaded and the method should be working properly. Hope I was able to address your query. Let me know if you have any questions or still the problem persists.

There is a possibility to enter plain text to library field instead of choosing from a selector.

Related

How can I make a Visual Studio 2017 custom editor refresh the text view?

I have created a Visual Studio custom editor extension (implementing ITagger<T>). It works perfectly and applies syntax highlighting according to the domain specific language behind it. Nonetheless, when I edit the text, VS re-tags and re-formats only the edited line.
However, when a particular line changes, I need to force re-formatting all the visible lines following the edited line. I do not know how to do this. I tried many alternatives, including responding the Changed event of the TextBuffer behind.
Can you help me with ideas, or sample source code to custom editor implementations that handle this issue? The built-in C# editor does it: when I edit a line, and it becomes a multi-line comment, the text view is changed accordingly.
The extension code Formatter could format the class file and arrange fields, properties and methods as per StyleCop rules. Maybe it is an extension you want to get:
https://marketplace.visualstudio.com/items?itemName=vs-publisher-599079.CodeFormatter
One crude way is to close the document and open it again.
string path = dte.ActiveDocument.FullName;
dte.ActiveDocument.Save();
dte.ActiveDocument.Close();
dte.ItemOperations.OpenFile(path);
Although, I hope there is a better way to deal with this issue.
Edit: Well, I think I found a better way.
An event is declared in your tagger class (which implements ITagger interface). Raising the interface does the job flawlessly.

TornadoFX: Label text not updating

One of the issues I'm currently experiencing is that I can't seem to change the text of a Label which is implemented in a dynamically loaded AnchorPane. I assume this might be related to the controller and how JavaFX/TornadoFX works, but I can't seem to find what I'm doing wrong.
The issue itself occurs in this class, and happens in the showSystemDetails() method. What I would expect to happen is that upon pressing the "System Details" button in the sidebar, the labels would update to the required value, but this isn't happening for some reason.
Please feel free to point me to what I'm doing wrong, or provide any constructive criticism. The project is still in full development so a lot of things are still messy/broken.
The reason this isn't working is that you're manually loading a new version of the FMXL file every time you select something in your menu. The FXML file originally loaded by SystemDetailsViewProxy is updated correctly, but that's not the one you're showing on screen anymore.
To see the updated View, make sure you put the root node of the SystemDetailsViewProxy instance back.
You could for example change your DrawerMenuButton enum to contain references to SystemDetailsViewProxy::class instead of those two strings, and use add(viewClass) to add the correct root node to your view when clicking the menu buttons.
Furthermore, you should be using ViewModels and binding instead of manually updating the text property of the labels. You're doing an awful lot of manual/error prone work that the framework can help you with for free.
Your application is not using best practices in several important areas, and you're rolling your own solutions for stuff that the framework already does very well :)
Views are singletons when managed by the framework, but you instantiate them yourself instead of using inject/find. The result is that important life cycle methods are not being called.
I would also suggest looking into type safe builders instead of FXML.
Hope this helps :)

WP7 - How can I retrieve the mini form of a Path at runtime?

I've got a databound series of predefined shapes (Path with Data="" set) which each trigger the same event when clicked.
I'd like to programmatically access the mini form of the Path.Data property at runtime to be able to persist it.
In this case I could just name the elements and on click check which one, however I'd prefer a more generic solution.
There seem to be some WPF workarounds but I haven't seen any for WP7.
Does anyone know if this is possible? and if so, how to do it?
Thanks.
Looking in to if and how this may be possible I came across http://www.eightyeightpercentnerd.dreamhosters.com/?p=40 and even though it's quite old it explains how a paths data/geometry is parsed in Siverlight.
It leads me to think that you may be better off trying to find a different approach to solving your problem. :(

How to use jquery selectors on json result

I'm creating an inbox system for my website which allows basic communication between users. I'm fetching the results with jquery calling a webservice.
Then I'm using a jquery template engine to render the results to the screen. So far this all works good. but now I want to add some click functions on certain parts of inbox messages. For example I want the title of the message to be clickable so it will expand/collapse the fulltext which is hidden in a div beneath it.
But I can't seem to use the jquery selectors on this dynamic json result. It works when I put the function in the href tag itself but I don't really want to. I also tried adding the function after the success function but no luck either. Is it possible at all to use selectors with a template engine?
I hope I made myself clear otherwise feel free to ask more information. Thank you very much
Kind regards,
Mark
Have you tried jquery .live option? http://api.jquery.com/live/
I'm sorry, you'll see it happens all the time, when something goes wrong and I ask a question the minute after it it solves itselves. It is indeed possible to use the jquery selector on dynamic elements. Just make sure u put it after the template processing and in the ajax success function.
Thanks.
Are you trying to select the json that is returned from the webservice or are you trying to use the jquery selector to find an element that you added previously on to the page?

What is a path from Ctools Modal to Modal Frame API

I wrote a module that uses the Ctools Modal Window to serve a form wizard. I would like to switch to using the Modal Frame API (which uses the JQuery UI Dialog as the modal). If someone has some experience making this type of switch in their code and can give me some pointers, I would appreciate it.
Thanks,
David
Update:
So I finally got around to making this change and this is what I learned:
On the server side code replace
ctools_modal_add_js() with
modalframe_parent_js()
On the client side js code where you
may do
$('#modal_link').click(Drupal.CTools.Modal.clickAjaxLink);
Replace
Drupal.CTools.Modal.clickAjaxLink
with your own custom function.
Clearly the ctools modal window is way easier to use because in most cases you wouldn't even have to bother with creating any js like above. But, there you have it.
I have never used CTools, but the Modal Frame API is very straight forward to use. You can have a look how I used it in my Sticky Notes module.
The documentation of ModalFrame API is quite comprehensive.
So I finally got around to making this change and this is what I learned:
On the server side code replace
ctools_modal_add_js() with
modalframe_parent_js()
On the client side js code where you
may do
$('#modal_link').click(Drupal.CTools.Modal.clickAjaxLink);
Replace
Drupal.CTools.Modal.clickAjaxLink
with your own custom function.
Clearly the ctools modal window is way easier to use because in most cases you wouldn't even have to bother with creating any js like above. But, there you have it.

Resources