@resconet/jsbridge 17.2.0-beta.1 → 18.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resconet/jsbridge",
3
- "version": "17.2.0-beta.1",
3
+ "version": "18.0.0-beta.1",
4
4
  "main": "./src/JSBridge.js",
5
5
  "types": "./src/JSBridge.d.ts",
6
6
  "description": "Install npm JSBridge module",
package/src/JSBridge.d.ts CHANGED
@@ -2128,7 +2128,21 @@ declare module MobileCRM.UI {
2128
2128
  */
2129
2129
  public static openSalesEntityDetail(detail: MobileCRM.DynamicEntity, errorCallback: (err?: string) => void);
2130
2130
  /**
2131
- * @ since 9.3
2131
+ * @since 18.0
2132
+ * The clearance must be dutifully released using leaveUiTransaction() when manipulation is finished.
2133
+ * The clearance will not be obtained if background sync is running and form sync behavior is configured to 'Block save during sync'
2134
+ * or 'Block save during sync and prevent sync while form is open'".
2135
+ * If form sync behavior is configured as 'No action', the clearance is always obtained.
2136
+ * @returns true if form can give the clearance, false if it is not possible at this time.
2137
+ */
2138
+ public static tryEnterUiTransaction(): Promise<boolean>;
2139
+ /**
2140
+ * @since 18.0
2141
+ * Notifies UI form that clearance obtained using successful call to tryEnterUiTransaction() is no longer needed, because data manipulation is complete.
2142
+ */
2143
+ public static leaveUiTransaction(): Promise;
2144
+ /**
2145
+ * @since 9.3
2132
2146
  * Binds or unbinds the handler for onSelectedViewChanged event on EntityForm.
2133
2147
  * @description Bound handler is called with the EntityForm object as an argument. The EntityForm context object contains 'selectedView' property with the name of currently selected view.
2134
2148
  * @param handler The handler function that has to be bound or unbound.
package/src/JSBridge.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-this-alias */
2
2
  /* globals MobileCRM:writable, MobileCrmException:writable, CrmBridge, webkit, chrome */
3
3
  (function () {
4
- var _scriptVersion = 17.1;
4
+ var _scriptVersion = 18.0;
5
5
  // Private objects & functions
6
6
  var _inherit = (function () {
7
7
  function _() {
@@ -1687,7 +1687,7 @@
1687
1687
  MobileCRM.GlobalConstants.getAllAsync = function () {
1688
1688
  /// <summary>Asynchronously returns the JSON object representing the GlobalConstants variables.</summary>
1689
1689
  /// <returns type="Promise&lt;Object&gt;">A Promise object that will be resolved with the properties representing the constant variables.</returns>
1690
- return MobileCRM.bridge.invokeCommandPromise("getGlobalConstants");
1690
+ return MobileCRM.bridge.invokeCommandPromise("getGlobalConstants", "");
1691
1691
  };
1692
1692
  MobileCRM.GlobalConstants.getAsync = function (key) {
1693
1693
  /// <summary>Asynchronously returns the constant associated with the specified key in the GlobalConstants variables.</summary>
@@ -5761,6 +5761,20 @@
5761
5761
  /// <param name="errorCallback" type="function(errorMsg)">The errorCallback which is called asynchronously in case of error.</param>
5762
5762
  MobileCRM.bridge.invokeMethodAsync("EntityForm", "ShowEntityDetailDialog", [detail.id], null, errorCallback, null);
5763
5763
  };
5764
+ /// <summary>[v18.0] Obtains a clearance to perform manipulation with data.
5765
+ /// The clearance must be dutifully released using leaveUiTransaction() when manipulation is finished.
5766
+ /// The clearance will not be obtained if background sync is running and form sync behavior is configured to 'Block save during sync'
5767
+ /// or 'Block save during sync and prevent sync while form is open'".
5768
+ /// If form sync behavior is configured as 'No action', the clearance is always obtained.
5769
+ /// </summary>
5770
+ /// <returns>Returns true if form can give the clearance, false if it is not possible at this time.</returns>
5771
+ MobileCRM.UI.EntityForm.tryEnterUiTransaction = function () {
5772
+ return MobileCRM.bridge.invokeCommandPromise("tryEnterUiTransaction");
5773
+ };
5774
+ /// <summary>[v18.0] Notifies UI form that clearance obtained using successful call to tryEnterUiTransaction() is no longer needed, because data manipulation is complete.</summary>
5775
+ MobileCRM.UI.EntityForm.leaveUiTransaction = function () {
5776
+ return MobileCRM.bridge.invokeCommandPromise("leaveUiTransaction");
5777
+ };
5764
5778
  // MobileCRM.UI.EntityForm.DetailCollection
5765
5779
  MobileCRM.UI.EntityForm.DetailCollection = function () {
5766
5780
  /// <summary>Provides functions accessing the collection of the sales entity details (e.g. Order details)</summary>