Skip to content

Releases: PaulNieuwelaar/alertjs

Dialog Builder

17 Jun 07:23
2e2b5df
Compare
Choose a tag to compare

v3.3.4 - 23 May 2023

  • Added 'viewIds' property to Dialog.Lookup options. The first view in the list is automatically set as the default view. This works the same as OOTB LookupObjects viewIds.
  • Fixed a bug with the addField function where lookup properties weren't binding correctly when updating an existing field.
  • Fixed a bug with the removeField function behaving unexpectedly when used multiple times on the same dialog.

v3.3.3 - 15 Apr 2023

  • Fixed bug where lookups would open the search panel more than once.

v3.3.2 - 17 Mar 2023

  • Deprecated the use of parent.Dialog / top.Dialog. This should no longer be used within HTML web resources.
    • Instead, load the alert.js script directly inside HTML web resources, and call Dialog functions normally, e.g. using: <script src="mag_/js/alert.js"></script>.
  • Deprecated .getCrmWindow(). This is meant to be used with parent.Dialog which is also deprecated now, and accessing the CRM form scripts from an HTML web resource is not best practice.
    • Instead, you should only be running code from within the HTML web resource. Try not to access scripts from other frames. This is particularly important now that CRM can display forms within forms.
  • Various internal fixes and improvements, including better support for embedded web resources.

v3.3.1 - 22 Nov 2022

  • Fixed bug where lookup/file input events weren't being bound correctly when added with the .fields() function after the dialog is initially shown.
  • Fixed .close() function to always close the dialog with the same ID, regardless of if it's the original object.
  • Various internal fixes and improvements.

v3.3.0 - 9 Oct 2022

  • Added new showCanvasApp function. Simply displays a canvas app from the current environment in a dialog iframe.
  • Added new dialog options for canvasAppName, webResourceName, iframeUrl, and iframeContent, which can be used with the .show() function instead of calling the specific showWebResource/showIFrame etc.
  • Added new dialog option for iframeQueryStrings, which can be used when showing an iframe, web resource, or canvas app, to pass additional query string parameters to the iframe.
    • Note: Query strings are passed through as an object, where each object property represents a key/value pair for each query string parameter.
  • Removed dependency on jQuery.
  • Added .getElement() function to query and return a specific HTML element inside a dialog (using Element.querySelector), or returns the outer dialog HTML element if no querySelector used, essentially replacing .get() which returned the jQuery object of the dialog.
  • Added .getElements() function to query and return an array of HTML elements (using Element.querySelectorAll). Similar to .getElement() but returns all matching elements instead of just the first.
  • Deprecated .get() function. Use .getElement() instead.
  • Deprecated jQuery dialog option and .jQuery() setter function.
  • Deprecated .$() function. Use .getElement() and .getElements() instead with built in .querySelector/.querySelectorAll etc for querying within a specific dialog.
    • Note: Querying outside the context of a dialog, or querying more than one opened dialog at a time is not supported.
  • Fields of type Custom now return the HTML Element (parent span) in the dialog response rather than a JQuery object for the same element.
  • Added new .addField() and .removeField() methods for adding or removing a single field without refreshing all dialog fields.
  • Undefined Dialog options are no longer added to the base dialog object as undefined.
  • OptionSet fields now return the original value(s) used to create the field, rather than converting to number. OptionSet values and default value now also supports other data types, e.g. objects or dates.
    • Single-select OptionSets would previously return values as string or as a number (if the string parses to number).
    • Multi-select OptionSets (OptionSet with the 'multiple' extra attribute set) would previously return an array of strings, regardless of whether the original values were numbers.

v3.2.0 - 3 Dec 2021

  • Added a fullscreen/restore button beside the close button. This is on by default for all dialogs (except when using showLoading). Can be hidden using preventResize.
  • Added a preventResize dialog option to hide and disable the new fullscreen/restore button, and to also disable the manual resize (drag bottom right corner).
  • Fullscreen now dynamically fills 100% of the page, and dialog resize and drag/drop features are disabled while in fullscreen.
  • Content is now aligned with the top of the dialog, rather than centered. This is to keep fullscreen view looking natural.
  • Dialog now scales in size if the page is minimised to be smaller than the dialog.
  • The .hide() and .remove() methods have been deprecated. A new .close() method has been added to replace both. The new .close() method acts the same as .remove() previously.
    • The .hide() method will still exist for backwards compatibility, and is still used by default when a dialog button is pressed to avoid issues with callbacks.
  • Added new columns option to both dialog options and group options. Allows for settings the "columns" CSS property to display fields in more than 1 column, and optionally with a min width, e.g. "100px 2".
  • Renamed the preventCancel dialog option/function to preventClose. The old preventCancel naming still exists for backwards compatability. This change is to make the name/purpose clearer and in line with other changes.
  • Fixed an issue where dialogs displaying an iframe would reload if another dialog is displayed on top (due to a change in 3.1.2 re-appending the dialog container each time)
    • Each dialog is now in a separate wrapper which allows for better layering.
  • Internal improvements to how file data is stored when using file picker input types.
  • Fixed an error caused by date inputs using a string or number as the default value (e.g. miliseconds since 1970 or an ISO date string). Using an actual Date object is still recommended wherever possible.
  • Fixed a bug where optionsets were returning 0 instead of null when no value was selected.
  • Fixed a CSS conflict where fields were sometimes inheriting styles from another file sharing the class name 'top'.
  • Fixed an error with date inputs that have a null or undefined default value when adding a field as an object rather than using new Dialog.Input().
  • Fixed an error that occasionally occurred where the Dialog object would be overwritten by a conflicting reference, resulting in some global variables being undefined.
  • Added showAsync method which is awaitable. Returns the dialog responses with the selected button. View example. E.g.:
var response = await new Dialog({ buttons: [new Dialog.Button("OK")], fields: [new Dialog.Input({ id: "input01" })] }).showAsync();
if (response.button.label === "OK") {
    var inputValue = response.data.input01;
}
  • Button callbacks can now return true or false with showAsync dialogs to allow or prevent the code execution from continuing.
    • When using async dialogs, button callbacks should still be used for validation which keeps the dialog open (preventClose=true), and only return true when validation passes, to continue code execution.
    • E.g. to resolve the promise and continue code execution, return true. If performing validation while the dialog stays open, return false.

v3.1.5 - 15 Jan 2021

  • Fixed a bug with iframes not filling the dialog height after v3.1.4.

v3.1.4 - 13 Jan 2021

  • The content and fields dialog options are now completely separate from each other, allowing content to be displayed above fields.
  • Fixed a bug where the inline: false option wasn't working for Lookup fields.
  • Lookups now show (No Name) if a selected value has no name, rather than appearing as an empty field.
  • Added a new Custom field type to allow inserting your own custom HTML elements between fields, or creating more advanced controls. Can be added to the fields array using 'new Dialog.Custom(options)'.
  • Lookups can now have a custom callback function to execute when a value is selected, i.e. to automatically trigger the next step in a process. This is set using the 'callback' Lookup Option.
  • Fixed a bug where the "Add Existing" button on N:N subgrids would disappear on forms where Dialog Builder is loaded.

v3.1.3 - 21 Nov 2020

  • Fixed an issue with Lookups not working properly in CRM Online classic mode (non-unified interface).
  • Lookups containing a selected value will now have a default cursor to show more clearly that the input is readonly.

v3.1.2 - 13 Nov 2020

  • The outer Dialog container will now be re-appended to the document each time a dialog is displayed, to ensure layering is correct (e.g. with inline forms, or lookup windows).
  • Fixed an issue in Chrome where a dialog couldn't be closed after navigating away from a form with a dialog displayed (e.g. after selecting +New from a lookup window).
  • Added support for multi-select lookups using the new allowMultiSelect (boolean) option on the Lookup Options (defaults to false).
  • When a lookup value has been selected, or is set by default, the lookup input will be readonly, and can only be cleared by clicking the 'X' beside the value, or by searching and selecting a different value.
  • When searching from a lookup field where an existing value has been selected, the searchText passed through to the lookup objects window will now be empty. Previously the existing selected value would be passed through as the searchText.
  • The 'X...
Read more

Action Buttons - beta

24 Mar 07:26
e71fd96
Compare
Choose a tag to compare
Action Buttons - beta Pre-release
Pre-release

Action Buttons give super users and non-developers (and also developers) an easy way to build custom buttons and dialogs in Dynamics 365 without having to add and configure command bar buttons manually, and without having to write any code. This solution builds on top of Dialog Builder to give you a nice user interface for creating dialogs and other custom actions.

Documentation (still in progress)

This solution requires Dialog Builder (v3.1.5+) be installed, and currently only works with Dynamics 365 Online. Sample data is included which shows some pre-built action buttons and dialogs. More documentation is coming. Most fields have tooltips/descriptions explaining what they do. Use the Action Buttons model driven app to access the entities.

v3.0

24 Sep 10:29
dd349b1
Compare
Choose a tag to compare

v3.0.9 (stable) - 19 Oct 2019

  • Added options to Alert.Lookup for 'filters' and 'disableMru' (most recently used) in the Unified Interface from LookupObjects documentation
  • Deprecated the 'customFilters' Alert.Lookup options (replaced by filters). This will continue to work, but may be removed at a later date
  • Fixed input default values of zero being read as empty string
  • Fixed an issue where the CSS could be injected incorrectly when baseUrl is not available

v3.0.8 (stable)

  • Fixed issue where license wasn't being validated correctly when outlook is offline
  • Fixed an issue where getPromptResponses was returning null for lookup fields in the Unified Interface

v3.0.6 - v3.0.7 (stable)

  • Fixed CSS conflict issue where Dynamics 365 Online was making multi line text fields inside the showPrompt alerts have a larger font than expected
  • Moved the Alert._jQuery reference into the Alert.$ function, to ensure the correct jQuery reference is retrieved from the page, even if overwritten
  • Updated Alert.$ to get the jQuery reference from the top window first, to avoid other solutions overwriting the jQuery reference on the CRM window
  • Replaced unsupported Xrm.Internal.isUCI check with supported WebApi lookups

v3.0 - v3.0.5 (stable)

  • Added a new Alert.showPrompt function for easily capturing input of different types (see documentation for more detail)
  • Added a new Alert.getPromptResponses function for accessing field values from a prompt
  • Added support for nested/overlapping alerts with a new 'id' parameter on all functions (will overwrite existing alerts with the same id)
  • Updated styles to reflect v9.0 colours
  • Added new object constructor, which can be used alongside the new function constructors:
    • e.g. new Alert({ title: "Hello World", message: "Hello", width: 500, height: 300 }).show();
  • Added new function constructors to call all existing functions,
    • e.g. new Alert().title("Hello World").message("Hello").width(500).height(300).show();
    • Existing function calls still work using Alert.show() etc. however these will be deprecated in the future
  • Added the iFrame window context as the first and only parameter of the alert button callbacks when using Alert.showIFrame and Alert.showWebResource,
    • e.g. new Button("Close", function(iframeWindow) { alert(iframeWindow.document.getElementById("textbox").value); });
  • Added the prompt responses as the first and only parameter of the alert button callbacks when using Alert.showPrompt,
    • e.g. new Button("Update", function(responses) { Xrm.Page.getAttribute("name").setValue(responses[0].value); });
  • Updated showLoading function to include customizable options for things like title, message, icon, height, width
  • Added a fullscreen property
  • showIFrame now supports iframeContent as a second parameter to pass custom HTML in Chrome
  • Added allowDismiss to all alert types, allowing the user to click outside the alert to close it
  • Added a new .remove() function to completely delete the alert, rather than just hiding it
  • Deprecated baseUrl parameter - when being used outside of CRM forms/views the CSS should be loaded onto the page manually
  • Updated the Alert.show function to accept jQuery objects into the content parameter (previously called message)
  • Added an additional message parameter to go above the content (for showing a message with an iframe/prompt etc)
  • Added a new SEARCH icon type
  • Added official support for Alert.$ to access alert dialogs using jquery
  • Added a .get() function to return the jquery object for the alert

Looking for the download link? Request a trial to get the latest solution.