diff --git a/src/JSBridge.d.ts b/src/JSBridge.d.ts index 9c735c8..e9ac83b 100644 --- a/src/JSBridge.d.ts +++ b/src/JSBridge.d.ts @@ -1,5 +1,5 @@ // JSBridge.js TypeScript definition file -// (c) 2022 Resco +// (c) 2023 Resco declare module MobileCRM { @@ -2559,6 +2559,7 @@ declare module MobileCRM.UI { source: MobileCRM.Relationship; dataSource: Array; allowNull: boolean; + initialTab: number; show(success: (obj?: MobileCRM.Reference) => void, failed?: (err: string) => void, scope?: any); showAsync(): Promise; diff --git a/src/JSBridge.js b/src/JSBridge.js index c256261..7332a2f 100644 --- a/src/JSBridge.js +++ b/src/JSBridge.js @@ -1,5 +1,5 @@ (function () { - var _scriptVersion = 16.0 + var _scriptVersion = 16.1 // Private objects & functions var _inherit = (function () { function _() { } @@ -744,6 +744,7 @@ /// The entity whose property will be set to the chosen value. /// The list of entities that should be displayed as selected. /// Whether to allow selecting no entity. + /// Optional index of the tab which has to be pre-selected - 0=All Items, 1=Selected Items (default). MobileCRM.UI.MultiLookupForm.superproto.constructor.apply(this, arguments); this.dataSource = []; }, @@ -3852,22 +3853,24 @@ return { entities: this.entities, source: this.source, prevSelection: this.prevSelection, allowedViews: xml, allowNull: this.allowNull, preventClose: this.preventClose }; }; - // MobileCRM.UI.MultiLookupForm - _inherit(MobileCRM.UI.MultiLookupForm, MobileCRM.UI.LookupForm); - MobileCRM.UI.MultiLookupForm.prototype.show = function (success, failed, scope) { - /// Shows a dialog which allows the user to select a list of entities from a configurable list of entity types. - /// The callback function that is called with chosen array of MobileCRM.Reference objects. - /// The errorCallback which is called asynchronously in case of error. - /// The scope for callbacks. - var params = this._constructParams(); - params.dataSource = this.dataSource; - MobileCRM.bridge.command("multiLookupForm", JSON.stringify(params), success, failed, scope); - }; + // MobileCRM.UI.MultiLookupForm + _inherit(MobileCRM.UI.MultiLookupForm, MobileCRM.UI.LookupForm); + MobileCRM.UI.MultiLookupForm.prototype.show = function (success, failed, scope) { + /// Shows a dialog which allows the user to select a list of entities from a configurable list of entity types. + /// The callback function that is called with chosen array of MobileCRM.Reference objects. + /// The errorCallback which is called asynchronously in case of error. + /// The scope for callbacks. + var params = this._constructParams(); + params.dataSource = this.dataSource; + params.initialTab = this.initialTab; + MobileCRM.bridge.command("multiLookupForm", JSON.stringify(params), success, failed, scope); + }; MobileCRM.UI.MultiLookupForm.prototype.showAsync = function () { /// Shows a dialog which allows the user to select a list of entities from a configurable list of entity types. /// A Promise object which will be resolved with an array of Reference objects representing chosen entity records. var params = this._constructParams(); params.dataSource = this.dataSource; + params.initialTab = this.initialTab; return MobileCRM.bridge.invokeCommandPromise("multiLookupForm", JSON.stringify(params)); };