@resconet/jsbridge 19.1.1 → 19.2.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 +1 -1
- package/src/JSBridge.d.ts +7 -1
- package/src/JSBridge.js +8 -3
package/package.json
CHANGED
package/src/JSBridge.d.ts
CHANGED
|
@@ -529,7 +529,13 @@ declare namespace MobileCRM {
|
|
|
529
529
|
update(callback: (error: string) => void);
|
|
530
530
|
static createNew: (entityName: string, id?: string, primaryName?: string, properties?: any) => MobileCRM.DynamicEntity;
|
|
531
531
|
static deleteById(entityName: string, id: string, sucess?: () => void, failed?: (error: string) => void, scope?: any);
|
|
532
|
-
|
|
532
|
+
/**
|
|
533
|
+
* Asynchronously deletes the CRM entity record.
|
|
534
|
+
* @param entityName The logical name of the entity, e.g. "account".
|
|
535
|
+
* @param id GUID of the existing entity or null for new one.
|
|
536
|
+
* @param forceMode Whether to force the online or offline deletion regardless of current app mode.
|
|
537
|
+
*/
|
|
538
|
+
static deleteAsync(entityName: string, id: string, forceMode?: boolean): Promise<void>;
|
|
533
539
|
static loadById(
|
|
534
540
|
entityName: string,
|
|
535
541
|
id: string,
|
package/src/JSBridge.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-this-alias */
|
|
2
|
+
/* eslint-disable no-var */
|
|
2
3
|
/* globals MobileCRM:writable, MobileCrmException:writable, CrmBridge, webkit, chrome */
|
|
3
4
|
(function () {
|
|
4
5
|
var _scriptVersion = 19.1;
|
|
@@ -1200,7 +1201,7 @@
|
|
|
1200
1201
|
/// <param name="handler" type="function(data)">The handler function that is called when the scan event is raised.</param>
|
|
1201
1202
|
/// <param name="bind" type="Boolean">Indicates whether to bind the handler to the event.</param>
|
|
1202
1203
|
/// <param name="scope" type="Object">The scope in which the handler function is called.</param>
|
|
1203
|
-
|
|
1204
|
+
const handlerName = "onScan";
|
|
1204
1205
|
let handlers = MobileCRM.Services.ZebraScanner._handlers[handlerName];
|
|
1205
1206
|
|
|
1206
1207
|
if (!handlers) {
|
|
@@ -2342,12 +2343,16 @@
|
|
|
2342
2343
|
var cmdParams = JSON.stringify(request);
|
|
2343
2344
|
MobileCRM.bridge.command("entitydelete", cmdParams, success, failed, scope);
|
|
2344
2345
|
};
|
|
2345
|
-
MobileCRM.DynamicEntity.deleteAsync = function (entityName, id) {
|
|
2346
|
-
/// <summary>Asynchronously deletes the CRM entity.</summary>
|
|
2346
|
+
MobileCRM.DynamicEntity.deleteAsync = function (entityName, id, forceMode) {
|
|
2347
|
+
/// <summary>Asynchronously deletes the CRM entity record.</summary>
|
|
2347
2348
|
/// <param name="entityName" type="String">The logical name of the entity, e.g. "account".</param>
|
|
2348
2349
|
/// <param name="id" type="String">GUID of the existing entity or null for new one.</param>
|
|
2350
|
+
/// <param name="forceMode" type="Boolean">(Optional) Whether to force the online or offline deletion regardless of current app mode.</param>
|
|
2349
2351
|
/// <returns type="Promise<void>">A Promise object which will be resolved after the entity record is deleted.</returns>
|
|
2350
2352
|
var request = { entity: entityName, id: id };
|
|
2353
|
+
if (forceMode === true || forceMode === false) {
|
|
2354
|
+
request.isOnlineForce = forceMode;
|
|
2355
|
+
}
|
|
2351
2356
|
var cmdParams = JSON.stringify(request);
|
|
2352
2357
|
return MobileCRM.bridge.invokeCommandPromise("entitydelete", cmdParams);
|
|
2353
2358
|
};
|