@resconet/jsbridge 19.1.0-beta.1 → 19.1.0
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 +72 -0
- package/src/JSBridge.js +91 -10
package/package.json
CHANGED
package/src/JSBridge.d.ts
CHANGED
|
@@ -731,6 +731,21 @@ declare namespace MobileCRM {
|
|
|
731
731
|
* @param scope Handler scope
|
|
732
732
|
*/
|
|
733
733
|
public static preventBackButton(handler: () => void, scope?: any);
|
|
734
|
+
/**
|
|
735
|
+
* Shows a platform-specific toast window over the app window which is dismissed after a few seconds.
|
|
736
|
+
* @param message A toast content message.
|
|
737
|
+
* @param icon Valid app image name (e.g. Home.Now.png).
|
|
738
|
+
*/
|
|
739
|
+
public static showToast(message: string, icon: string): Promise<void>;
|
|
740
|
+
/**
|
|
741
|
+
* Shows a platform-specific alert window with specified text and buttons. Resolves to the pressed button name.
|
|
742
|
+
* @param text The message text to display.
|
|
743
|
+
* @param multiLine If true, the message text will be displayed with larger height and the text will be wrapped.
|
|
744
|
+
* @param defaultButton The default button caption. If not specified, there is no default button.
|
|
745
|
+
* @param buttons An array of button captions to display. If not specified, only default button or OK button is shown.
|
|
746
|
+
*/
|
|
747
|
+
public static showAlert(text: string, multiLine?: boolean, defaultButton?: string, buttons?: Array<string>): Promise<string>;
|
|
748
|
+
|
|
734
749
|
public static scanBarCode(success: (barCode: string) => void, failed?: (error: string) => void, scope?: any);
|
|
735
750
|
/**
|
|
736
751
|
* Gets current geo-location from platform-specific location service.
|
|
@@ -854,12 +869,36 @@ declare namespace MobileCRM {
|
|
|
854
869
|
}
|
|
855
870
|
|
|
856
871
|
class Application {
|
|
872
|
+
/**
|
|
873
|
+
* Starts background/foreground sync if not synchronized or the last sync was before desired limit.
|
|
874
|
+
* @param backgroundOnly if true, only the background sync is allowed; otherwise it can also run the foreground sync.
|
|
875
|
+
* @param ifNotSyncedBefore Defines a time limit required for the last sync. Starts the sync only if wasn"t done yet or if it was before this limit. If it is null or undefined, sync is done always.
|
|
876
|
+
*/
|
|
857
877
|
static synchronize(backgroundOnly: boolean, ifNotSyncedBefore: Date);
|
|
878
|
+
/**
|
|
879
|
+
* Starts the synchronization on foreground (closes all form if possible and showing the standard progress).
|
|
880
|
+
* @param forceLogin if true, the sync dialog with URL and credentials will be opened; otherwise it is opened only if the password is not saved.
|
|
881
|
+
*/
|
|
858
882
|
static synchronizeOnForeground(forceLogin: boolean);
|
|
883
|
+
/**
|
|
884
|
+
* Binds the new handler to the synchronization finish event.
|
|
885
|
+
* @since 8.1
|
|
886
|
+
* @param handler A function which will be called when the synchronization finished event occurs.
|
|
887
|
+
* @param scope A scope in which the handler should be called.
|
|
888
|
+
*/
|
|
889
|
+
static onSyncFinished(handler: (homeForm: HomeForm) => void, scope?: any);
|
|
890
|
+
/** Starts pre-defined or custom SmartSync definition.
|
|
891
|
+
* @since 19.1
|
|
892
|
+
* @param name The name of SmartSync configuration as defined in Woodford.
|
|
893
|
+
* @returns A Promise resolved when the SmartSync was initiated.
|
|
894
|
+
*/
|
|
895
|
+
static startSmartSync(name: string): Promise<void>;
|
|
859
896
|
static getAppColor(colName: string, success: (url: string) => void, failed?: (err: string) => void, scope?: any);
|
|
860
897
|
static getAppImage(imageName: string, colorize: string, success: (url: string) => void, failed?: (err: string) => void, scope?: any);
|
|
861
898
|
/** Display application login form. */
|
|
862
899
|
static showAppLogin();
|
|
900
|
+
/** Closes all forms and shows the setup screen. */
|
|
901
|
+
static showSetup();
|
|
863
902
|
/**
|
|
864
903
|
* Sets the application colors.
|
|
865
904
|
* @since 11.2.2
|
|
@@ -1112,6 +1151,7 @@ declare namespace MobileCRM {
|
|
|
1112
1151
|
/**
|
|
1113
1152
|
* @since 10.1
|
|
1114
1153
|
* Shows new MobileReport form. Source for the report can be defined either as list of MobileCRM.Reference objects or as FetchXML query.
|
|
1154
|
+
* This method is not available under Essential license.
|
|
1115
1155
|
* @param report Optional reference to the resco_mobilereport entity that will be pre-selected.
|
|
1116
1156
|
* @param source The list of entity references used as report input.
|
|
1117
1157
|
* @param fetchXml The fetch XML defining the entity (entities) query used as report input.
|
|
@@ -1122,6 +1162,7 @@ declare namespace MobileCRM {
|
|
|
1122
1162
|
/**
|
|
1123
1163
|
* @since 16.0
|
|
1124
1164
|
* Shows new MobileReport form. Source for the report can be defined either as list of MobileCRM.Reference objects or as FetchXML query.
|
|
1165
|
+
* This method is not available under Essential license.
|
|
1125
1166
|
* @param report Optional reference to the resco_mobilereport entity that will be pre-selected.
|
|
1126
1167
|
* @param source The list of entity references used as report input.
|
|
1127
1168
|
* @param fetchXml The fetch XML defining the entity (entities) query used as report input.
|
|
@@ -1141,6 +1182,17 @@ declare namespace MobileCRM {
|
|
|
1141
1182
|
class Questionnaire {
|
|
1142
1183
|
static getQuestionName(name: string, repeatIndex: number): string;
|
|
1143
1184
|
static getGroupName(name: string, repeatIndex: number): string;
|
|
1185
|
+
/**
|
|
1186
|
+
* Shows the questionnaire form.
|
|
1187
|
+
* This method is not available under Essential license.
|
|
1188
|
+
* @since 10.2
|
|
1189
|
+
* @param id The ID of the questionnaire record to show.
|
|
1190
|
+
* @param failed A callback which is called in case of error.
|
|
1191
|
+
* @param scope The scope for callbacks.
|
|
1192
|
+
* @param relationship Optional relationship with the parent record.
|
|
1193
|
+
* @param modal Indicates whether to open the form as modal. The default is false.
|
|
1194
|
+
* @param version Optional parameter for setting the Questionnaire player version to execute the questionnaire. Default is 1.
|
|
1195
|
+
*/
|
|
1144
1196
|
static showForm(
|
|
1145
1197
|
id: string,
|
|
1146
1198
|
failed?: (err: string) => void,
|
|
@@ -1911,6 +1963,18 @@ declare module MobileCRM.UI {
|
|
|
1911
1963
|
*/
|
|
1912
1964
|
registerClickHandler(item: MobileCRM.UI._DetailItemLink, callback: (itemName: string, detailViewName: string) => void, scope?: any);
|
|
1913
1965
|
startEditItem(index: number);
|
|
1966
|
+
/**
|
|
1967
|
+
* @since 19.1
|
|
1968
|
+
* Executes the detail item specific action, e.g. scan barcode.
|
|
1969
|
+
* @param index Selected item index.
|
|
1970
|
+
*/
|
|
1971
|
+
executeItemAction(index: number): void;
|
|
1972
|
+
/**
|
|
1973
|
+
* @since 19.1
|
|
1974
|
+
* Gets the content of detail item as string, e.g. base64 encoded binary data of image item.
|
|
1975
|
+
* @param itemName The name of the detail item.
|
|
1976
|
+
*/
|
|
1977
|
+
getItemContentAsync(itemName: string): Promise<string>;
|
|
1914
1978
|
/**
|
|
1915
1979
|
* @since 9.1
|
|
1916
1980
|
* Changes the data source for ComboBoxItem {MobileCRM.UI.DetailViewItems.ComboBoxItem}.
|
|
@@ -2691,6 +2755,14 @@ declare module MobileCRM.UI {
|
|
|
2691
2755
|
* @param scope A scope for calling the callbacks.
|
|
2692
2756
|
*/
|
|
2693
2757
|
public static focusQuestion(questionName: string, errorCallback?: (err: string) => void, scope?: any);
|
|
2758
|
+
/**
|
|
2759
|
+
* @since 19.1
|
|
2760
|
+
* Asynchronously focuses the question and executes its operations, e.g. Scan Barcode, Run OCR, etc...
|
|
2761
|
+
* @param questionName A name of the question.
|
|
2762
|
+
* @param errorCallback A callback which is called in case of error.
|
|
2763
|
+
* @param scope A scope for calling the callbacks.
|
|
2764
|
+
*/
|
|
2765
|
+
public static executeQuestionAction(questionName: string, errorCallback?: (err: string) => void, scope?: any);
|
|
2694
2766
|
/**
|
|
2695
2767
|
* Overrides the list of options for given picklist question.
|
|
2696
2768
|
* @param questionName The name of the picklist question.
|
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 = 19.
|
|
4
|
+
var _scriptVersion = 19.1;
|
|
5
5
|
// Private objects & functions
|
|
6
6
|
var _inherit = (function () {
|
|
7
7
|
function _() {
|
|
@@ -624,7 +624,7 @@
|
|
|
624
624
|
FormManager: {},
|
|
625
625
|
EntityForm: function () {
|
|
626
626
|
/// <summary>Represents the Javascript equivalent of native entity form object.</summary>
|
|
627
|
-
/// <remarks>This object cannot be created directly. To obtain/modify this object, use <see cref="MobileCRM.UI.EntityForm.requestObject">MobileCRM.UI.EntityForm.requestObject</see> function.</remarks>
|
|
627
|
+
/// <remarks>This object cannot be created directly. To obtain/modify this object, use <see cref="MobileCRM.UI.EntityForm.requestObject">MobileCRM.UI.EntityForm.requestObject</see> function.<br/>This object is not available under Essential license.</remarks>
|
|
628
628
|
/// <field name="associatedViews" type="Array">Gets the associated views as an array of <see cref="MobileCRM.UI._EntityList">MobileCRM.UI._EntityList</see> objects.</field>
|
|
629
629
|
/// <field name="bulkUpdateItems" type="Array">A list of entity records editted on this bulk update form.</field>
|
|
630
630
|
/// <field name="canEdit" type="Boolean">Gets whether the form can be edited.</field>
|
|
@@ -644,6 +644,7 @@
|
|
|
644
644
|
},
|
|
645
645
|
QuestionnaireForm: function () {
|
|
646
646
|
/// <summary>[v10.3] Represents the Javascript equivalent of native questionnaire form object.</summary>
|
|
647
|
+
/// <remarks>This object is not available under Essential license.</remarks>
|
|
647
648
|
/// <field name="form" type="MobileCRM.UI.Form">Gets the form which hosts the questionnaire.</field>
|
|
648
649
|
/// <field name="groups" type="MobileCRM.UI.QuestionnaireForm.Group[]">A list of <see cref="MobileCRM.UI.QuestionnaireForm.Group">QuestionnaireForm.Group</see> objects.</field>
|
|
649
650
|
/// <field name="questions" type="MobileCRM.UI.QuestionnaireForm.Question[]">A list of <see cref="MobileCRM.UI.QuestionnaireForm.Question">QuestionnaireForm.Question</see> objects.</field>
|
|
@@ -652,10 +653,12 @@
|
|
|
652
653
|
},
|
|
653
654
|
EntityChart: function () {
|
|
654
655
|
/// <summary>[13.0] Represents the Javascript equivalent of native entity chart object.</summary>
|
|
656
|
+
/// <remarks>This object is not available under Essential license.</remarks>
|
|
655
657
|
MobileCRM.UI.EntityChart.superproto.constructor.apply(this, arguments);
|
|
656
658
|
},
|
|
657
659
|
EntityList: function () {
|
|
658
660
|
/// <summary>[v9.2] Represents the Javascript equivalent of native entity list object.</summary>
|
|
661
|
+
/// <remarks>This object is not available under Essential license.</remarks>
|
|
659
662
|
/// <field name="allowAddExisting" type="Boolean">Gets or sets whether adding an existing entity is allowed.</field>
|
|
660
663
|
/// <field name="allowCreateNew" type="Boolean">Gets or sets whether create a new entity (or managing the N:N entities in the case of N:N list) is allowed.</field>
|
|
661
664
|
/// <field name="allowedDocActions" type="Number">Gets or sets a mask of document actions (for Note and Sharepoint document lists).</field>
|
|
@@ -684,7 +687,7 @@
|
|
|
684
687
|
},
|
|
685
688
|
HomeForm: function () {
|
|
686
689
|
/// <summary>[v8.0] Represents the Javascript equivalent of the home form object which contains the Home/UI replacement iFrame.</summary>
|
|
687
|
-
/// <remarks><p>This class works only from Home/UI replacement iFrame.</p><p>This object cannot be created directly. To obtain/modify this object, use <see cref="MobileCRM.UI.HomeForm.requestObject">MobileCRM.UI.HomeForm.requestObject</see> function.</p></remarks>
|
|
690
|
+
/// <remarks><p>This class works only from Home/UI replacement iFrame.</p><p>This object cannot be created directly. To obtain/modify this object, use <see cref="MobileCRM.UI.HomeForm.requestObject">MobileCRM.UI.HomeForm.requestObject</see> function.</p><p>This object is not available under Essential license.</p></remarks>
|
|
688
691
|
/// <field name="form" type="MobileCRM.UI.Form">Gets the top level form.</field>
|
|
689
692
|
/// <field name="items" type="Array">Gets the list of the home items.</field>
|
|
690
693
|
/// <field name="listView" type="MobileCRM.UI._ListController">Gets the list view with home items.</field>
|
|
@@ -695,6 +698,7 @@
|
|
|
695
698
|
},
|
|
696
699
|
ReportForm: function () {
|
|
697
700
|
/// <summary>[v8.1] Represents the Dynamics CRM report form object.</summary>
|
|
701
|
+
/// <remarks>This object is not available under Essential license.</remarks>
|
|
698
702
|
/// <field name="allowedReportIds" type="Array">The list of report entity ids that has to be included in the report form selector.</field>
|
|
699
703
|
/// <field name="allowedLanguages" type="Array">The list of LCID codes of the languages that has to be included into the report form selector. The number -1 stands for "Any language".</field>
|
|
700
704
|
/// <field name="defaultReport" type="String">The primary name of the report entity that should be pre-selected on the report form.</field>
|
|
@@ -704,6 +708,7 @@
|
|
|
704
708
|
},
|
|
705
709
|
RoutePlan: function () {
|
|
706
710
|
/// <summary>[v14.2] Represents the Javascript equivalent view of RoutePlan form object.</summary>
|
|
711
|
+
/// <remarks>This object is not available under Essential license.</remarks>
|
|
707
712
|
/// <field name="myRoute" type="DynamicEntity[]">A list of route entities.</field>
|
|
708
713
|
/// <field name="completedEntities" type="DynamicEntity[]"> A list of completed entities that are about to be removed from route plan.</field>
|
|
709
714
|
/// <field name="routeEntityName" type="String">Logical name of the route visit entity.</field>
|
|
@@ -713,6 +718,7 @@
|
|
|
713
718
|
},
|
|
714
719
|
IFrameForm: function () {
|
|
715
720
|
/// <summary>[v9.0] Represents the iFrame form object.</summary>
|
|
721
|
+
/// <remarks>This object is not available under Essential license.</remarks>
|
|
716
722
|
/// <field name="form" type="MobileCRM.UI.Form">Gets the form hosting the iFrame.</field>
|
|
717
723
|
/// <field name="isDirty" type="Boolean">[v10.0] Controls whether the form is dirty and requires save, or whether it can be closed.</field>
|
|
718
724
|
/// <field name="options" type="Object">Carries the custom parameters that can be specified when opening the form using <see cref="MobileCRM.UI.IFrameForm.show">MobileCRM.UI.IFrameForm.show</see> function.</field>
|
|
@@ -722,6 +728,7 @@
|
|
|
722
728
|
},
|
|
723
729
|
Form: function (props) {
|
|
724
730
|
/// <summary>[v8.0] Represents the Javascript equivalent of the form object.</summary>
|
|
731
|
+
/// <remarks>This object is not available under Essential license.</remarks>
|
|
725
732
|
/// <field name="canMaximize" type="Boolean">Gets or sets whether form can be maximized to fullscreen (full application frame).</field>
|
|
726
733
|
/// <field name="isMaximized" type="Boolean">Gets or sets whether form is currently maximized to fullscreen (full application frame).</field>
|
|
727
734
|
/// <field name="isModal" type="Boolean">Indicates whether this form is presented as modal window.</field>
|
|
@@ -734,10 +741,11 @@
|
|
|
734
741
|
},
|
|
735
742
|
ViewController: function () {
|
|
736
743
|
/// <summary>Represents the Javascript equivalent of view controller (map/web content).</summary>
|
|
744
|
+
/// <remarks>This object is not available under Essential license.</remarks>
|
|
737
745
|
},
|
|
738
746
|
ProcessController: function () {
|
|
739
747
|
/// <summary>[v8.2] Represents the Javascript equivalent of view process controller.</summary>
|
|
740
|
-
/// <remarks>It is not intended to create an instance of this class. To obtain this object, use <see cref="MobileCRM.UI.EntityForm.requestObject">EntityForm.requestObject</see> function and locate the controller in form's "controllers" list.</remarks>
|
|
748
|
+
/// <remarks>It is not intended to create an instance of this class. To obtain this object, use <see cref="MobileCRM.UI.EntityForm.requestObject">EntityForm.requestObject</see> function and locate the controller in form's "controllers" list.<p>This object is not available under Essential license.</p></remarks>
|
|
741
749
|
/// <field name="currentStateInfo" type="Object">Gets the information about the current process flow state (active stage, visible stage and process).</field>
|
|
742
750
|
MobileCRM.UI.ProcessController.superproto.constructor.apply(this, arguments);
|
|
743
751
|
},
|
|
@@ -773,6 +781,7 @@
|
|
|
773
781
|
},
|
|
774
782
|
LookupForm: function () {
|
|
775
783
|
/// <summary>This object allows user to select an entity from a configurable list of entity types.</summary>
|
|
784
|
+
/// <remarks>This object is not available under Essential license.</remarks>
|
|
776
785
|
/// <field name="entities" type="Array">An array of allowed entity kinds (schema names).</field>
|
|
777
786
|
/// <field name="allowedViews" type="String">OBSOLETE: Allowed views, or null if all are allowed.</field>
|
|
778
787
|
/// <field name="source" type="MobileCRM.Relationship">The entity whose property will be set to the chosen value.</field>
|
|
@@ -794,6 +803,7 @@
|
|
|
794
803
|
},
|
|
795
804
|
MultiLookupForm: function () {
|
|
796
805
|
/// <summary>[v9.3] This object allows user to select a list of entities from a configurable list of entity types. Derived from LookupForm so you can use the addView() and addEntityFilter() methods.</summary>
|
|
806
|
+
/// <remarks>This object is not available under Essential license.</remarks>
|
|
797
807
|
/// <field name="entities" type="Array">An array of allowed entity kinds (schema names).</field>
|
|
798
808
|
/// <field name="source" type="MobileCRM.Relationship">The entity whose property will be set to the chosen value.</field>
|
|
799
809
|
/// <field name="dataSource" type="MobileCRM.Reference[]">The list of entities that should be displayed as selected.</field>
|
|
@@ -804,7 +814,7 @@
|
|
|
804
814
|
},
|
|
805
815
|
TourplanForm: function (props) {
|
|
806
816
|
/// <summary>Represents the Javascript equivalent tourplan form object.</summary>
|
|
807
|
-
/// <remarks>This object cannot be created directly. To obtain/modify this object, use <see cref="MobileCRM.UI.TourplanForm.requestObject">MobileCRM.UI.TourplanForm.requestObject</see> function.</remarks>
|
|
817
|
+
/// <remarks>This object cannot be created directly. To obtain/modify this object, use <see cref="MobileCRM.UI.TourplanForm.requestObject">MobileCRM.UI.TourplanForm.requestObject</see> function.<p>This object is not available under Essential license.</p></remarks>
|
|
808
818
|
/// <field name="isDirty" type="Boolean">Indicates whether the form has been modified.</field>
|
|
809
819
|
/// <field name="isLoaded" type="Boolean">Gets or sets whether the form is loaded.</field>
|
|
810
820
|
/// <field name="view" type="MobileCRM.UI._AppointmentView">Gets tourplan form view <see cref="MobileCRM.UI._AppointmentView">MobileCRM.UI.AppointmentView</see>.</field>
|
|
@@ -812,6 +822,7 @@
|
|
|
812
822
|
},
|
|
813
823
|
_DetailView: function (props) {
|
|
814
824
|
/// <summary>Represents the Javascript equivalent of detail view with set of items responsible for fields editing.</summary>
|
|
825
|
+
/// <remarks>This object is not available under Essential license.</remarks>
|
|
815
826
|
/// <field name="isDirty" type="Boolean">Indicates whether the value of an item has been modified.</field>
|
|
816
827
|
/// <field name="isEnabled" type="Boolean">Gets or sets whether the all items are enabled or disabled.</field>
|
|
817
828
|
/// <field name="isVisible" type="Boolean">Gets or sets whether the view is visible.</field>
|
|
@@ -2870,7 +2881,7 @@
|
|
|
2870
2881
|
if (output) {
|
|
2871
2882
|
format += output;
|
|
2872
2883
|
}
|
|
2873
|
-
this.execute(
|
|
2884
|
+
this.execute(format, success, failed, scope);
|
|
2874
2885
|
};
|
|
2875
2886
|
MobileCRM.FetchXml.Fetch.prototype.executeAsync = function (output, online) {
|
|
2876
2887
|
/// <summary>Performs the asynchronous CRM Fetch request.</summary>
|
|
@@ -3237,7 +3248,7 @@
|
|
|
3237
3248
|
};
|
|
3238
3249
|
MobileCRM.Platform.preventBackButton = function (handler, scope) {
|
|
3239
3250
|
/// <summary>Prevents application to close when HW back button is pressed and installs handler which is called instead.</summary>
|
|
3240
|
-
/// <remarks><p>Pass "null" handler to allow the HW back button.</p><p>Works only under OS having HW back button (Android
|
|
3251
|
+
/// <remarks><p>Pass "null" handler to allow the HW back button.</p><p>Works only under OS having HW back button (Android).</p></remarks>
|
|
3241
3252
|
/// <param name="handler" type="function()">Handler function which will be called each time when user presses the Android HW back button.</param>
|
|
3242
3253
|
MobileCRM.bridge.command(
|
|
3243
3254
|
"setBackButtonHandler",
|
|
@@ -3247,6 +3258,28 @@
|
|
|
3247
3258
|
scope
|
|
3248
3259
|
);
|
|
3249
3260
|
};
|
|
3261
|
+
MobileCRM.Platform.showToast = function (message, icon) {
|
|
3262
|
+
/// <summary>Shows a platform-specific toast window over the app window which is dismissed after a few seconds.</summary>
|
|
3263
|
+
/// <param name="message" type="String">A toast content message.</param>
|
|
3264
|
+
/// <param name="icon" type="String">Valid app image name (e.g. Home.Now.png).</param>
|
|
3265
|
+
return MobileCRM.bridge.invokeStaticMethodPromise("Resco.UI", "Resco.UI.FormFactory", "ShowToastInfo.Invoke", [message, icon]);
|
|
3266
|
+
};
|
|
3267
|
+
MobileCRM.Platform.showAlert = function (text, multiLine, defaultButton, buttons) {
|
|
3268
|
+
/// <summary>Shows a platform-specific alert window with specified text and buttons. Resolves to the pressed button name.</summary>
|
|
3269
|
+
/// <param name="text" type="String">A message to show.</param>
|
|
3270
|
+
/// <param name="multiLine" type="Boolean">If true, the message text will be displayed with larger height and the text will be wrapped.</param>
|
|
3271
|
+
/// <param name="defaultButton" type="String">The default button caption. If not specified, there is no default button.</param>
|
|
3272
|
+
/// <param name="buttons" type="Array">An array of button captions to display. If not specified, only default button or OK button is shown.</param>
|
|
3273
|
+
return MobileCRM.bridge.invokeCommandPromise(
|
|
3274
|
+
"messageBox",
|
|
3275
|
+
JSON.stringify({
|
|
3276
|
+
title: text || "",
|
|
3277
|
+
multiLine: !!multiLine,
|
|
3278
|
+
defaultText: defaultButton,
|
|
3279
|
+
items: buttons || [],
|
|
3280
|
+
})
|
|
3281
|
+
);
|
|
3282
|
+
};
|
|
3250
3283
|
// MobileCRM.Application
|
|
3251
3284
|
MobileCRM.Application.synchronize = function (backgroundOnly, ifNotSyncedBefore) {
|
|
3252
3285
|
/// <summary>Starts background/foreground sync if not synchronized or the last sync was before desired limit.</summary>
|
|
@@ -3263,10 +3296,26 @@
|
|
|
3263
3296
|
/// <param name="forceLogin" type="Boolean">if true, the sync dialog with URL and credentials will be opened; otherwise it is opened only if the password is not saved.</param>
|
|
3264
3297
|
MobileCRM.bridge.invokeStaticMethodAsync("MobileCrm", "MobileCrm.Controllers.HomeForm", "Instance.Synchronize", [forceLogin, false]);
|
|
3265
3298
|
};
|
|
3299
|
+
MobileCRM.Application.onSyncFinished = function (handler, scope) {
|
|
3300
|
+
/// <summary>[v8.1] Binds the new handler to the synchronization finish event.</summary>
|
|
3301
|
+
/// <param name="handler" type="function(homeForm)">A function which will be called when the synchronization finished event occurs with current instance of the MobileCRM.UI.HomeForm as parameter.</param>
|
|
3302
|
+
/// <param name="scope" type="Object">A scope in which the handler should be called.</param>
|
|
3303
|
+
MobileCRM.UI.HomeForm.onSyncFinished(handler, scope);
|
|
3304
|
+
};
|
|
3305
|
+
MobileCRM.Application.startSmartSync = function (smartSyncName) {
|
|
3306
|
+
/// <summary>[v19.1] Starts pre-defined or custom SmartSync definition.
|
|
3307
|
+
/// <param name="smartSyncName" type="String">The name of SmartSync configuration as defined in Woodford.</param>
|
|
3308
|
+
/// <returns type="Promise">A Promise resolved when the SmartSync was initiated.</returns>
|
|
3309
|
+
return MobileCRM.bridge.invokeCommandPromise("startSmartSync", JSON.stringify({ name: smartSyncName }));
|
|
3310
|
+
};
|
|
3266
3311
|
MobileCRM.Application.showAppLogin = function () {
|
|
3267
3312
|
/// <summary>Causes that the password is forgotten and user is required to type it again to make the app running.</summary>
|
|
3268
3313
|
MobileCRM.bridge.invokeStaticMethodAsync("MobileCrm", "MobileCrm.SecurityManager", "OpenLoginForm", []);
|
|
3269
3314
|
};
|
|
3315
|
+
MobileCRM.Application.showSetup = function () {
|
|
3316
|
+
/// <summary>Closes all forms and shows the setup screen.</summary>
|
|
3317
|
+
MobileCRM.bridge.invokeStaticMethodAsync("MobileCrm", "MobileCrm.Controllers.HomeForm", "Instance.ShowSetup", [0, null]);
|
|
3318
|
+
};
|
|
3270
3319
|
MobileCRM.Application.getAppColor = function (colName, success, failed, scope) {
|
|
3271
3320
|
/// <summary>Gets the customized color by its name.</summary>
|
|
3272
3321
|
/// <param name="colName" type="String">Defines the color name. Must be one of these: TitleBackground, TitleForeground, ListBackground, ListForeground, ListSelBackground, ListSelForeground, ListSeparator, SearchBackground, SearchForeground, SearchSelForeground, FormBackground, FormItemBackground, FormItemForeground, FormItemLabelForeground, FormItemDisabled, FormItemLink, TabBackground, TabForeground, TabSelForeground.</param>
|
|
@@ -3551,6 +3600,7 @@
|
|
|
3551
3600
|
);
|
|
3552
3601
|
};
|
|
3553
3602
|
MobileCRM.Application.getAccessToken = function (resourceUrl, successCallback, failureCallback, scope) {
|
|
3603
|
+
/// <summary>[v12.3]Asynchronously gets the access token for the specified resource URL (limited to Microsoft environment without MSAL).</summary>
|
|
3554
3604
|
/// <param name="resourceUrl" type="String">The resource.</param>
|
|
3555
3605
|
/// <param name="successCallback" type="function(textAccessToken)">A callback function what is called asynchronously with serialized <b>access token</b> as argument.</param>
|
|
3556
3606
|
/// <param name="failureCallback" type="function(error)">A callback function for command failure. The <b>error</b> argument will carry the error message.</param>
|
|
@@ -3565,7 +3615,7 @@
|
|
|
3565
3615
|
MobileCRM.bridge.command("getLastSignificantTimeChange", null, success, failed);
|
|
3566
3616
|
};
|
|
3567
3617
|
MobileCRM.Integration.getOAuthAccessToken = function (configurationName, oauthSettings, prompt, successCallback, failureCallback, scope) {
|
|
3568
|
-
/// <summary>[12.3]Asynchronously gets the token using passed OAuth settings and parameters. Configuration name is used to find already settings.</summary>
|
|
3618
|
+
/// <summary>[12.3]Asynchronously gets the token using passed OAuth settings and parameters. Configuration name is used to find already existing settings.</summary>
|
|
3569
3619
|
/// <param name="configurationName" type="String">Define the name of oauth configuration, what is key for saved setting if any.</param>
|
|
3570
3620
|
/// <param name="oauthSettings" type="MobileCRM.OAuthSettings">Defines the OAuth settings for authentication.</param>
|
|
3571
3621
|
/// <param name="prompt" type="Boolean">Whether to force the user to enter credentials again.</param>
|
|
@@ -3947,6 +3997,29 @@
|
|
|
3947
3997
|
};
|
|
3948
3998
|
MobileCRM.bridge.command("detailViewAction", JSON.stringify(data));
|
|
3949
3999
|
};
|
|
4000
|
+
MobileCRM.UI._DetailView.prototype.executeItemAction = function (index) {
|
|
4001
|
+
/// <summary>[v19.1] Executes the detail item specific action, e.g. scan barcode.</summary>
|
|
4002
|
+
/// <param name="index" type="Number">Selected item index.</param>
|
|
4003
|
+
if (index < 0) {
|
|
4004
|
+
MobileCRM.bridge.log("DetailView.executeItemAction: Index must not be negative.");
|
|
4005
|
+
return;
|
|
4006
|
+
}
|
|
4007
|
+
var data = {
|
|
4008
|
+
action: "executeItemAction",
|
|
4009
|
+
viewName: this.name,
|
|
4010
|
+
index: index,
|
|
4011
|
+
};
|
|
4012
|
+
MobileCRM.bridge.command("detailViewAction", JSON.stringify(data));
|
|
4013
|
+
};
|
|
4014
|
+
MobileCRM.UI._DetailView.prototype.getItemContentAsync = async function (itemName) {
|
|
4015
|
+
/// <summary>[v19.1] Gets the content of detail item as string, e.g. base64 encoded binary data of image item.</summary>
|
|
4016
|
+
/// <param name="itemName" type="String">The name of the detail item.</param>
|
|
4017
|
+
var data = {
|
|
4018
|
+
viewName: this.name,
|
|
4019
|
+
itemName: itemName,
|
|
4020
|
+
};
|
|
4021
|
+
return await MobileCRM.bridge.invokeCommandPromise("getDetailItemContent", JSON.stringify(data));
|
|
4022
|
+
};
|
|
3950
4023
|
MobileCRM.UI._DetailView.prototype.updateComboItemDataSource = function (index, listDataSource, valueType, defaultValue) {
|
|
3951
4024
|
/// <summary>[v9.1] Changes the data source for CombobBoxitem <see cref="MobileCRM.UI.DetailViewItems.Item">MobileCRM.UI.DetailViewItems.ComboBoxItem</see>.</summary>
|
|
3952
4025
|
/// <param name="index" type="Number">Item index on the view.</param>
|
|
@@ -4599,7 +4672,7 @@
|
|
|
4599
4672
|
|
|
4600
4673
|
MobileCRM.MobileReport.showForm = function (report, source, fetchXml, failed, scope) {
|
|
4601
4674
|
/// <summary>[v10.1] Shows new MobileReport form. Source for the report can be defined either as list of <see cref="MobileCRM.Reference">MobileCRM.Reference</see> objects or as FetchXML query.</summary>
|
|
4602
|
-
/// <remarks>If both types of source are passed, user can select which one to use.</remarks>
|
|
4675
|
+
/// <remarks><p>If both types of source are passed, user can select which one to use.</p><p>This method is not available under Essential license.</p></remarks>
|
|
4603
4676
|
/// <param name="report" type="MobileCRM.Reference">Optional reference to the resco_mobilereport entity that will be pre-selected.</param>
|
|
4604
4677
|
/// <param name="source" type="MobileCRM.Reference[]">The list of entity references used as report input.</param>
|
|
4605
4678
|
/// <param name="fetchXML" type="String">The fetch XML defining the entity (entities) query used as report input.</param>
|
|
@@ -4610,7 +4683,7 @@
|
|
|
4610
4683
|
};
|
|
4611
4684
|
MobileCRM.MobileReport.showFormWithConfiguration = function (report, source, fetchXml, paramString, failed, scope) {
|
|
4612
4685
|
/// <summary>[v16.0] Shows new MobileReport form. Source for the report can be defined either as list of <see cref="MobileCRM.Reference">MobileCRM.Reference</see> objects or as FetchXML query.</summary>
|
|
4613
|
-
/// <remarks>If both types of source are passed, user can select which one to use.</remarks>
|
|
4686
|
+
/// <remarks><p>If both types of source are passed, user can select which one to use.</p><p>This method is not available under Essential license.</p></remarks>
|
|
4614
4687
|
/// <param name="report" type="MobileCRM.Reference">Optional reference to the resco_mobilereport entity that will be pre-selected.</param>
|
|
4615
4688
|
/// <param name="source" type="MobileCRM.Reference[]">The list of entity references used as report input.</param>
|
|
4616
4689
|
/// <param name="fetchXML" type="String">The fetch XML defining the entity (entities) query used as report input.</param>
|
|
@@ -4623,6 +4696,7 @@
|
|
|
4623
4696
|
// MobileCRM.UI.Questionnaire
|
|
4624
4697
|
MobileCRM.Questionnaire.showForm = function (id, failed, scope, relationship, modal, version) {
|
|
4625
4698
|
/// <summary>[v10.2] Shows the questionnaire form.</summary>
|
|
4699
|
+
/// <remarks>This method is not available under Essential license.</remarks>
|
|
4626
4700
|
/// <param name="id" type="String">Id (guid) of the questionnaire.</param>
|
|
4627
4701
|
/// <param name="failed" type="function(errorMsg)">A callback which is called in case of error.</param>
|
|
4628
4702
|
/// <param name="scope" type="Object">The scope for callbacks.</param>
|
|
@@ -5330,6 +5404,13 @@
|
|
|
5330
5404
|
/// <param name="scope" type="Object">The scope for callbacks.</param>
|
|
5331
5405
|
MobileCRM.bridge.invokeMethodAsync("QuestionnaireForm", "FocusQuestion", [questionName], null, errorCallback, scope);
|
|
5332
5406
|
};
|
|
5407
|
+
MobileCRM.UI.QuestionnaireForm.executeQuestionAction = function (questionName, errorCallback, scope) {
|
|
5408
|
+
/// <summary>[v19.1] Asynchronously focuses the question and executes its operations, e.g. Scan Barcode, Run OCR, etc...</summary>
|
|
5409
|
+
/// <param name="questionName" type="String">A name of the question.</param>
|
|
5410
|
+
/// <param name="errorCallback" type="function(errorMsg)">The errorCallback which is called in case of error.</param>
|
|
5411
|
+
/// <param name="scope" type="Object">The scope for callbacks.</param>
|
|
5412
|
+
MobileCRM.bridge.invokeMethodAsync("QuestionnaireForm", "ExecuteQuestionAction", [questionName], null, errorCallback, scope);
|
|
5413
|
+
};
|
|
5333
5414
|
MobileCRM.UI.QuestionnaireForm.overridePicklistOptions = function (questionName, allowNull, options, errorCallback, scope) {
|
|
5334
5415
|
/// <summary>Overrides the list of options for given picklist question.</summary>
|
|
5335
5416
|
/// <param name="questionName" type="String">A name of the picklist question.</param>
|