@resconet/jsbridge 18.2.0-beta.1 → 18.2.0-beta.3
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 +1 -1
- package/src/JSBridge.d.ts +48 -7
- package/src/JSBridge.js +81 -23
package/package.json
CHANGED
package/src/JSBridge.d.ts
CHANGED
|
@@ -512,6 +512,15 @@ declare namespace MobileCRM {
|
|
|
512
512
|
static loadDocumentBody(entityName: string, id: string, sucess: (base64: string) => void, failed?: (error: string) => void, scope?: any);
|
|
513
513
|
static loadDocumentBodyAsync(entityName: string, id: string): Promise<string>;
|
|
514
514
|
static unzipDocumentBody(entityName: string, id: string, targetDir: string, sucess?: () => void, failed?: (error: string) => void, scope?: any);
|
|
515
|
+
/**
|
|
516
|
+
* Asynchronously loads the content of a file field.
|
|
517
|
+
* @since 18.2
|
|
518
|
+
* @param entityName Logical name of entity containing the file field.
|
|
519
|
+
* @param id An ID of record containing the file field.
|
|
520
|
+
* @param fileFieldName Logical name of the file field.
|
|
521
|
+
* @param online Optional flag forcing the online or offline mode.
|
|
522
|
+
*/
|
|
523
|
+
static loadFileFieldContent(entityName: string, id: string, fileFieldName: string, online?: string): Promise<string>;
|
|
515
524
|
static downloadAttachment(entityName: string, id: string, sucess: (base64: string) => void, failed?: (error: string) => void, scope?: any);
|
|
516
525
|
static downloadAttachmentAsync(entityName: string, id: string): Promise<string>;
|
|
517
526
|
/**
|
|
@@ -749,6 +758,16 @@ declare namespace MobileCRM {
|
|
|
749
758
|
* @returns Promise resolved with Location object.
|
|
750
759
|
*/
|
|
751
760
|
public static getLocationAsync(age?: number, precision?: number, timeout?: number): Promise<Location>;
|
|
761
|
+
/**
|
|
762
|
+
* @since 18.2
|
|
763
|
+
* Registers or unregisters a handler for location updates.
|
|
764
|
+
* When the location is updated, the handler is called with a Location object representing new location.
|
|
765
|
+
* @param handler Handler function which will be called each time when the location is updated.
|
|
766
|
+
* @param bind Indicates whether to bind or unbind handler.
|
|
767
|
+
* @param scope Optional scope for calling the handler; set "null" to call the handler in global scope.
|
|
768
|
+
* @returns Promise resolved when the handler is registered or unregistered.
|
|
769
|
+
*/
|
|
770
|
+
public static watchLocationUpdates(handler: (obj: Location) => void, bind: boolean, scope?: any): Promise<void>;
|
|
752
771
|
public static requestObject(callback: (platform: Platform) => void, errorCallback: () => void, scope?: any);
|
|
753
772
|
/**
|
|
754
773
|
* @since 8.1
|
|
@@ -1893,13 +1912,21 @@ declare module MobileCRM.UI {
|
|
|
1893
1912
|
startEditItem(index: number);
|
|
1894
1913
|
/**
|
|
1895
1914
|
* @since 9.1
|
|
1896
|
-
* Changes the data source for ComboBoxItem {MobileCRM.UI.DetailViewItems.ComboBoxItem}
|
|
1915
|
+
* Changes the data source for ComboBoxItem {MobileCRM.UI.DetailViewItems.ComboBoxItem}.
|
|
1897
1916
|
* @param index Item index on the view.
|
|
1898
1917
|
* @param listDataSource The data source object (e.g. {label1 : 1, label2 : 2}).
|
|
1899
1918
|
* @param defaultValue New data source default value. If not defined, the first item from listDataSource will be used.
|
|
1900
1919
|
* @param valueType Type of list data source element value. Default is string, allowed int, string.
|
|
1901
1920
|
*/
|
|
1902
1921
|
updateComboItemDataSource(index: number, listDataSource: any, defaultValue?: string, valueType?: string);
|
|
1922
|
+
/**
|
|
1923
|
+
* @since 18.1
|
|
1924
|
+
* Filters allowed StringList options in LinkItem {MobileCRM.UI.DetailViewItems.LinkItem}.
|
|
1925
|
+
* @param index Item index on the view.
|
|
1926
|
+
* @param allowedOptions An array with options to be allowed (e.g. ["Option1", "Option2"]).
|
|
1927
|
+
* @param defaultValue New data source default value. If not defined, the first item from allowedOptions will be used. Ignored, if value isn't in allowedOptions.
|
|
1928
|
+
*/
|
|
1929
|
+
filterStringListOptions(index: number, allowedOptions: string[], defaultValue?: string);
|
|
1903
1930
|
/**
|
|
1904
1931
|
* @since 10.1
|
|
1905
1932
|
* Changes the data source for MobileCRM.UI.DetailViewItems.ComboBoxItem.
|
|
@@ -2163,6 +2190,16 @@ declare module MobileCRM.UI {
|
|
|
2163
2190
|
* @returns A promise resolved with boolean result of native field setter.
|
|
2164
2191
|
*/
|
|
2165
2192
|
public static setFieldValues(changes: { [fieldName: string]: any }): Promise<boolean>;
|
|
2193
|
+
/**
|
|
2194
|
+
* Sets the file field content and file name on entity record shown on this EntityForm.
|
|
2195
|
+
* Setting file field content is possible only in offline mode. This method fails in online mode.
|
|
2196
|
+
* @since 18.2
|
|
2197
|
+
* @param fileFieldName Logical name of the file field that has to be changed.
|
|
2198
|
+
* @param documentFileName A file name that should be used when presenting the binary content.
|
|
2199
|
+
* @param documentContent Base64-encoded binary file content.
|
|
2200
|
+
* @returns A promise resolved with boolean result of native field setter.
|
|
2201
|
+
*/
|
|
2202
|
+
public static setFileFieldContent(fileFieldName: string, documentFileName: string, documentContent: string);
|
|
2166
2203
|
/**
|
|
2167
2204
|
* Binds or unbinds the handler for EntityForm command.
|
|
2168
2205
|
* @param command The name of the EntityForm command.
|
|
@@ -2217,18 +2254,22 @@ declare module MobileCRM.UI {
|
|
|
2217
2254
|
public static openSalesEntityDetail(detail: MobileCRM.DynamicEntity, errorCallback: (err?: string) => void);
|
|
2218
2255
|
/**
|
|
2219
2256
|
* @since 18.0
|
|
2220
|
-
*
|
|
2221
|
-
* The clearance will
|
|
2222
|
-
* or 'Block save during sync and prevent sync while form is open'".
|
|
2223
|
-
*
|
|
2257
|
+
* Provides means to control concurrent access to data by form logic and background sync.
|
|
2258
|
+
* This method obtains a clearance to perform data manipulation. The clearance will be obtained when background sync is not running, or form sync behavior is configured as 'No action'.
|
|
2259
|
+
* If background sync is running and form sync behavior is configured to 'Block save during sync' or 'Block save during sync and prevent sync while form is open'", the clearance is not obtained.
|
|
2260
|
+
* Each obtained clearance must be dutifully released using leaveUiTransaction().
|
|
2261
|
+
* It is possible to call this method multiple times, but each call reserves its own internal clearance, so there must be the same number of calls to leaveUiTransaction to properly release clearance and allow background sync.
|
|
2224
2262
|
* @returns true if form can give the clearance, false if it is not possible at this time.
|
|
2225
2263
|
*/
|
|
2226
2264
|
public static tryEnterUiTransaction(): Promise<boolean>;
|
|
2227
2265
|
/**
|
|
2228
2266
|
* @since 18.0
|
|
2229
|
-
*
|
|
2267
|
+
* Provides means to control concurrent access to data by form logic and background sync.
|
|
2268
|
+
* This method releases the last clearance obtained by successful call to tryEnterUiTransaction.
|
|
2269
|
+
* Can be called even if all clearances are already released or were not obtained at all.
|
|
2270
|
+
* See tryEnterUiTransaction for more info.
|
|
2230
2271
|
*/
|
|
2231
|
-
public static leaveUiTransaction(): Promise
|
|
2272
|
+
public static leaveUiTransaction(): Promise<void>;
|
|
2232
2273
|
/**
|
|
2233
2274
|
* @since 9.3
|
|
2234
2275
|
* Binds or unbinds the handler for onSelectedViewChanged event on EntityForm.
|
package/src/JSBridge.js
CHANGED
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
/// <field name="bridge" type="MobileCRM.Bridge">Singleton instance of <see cref="MobileCRM.Bridge">MobileCRM.Bridge</see> providing the management of the Javascript/native code cross-calls.</field>
|
|
194
194
|
bridge: null,
|
|
195
195
|
Bridge: function (platform) {
|
|
196
|
-
/// <summary>Provides the management of the Javascript/native code cross-calls. Its only instance <see cref="
|
|
196
|
+
/// <summary>Provides the management of the Javascript/native code cross-calls. Its only instance <see cref="MobileCRM.bridge">MobileCRM.bridge</see> is created immediately after the "JSBridge.js" script is loaded.</summary>
|
|
197
197
|
/// <param name="platform" type="String">A platform name</param>
|
|
198
198
|
/// <field name="platform" type="String">A string identifying the device platform (e.g. Android, iOS, Windows, WindowsRT, Windows10 or WindowsPhone).</field>
|
|
199
199
|
/// <field name="version" type="Number">A number identifying the version of the JSBridge. This is the version of the script which might not match the version of the application part of the bridge implementation. Application version must be equal or higher than the script version.</field>
|
|
@@ -821,7 +821,7 @@
|
|
|
821
821
|
},
|
|
822
822
|
DetailViewItems: {
|
|
823
823
|
Item: function (name, label) {
|
|
824
|
-
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView"
|
|
824
|
+
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> item.</summary>
|
|
825
825
|
/// <param name="name" type="String">Defines the item name.</param>
|
|
826
826
|
/// <param name="label" type="String">Defines the item label.</param>
|
|
827
827
|
/// <field name="name" type="String">Gets or sets the item name.</field>
|
|
@@ -840,14 +840,14 @@
|
|
|
840
840
|
this.label = label;
|
|
841
841
|
},
|
|
842
842
|
SeparatorItem: function (name, label) {
|
|
843
|
-
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView"
|
|
843
|
+
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> separator item.</summary>
|
|
844
844
|
/// <param name="name" type="String">Defines the item name.</param>
|
|
845
845
|
/// <param name="label" type="String">Defines the item label.</param>
|
|
846
846
|
MobileCRM.UI.DetailViewItems.SeparatorItem.superproto.constructor.apply(this, arguments);
|
|
847
847
|
this._type = "Separator";
|
|
848
848
|
},
|
|
849
849
|
TextBoxItem: function (name, label) {
|
|
850
|
-
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView"
|
|
850
|
+
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> text item.</summary>
|
|
851
851
|
/// <param name="name" type="String">Defines the item name.</param>
|
|
852
852
|
/// <param name="label" type="String">Defines the item label.</param>
|
|
853
853
|
/// <field name="numberOfLines" type="Number">Gets or sets the number of lines to display. Default is one.</field>
|
|
@@ -859,7 +859,7 @@
|
|
|
859
859
|
this._type = "TextBox";
|
|
860
860
|
},
|
|
861
861
|
NumericItem: function (name, label) {
|
|
862
|
-
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView"
|
|
862
|
+
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> numeric item.</summary>
|
|
863
863
|
/// <param name="name" type="String">Defines the item name.</param>
|
|
864
864
|
/// <param name="label" type="String">Defines the item label.</param>
|
|
865
865
|
/// <field name="minimum" type="Number">Gets or sets the minimum allowed value.</field>
|
|
@@ -878,7 +878,7 @@
|
|
|
878
878
|
//this.displayFormat = "";
|
|
879
879
|
},
|
|
880
880
|
CheckBoxItem: function (name, label) {
|
|
881
|
-
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView"
|
|
881
|
+
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> checkbox item.</summary>
|
|
882
882
|
/// <param name="name" type="String">Defines the item name.</param>
|
|
883
883
|
/// <param name="label" type="String">Defines the item label.</param>
|
|
884
884
|
/// <field name="textChecked" type="String">Gets or sets the text for checked state.</field>
|
|
@@ -888,7 +888,7 @@
|
|
|
888
888
|
this.isNullable = false;
|
|
889
889
|
},
|
|
890
890
|
DateTimeItem: function (name, label) {
|
|
891
|
-
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView"
|
|
891
|
+
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> date/time item.</summary>
|
|
892
892
|
/// <param name="name" type="String">Defines the item name.</param>
|
|
893
893
|
/// <param name="label" type="String">Defines the item label.</param>
|
|
894
894
|
/// <field name="minimum" type="Date">Gets or sets the minimum allowed value.</field>
|
|
@@ -898,14 +898,14 @@
|
|
|
898
898
|
this._type = "DateTime";
|
|
899
899
|
},
|
|
900
900
|
DurationItem: function (name, label) {
|
|
901
|
-
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView"
|
|
901
|
+
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> duration item.</summary>
|
|
902
902
|
/// <param name="name" type="String">Defines the item name.</param>
|
|
903
903
|
/// <param name="label" type="String">Defines the item label.</param>
|
|
904
904
|
MobileCRM.UI.DetailViewItems.DurationItem.superproto.constructor.apply(this, arguments);
|
|
905
905
|
this._type = "Duration";
|
|
906
906
|
},
|
|
907
907
|
ComboBoxItem: function (name, label) {
|
|
908
|
-
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView"
|
|
908
|
+
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> combobox item.</summary>
|
|
909
909
|
/// <param name="name" type="String">Defines the item name.</param>
|
|
910
910
|
/// <param name="label" type="String">Defines the item label.</param>
|
|
911
911
|
/// <field name="listDataSource" type="Object">Gets or sets the object with props and values to be displayed in the combo list (e.g. {"label1":1, "label2":2}).</field>
|
|
@@ -914,7 +914,7 @@
|
|
|
914
914
|
this._type = "ComboBox";
|
|
915
915
|
},
|
|
916
916
|
LinkItem: function (name, label, listDropDownFormat) {
|
|
917
|
-
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView"
|
|
917
|
+
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> link item.</summary>
|
|
918
918
|
/// <param name="name" type="String">Defines the item name.</param>
|
|
919
919
|
/// <param name="label" type="String">Defines the item label.</param>
|
|
920
920
|
/// <param name="listDropDownFormat" type="MobileCRM.UI.DetailViewItems.DropDownFormat">Defines item's drop down format.</param>
|
|
@@ -926,7 +926,7 @@
|
|
|
926
926
|
}
|
|
927
927
|
},
|
|
928
928
|
ButtonItem: function (name, clickText) {
|
|
929
|
-
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView"
|
|
929
|
+
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> duration item.</summary>
|
|
930
930
|
/// <param name="name" type="String">Defines the item name.</param>
|
|
931
931
|
/// <param name="clickText" type="String">Gets or sets the text content of click button.</param>
|
|
932
932
|
/// <param name="label" type="String">Defines the item label.</param>
|
|
@@ -944,7 +944,7 @@
|
|
|
944
944
|
MultiStringListInput: 20,
|
|
945
945
|
},
|
|
946
946
|
GridItem: function (name, label, gridStyleDefintion) {
|
|
947
|
-
/// <summary>[13.0] Represents the <see cref="MobileCRM.UI._DetailView"
|
|
947
|
+
/// <summary>[13.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> grid item.</summary>
|
|
948
948
|
/// <param name="name" type="String">Defines the item name.</param>
|
|
949
949
|
/// <param name="label" type="String">Defines the item label.</param>
|
|
950
950
|
/// <param name="gridStyleDefintion" type="MobileCRM.UI.DetailViewItems.GridStyleDefintion">Gets or sets the style definition for grid item.</param>
|
|
@@ -965,7 +965,7 @@
|
|
|
965
965
|
DetailGridLength: function (value, gridUnitType) {
|
|
966
966
|
/// <summary>[13.0] Represents the grid length in grid unit type.</summary>
|
|
967
967
|
/// <param name="value" type="String">Grid length value.</param>
|
|
968
|
-
/// <param name="gridUnitType" type="MobileCRM.UI.DetailViewItems.DetailGridUnitType">Defines the grid <see cref="MobileCRM.UI.DetailViewItems.DetailGridUnitType"
|
|
968
|
+
/// <param name="gridUnitType" type="MobileCRM.UI.DetailViewItems.DetailGridUnitType">Defines the grid <see cref="MobileCRM.UI.DetailViewItems.DetailGridUnitType">MobileCRM.UI.DetailViewItems.DetailGridUnitType</see> unit type.</param>
|
|
969
969
|
this._value = value;
|
|
970
970
|
this._gridUnitType = gridUnitType;
|
|
971
971
|
},
|
|
@@ -1136,7 +1136,7 @@
|
|
|
1136
1136
|
/// <field name="realtimeFlushing" type="Boolean">Indicates whether the events should be delivered realtime using Resco forwarding service.</field>
|
|
1137
1137
|
/// <field name="logLevel" type="number">Defines logging verbosity (0=Normal, 1=Diagnostic, -1=None)</field>
|
|
1138
1138
|
/// <field name="notificationMask" type="number">Defines event mask for showing notifications (0=None, 1=WhenArrived, 2=WhenExited, 3=Always)</field>
|
|
1139
|
-
/// <field name="businessHours" type="String">Business hours interval (e.g.
|
|
1139
|
+
/// <field name="businessHours" type="String">Business hours interval (e.g. '9:00-17:00')</field>
|
|
1140
1140
|
/// <field name="businessDaysMask" type="number">Business days mask (the lowest bit is Sunday, the next Monday, ...)</field>
|
|
1141
1141
|
this.isEnabled = false;
|
|
1142
1142
|
this.realtimeFlushing = true;
|
|
@@ -2426,6 +2426,22 @@
|
|
|
2426
2426
|
/// <param name="scope" type="">A scope for calling the callbacks; set "null" to call the callbacks in global scope.</param>
|
|
2427
2427
|
MobileCRM.bridge.command("documentBodyUnzip", targetDir + ";" + JSON.stringify({ entity: entityName, id: id }), success, failed, scope);
|
|
2428
2428
|
};
|
|
2429
|
+
MobileCRM.DynamicEntity.loadFileFieldContent = function (entityName, id, fileFieldName, online) {
|
|
2430
|
+
/// <summary>[18.2] Asynchronously loads the content of a file field.
|
|
2431
|
+
/// <param name="entityName" type="String">Logical name of entity containing the file field.</param>
|
|
2432
|
+
/// <param name="id" type="String">An ID of record containing the file field.</param>
|
|
2433
|
+
/// <param name="fileFieldName" type="String">Logical name of the file field.</param>
|
|
2434
|
+
// <param name="online" type="boolean|undefined">Optional flag forcing the online or offline mode.</param>
|
|
2435
|
+
return MobileCRM.bridge.invokeCommandPromise(
|
|
2436
|
+
"loadFileFieldContent",
|
|
2437
|
+
JSON.stringify({
|
|
2438
|
+
entityName: entityName,
|
|
2439
|
+
id: id,
|
|
2440
|
+
fileField: fileFieldName,
|
|
2441
|
+
online: online,
|
|
2442
|
+
})
|
|
2443
|
+
);
|
|
2444
|
+
};
|
|
2429
2445
|
MobileCRM.DynamicEntity.downloadAttachment = function (entityName, id, success, failed, scope) {
|
|
2430
2446
|
/// <summary>[v9.1] Initiates the attachment download for specified entity.</summary>
|
|
2431
2447
|
/// <remarks>Function sends an asynchronous request to application, which downloads the document body (e.g. the annotation) from server and sends it back to the Javascript callback.</remarks>
|
|
@@ -3198,6 +3214,26 @@
|
|
|
3198
3214
|
}
|
|
3199
3215
|
return MobileCRM.bridge.invokeCommandPromise("getLocation", JSON.stringify(params));
|
|
3200
3216
|
};
|
|
3217
|
+
MobileCRM.Platform._watchLocationHandlers = [];
|
|
3218
|
+
MobileCRM.Platform.watchLocationUpdates = function (handler, bind, scope) {
|
|
3219
|
+
/// <summary>[v18.2] Registers or unregisters a handler for location updates.</summary>
|
|
3220
|
+
/// <remarks>When the location is updated, the handler is called with a <see cref="MobileCRM.Location">MobileCRM.Location</see> object having <b>latitude</b>, <b>longitude</b> and <b>timestamp</b> properties.</remarks>
|
|
3221
|
+
/// <param name="handler" type="function(location)">Handler function which will be called each time when the location is updated. The <b>location</b> argument will carry an object with <b>latitude</b>, <b>longitude</b> and <b>timestamp</b> properties.</param>
|
|
3222
|
+
/// <param name="bind" type="Boolean">Indicates whether to bind or unbind handler.</param>
|
|
3223
|
+
/// <param name="scope" type="">Optional scope for calling the handler; set "null" to call the handler in global scope.</param>
|
|
3224
|
+
/// <returns type="Promise<void>">A Promise object which will be resolved when the handler is successfully bound/unbound.</returns>
|
|
3225
|
+
var register = bind && MobileCRM.Platform._watchLocationHandlers.length == 0;
|
|
3226
|
+
_bindHandler(handler, MobileCRM.Platform._watchLocationHandlers, bind, scope);
|
|
3227
|
+
if (register) {
|
|
3228
|
+
return MobileCRM.bridge.invokeCommandPromise("watchLocation", JSON.stringify({ active: true }));
|
|
3229
|
+
} else if (!bind && MobileCRM.Platform._watchLocationHandlers.length == 0) {
|
|
3230
|
+
return MobileCRM.bridge.invokeCommandPromise("watchLocation", JSON.stringify({ active: false }));
|
|
3231
|
+
}
|
|
3232
|
+
return Promise.resolve();
|
|
3233
|
+
};
|
|
3234
|
+
MobileCRM.Platform._callLocationHandlers = function (location) {
|
|
3235
|
+
_callHandlers(MobileCRM.Platform._watchLocationHandlers, location);
|
|
3236
|
+
};
|
|
3201
3237
|
MobileCRM.Platform.preventBackButton = function (handler, scope) {
|
|
3202
3238
|
/// <summary>Prevents application to close when HW back button is pressed and installs handler which is called instead.</summary>
|
|
3203
3239
|
/// <remarks><p>Pass "null" handler to allow the HW back button.</p><p>Works only under OS having HW back button (Android, Windows 10).</p></remarks>
|
|
@@ -3915,7 +3951,7 @@
|
|
|
3915
3951
|
/// <param name="index" type="Number">Item index on the view.</param>
|
|
3916
3952
|
/// <param name="listDataSource" type="Object">The data source object (e.g. {"label1":1, "label2":2}).</param>
|
|
3917
3953
|
/// <param name="valueType" type="String">Type of list data source element value. Default is string, allowed int, string.</param>
|
|
3918
|
-
/// <param name="defaultValue" type="String">New data source default value. If not defined, the first item from listDataSource will be used.</param>
|
|
3954
|
+
/// <param name="defaultValue" type="String|Number">New data source default value. If not defined, the first item from listDataSource will be used.</param>
|
|
3919
3955
|
var data = {
|
|
3920
3956
|
action: "updateDataSource",
|
|
3921
3957
|
viewName: this.name,
|
|
@@ -3928,6 +3964,20 @@
|
|
|
3928
3964
|
//this.items[index].value = defaultValue !== undefined ? defaultValue : listDataSource[Object.keys(listDataSource)[0]];
|
|
3929
3965
|
MobileCRM.bridge.command("detailViewAction", JSON.stringify(data));
|
|
3930
3966
|
};
|
|
3967
|
+
MobileCRM.UI._DetailView.prototype.filterStringListOptions = function (index, allowedOptions, defaultValue) {
|
|
3968
|
+
/// <summary>[v18.1] Filters allowed StringList options in <see cref="MobileCRM.UI.DetailViewItems.Item">MobileCRM.UI.DetailViewItems.LinkItem</see>.</summary>
|
|
3969
|
+
/// <param name="index" type="Number">Item index on the view.</param>
|
|
3970
|
+
/// <param name="allowedOptions" type="string[]">An array with options to be allowed (e.g. ["New", "Completed"]).</param>
|
|
3971
|
+
/// <param name="defaultValue" type="String">New data source default value. If not defined, the first item from allowedOptions will be used. Ignored, if value isn't in allowedOptions.</param>
|
|
3972
|
+
var data = {
|
|
3973
|
+
action: "filterStringList",
|
|
3974
|
+
viewName: this.name,
|
|
3975
|
+
index: index,
|
|
3976
|
+
filterOptions: allowedOptions,
|
|
3977
|
+
value: defaultValue || allowedOptions[0],
|
|
3978
|
+
};
|
|
3979
|
+
MobileCRM.bridge.command("detailViewAction", JSON.stringify(data));
|
|
3980
|
+
};
|
|
3931
3981
|
MobileCRM.UI._DetailView.prototype.updateLinkItemViews = function (index, dialogSetup, inlinePickSetup, dialogOnly, allowCreateNew) {
|
|
3932
3982
|
/// <summary>[v10.1] Changes the <see cref="MobileCRM.UI.DetailViewItems.ComboBoxItem">ComboBoxItem</see> views and/or filters.</summary>
|
|
3933
3983
|
/// <param name="index" type="Number">Item index on the view.</param>
|
|
@@ -5766,6 +5816,18 @@
|
|
|
5766
5816
|
/// <returns type="Promise<boolean>">A promise resolved with boolean result of native field setter.</returns>
|
|
5767
5817
|
return MobileCRM.bridge.invokeCommandPromise("setFormEntityFields", JSON.stringify(changes));
|
|
5768
5818
|
};
|
|
5819
|
+
MobileCRM.UI.EntityForm.setFileFieldContent = function (fileFieldName, documentFileName, documentContent) {
|
|
5820
|
+
/// <summary>[v18.2] Sets the file field content and file name on entity record shown on this EntityForm.</summary>
|
|
5821
|
+
/// <remarks>Setting file field content is possible only in offline mode. This method fails in online mode.</remarks>
|
|
5822
|
+
/// <param name="fieldName" type="String">Logical name of the file field that has to be changed.</param>
|
|
5823
|
+
/// <param name="documentFileName" type="String">A file name that should be used when presenting the binary content.</param>
|
|
5824
|
+
/// <param name="documentContent" type="String">Base64-encoded binary file content.</param>
|
|
5825
|
+
/// <returns type="Promise<boolean>">A promise resolved with boolean result of native field setter.</returns>
|
|
5826
|
+
var obj = {};
|
|
5827
|
+
obj[fileFieldName + "_name"] = documentFileName;
|
|
5828
|
+
obj[fileFieldName] = documentContent;
|
|
5829
|
+
return MobileCRM.UI.EntityForm.setFieldValues(obj);
|
|
5830
|
+
};
|
|
5769
5831
|
MobileCRM.UI.EntityForm.requestObject = function (callback, errorCallback, scope) {
|
|
5770
5832
|
/// <summary>Requests the managed EntityForm object.</summary>
|
|
5771
5833
|
/// <remarks>Method initiates an asynchronous request which either ends with calling the <b>errorCallback</b> or with calling the <b>callback</b> with Javascript version of EntityForm object. See <see cref="MobileCRM.Bridge.requestObject">MobileCRM.Bridge.requestObject</see> for further details.</remarks>
|
|
@@ -5907,18 +5969,14 @@
|
|
|
5907
5969
|
/// <param name="errorCallback" type="function(errorMsg)">The errorCallback which is called asynchronously in case of error.</param>
|
|
5908
5970
|
MobileCRM.bridge.invokeMethodAsync("EntityForm", "ShowEntityDetailDialog", [detail.id], null, errorCallback, null);
|
|
5909
5971
|
};
|
|
5910
|
-
/// <summary>[v18.0] Obtains a clearance to perform manipulation with data.
|
|
5911
|
-
/// The clearance must be dutifully released using leaveUiTransaction() when manipulation is finished.
|
|
5912
|
-
/// The clearance will not be obtained if background sync is running and form sync behavior is configured to 'Block save during sync'
|
|
5913
|
-
/// or 'Block save during sync and prevent sync while form is open'".
|
|
5914
|
-
/// If form sync behavior is configured as 'No action', the clearance is always obtained.
|
|
5915
|
-
/// </summary>
|
|
5916
|
-
/// <returns>Returns true if form can give the clearance, false if it is not possible at this time.</returns>
|
|
5917
5972
|
MobileCRM.UI.EntityForm.tryEnterUiTransaction = function () {
|
|
5973
|
+
/// <summary>[v18.0] Provides means to control concurrent access to data by form logic and background sync. This method obtains a clearance to perform data manipulation. The clearance will be obtained when background sync is not running, or form sync behavior is configured as 'No action'. If background sync is running and form sync behavior is configured to 'Block save during sync' or 'Block save during sync and prevent sync while form is open'", the clearance is not obtained. Each obtained clearance must be dutifully released using leaveUiTransaction(). It is possible to call this method multiple times, but each call reserves its own internal clearance, so there must be the same number of calls to leaveUiTransaction to properly release clearance and allow background sync.</summary>
|
|
5974
|
+
/// <returns type="Promise<boolean>">Returns true if clearance is obtained, false if it is not possible at this time.</returns>
|
|
5918
5975
|
return MobileCRM.bridge.invokeCommandPromise("tryEnterUiTransaction");
|
|
5919
5976
|
};
|
|
5920
|
-
/// <summary>[v18.0] Notifies UI form that clearance obtained using successful call to tryEnterUiTransaction() is no longer needed, because data manipulation is complete.</summary>
|
|
5921
5977
|
MobileCRM.UI.EntityForm.leaveUiTransaction = function () {
|
|
5978
|
+
/// <summary>[v18.0] Provides means to control concurrent access to data by form logic and background sync. This method releases the last clearance obtained by successful call to tryEnterUiTransaction. Can be called even if all clearances are already released or were not obtained at all. See tryEnterUiTransaction for more info.</summary>
|
|
5979
|
+
/// <returns type="Promise<void>">Returns an awaitable promise.</returns>
|
|
5922
5980
|
return MobileCRM.bridge.invokeCommandPromise("leaveUiTransaction");
|
|
5923
5981
|
};
|
|
5924
5982
|
// MobileCRM.UI.EntityForm.DetailCollection
|