-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathJSBridge.js
More file actions
6995 lines (6976 loc) · 446 KB
/
Copy pathJSBridge.js
File metadata and controls
6995 lines (6976 loc) · 446 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* eslint-disable @typescript-eslint/no-this-alias */
/* globals MobileCRM:writable, MobileCrmException:writable, CrmBridge, webkit, chrome */
(function () {
var _scriptVersion = 19.1;
// Private objects & functions
var _inherit = (function () {
function _() {
return this;
}
return function (child, parent) {
_.prototype = parent.prototype;
child.prototype = new _();
child.prototype.constructor = child;
child.superproto = parent.prototype;
return child;
};
})();
var _findInArray = function (arr, property, value) {
if (arr) {
for (var i = 0; i < arr.length; i++) {
if (arr[i][property] == value) {
return arr[i];
}
}
}
return null;
};
var _normalizeArray = function (arr, convertCallback) {
var retVal = undefined;
if (arr instanceof Array && arr.length > 0) {
const normArr = [];
for (const o of arr) {
if (o) {
normArr.push(convertCallback(o));
}
}
if (normArr.length > 0) {
retVal = normArr;
}
}
return retVal;
};
var _addProperty = function (obj, name, writable, value) {
if (!obj._privVals) {
obj._privVals = {};
}
if (!obj._typeInfo) {
obj._typeInfo = {};
}
if (!obj.propertyChanged) {
obj.propertyChanged = new _Event(obj);
}
if (value != undefined) {
obj._privVals[name] = value;
}
var propDef = {
get: function () {
return obj._privVals[name];
},
enumerable: true,
};
if (writable) {
propDef.set = function (newVal) {
if (obj._privVals[name] != newVal) {
obj._privVals[name] = newVal;
obj.propertyChanged.raise(name);
}
if (obj._typeInfo[name]) {
delete obj._typeInfo[name];
}
};
}
Object.defineProperty(obj, name, propDef);
};
var _bindHandler = function (handler, handlers, bind, scope) {
if (bind || typeof bind == "undefined") {
handlers.push({ handler: handler, scope: scope ? scope : null });
} else {
var index = 0;
while (index < handlers.length) {
if (handlers[index].handler === handler) {
handlers.splice(index, 1);
} else {
index++;
}
}
}
};
var _registerEventHandler = function (event, handler, handlers, bind, scope) {
var register = handlers.length == 0;
_bindHandler(handler, handlers, bind, scope);
if (register) {
MobileCRM.bridge.command("registerEvents", event);
}
};
var _callHandlers = function (handlers) {
var params = [];
var i = 1;
while (arguments[i]) {
params.push(arguments[i++]);
}
var result = false;
for (var index in handlers) {
var handlerDescriptor = handlers[index];
if (handlerDescriptor && handlerDescriptor.handler) {
var thisResult = handlerDescriptor.handler.apply(handlerDescriptor.scope, params);
if (thisResult != false) {
result = result || thisResult;
}
}
}
return result;
};
var _Event = function (sender) {
var _handlers = [],
_handlersToRemove = [],
_bRaisingEvent = false;
this.add = function (handler, target) {
var bExists = false;
for (var index in _handlers) {
var h = _handlers[index];
if (h && h.handler == handler && h.target == target) {
bExists = true;
break;
}
}
if (!bExists) {
_handlers.push({ handler: handler, target: target });
}
};
this.remove = function (handler, target) {
var index = 0;
while (index < _handlers.length) {
var h = _handlers[index];
if ((!handler || h.handler == handler) && (!target || h.target == target)) {
if (!_bRaisingEvent) {
_handlers.splice(index, 1);
index--;
} else {
_handlersToRemove.push(h);
}
}
index++;
}
};
this.clear = function () {
if (!_bRaisingEvent) {
_handlers = [];
} else {
_handlersToRemove = _handlers.slice(0);
}
};
this.raise = function (eventArgs) {
// Make sure every handler is called in raise(), if any handler is removed while in 'for' cycle, remove it after the loop finishes
_bRaisingEvent = true;
for (var index in _handlers) {
var h = _handlers[index];
if (h && h.handler) {
h.handler.call(h.target ? h.target : sender, eventArgs, sender);
if (eventArgs && eventArgs.cancel) {
break;
}
}
}
_bRaisingEvent = false;
for (index in _handlersToRemove) {
var hToRemove = _handlersToRemove[index];
if (hToRemove) {
this.remove(hToRemove.handler, hToRemove.target);
}
}
};
};
var _global = typeof window == "undefined" ? global : window;
var MobileCrmException = _global.MobileCrmException;
if (typeof MobileCrmException === "undefined") {
_global.MobileCrmException = MobileCrmException = function (msg) {
this.message = msg;
this.name = "MobileCrmException";
};
MobileCrmException.prototype.toString = function () {
return this.message;
};
}
function _safeErrorMessage(err) {
return "message" in err ? err.message : "Message" in err ? err.Message : err.toString();
}
// MobileCRM object definition
var MobileCRM = _global.MobileCRM;
if (typeof MobileCRM === "undefined") {
_global.MobileCRM = MobileCRM = {
/// <summary>An entry point for Mobile CRM data model.</summary>
/// <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>
bridge: null,
Bridge: function (platform) {
/// <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>
/// <param name="platform" type="String">A platform name</param>
/// <field name="platform" type="String">A string identifying the device platform (e.g. Android, iOS, Windows, WindowsRT, Windows10 or WindowsPhone).</field>
/// <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>
this.commandQueue = [];
this.processing = false;
this.callbacks = {};
this.callbackId = 0;
this.version = _scriptVersion;
this.platform = platform;
},
Configuration: function () {
/// <summary>Provides an access to the application configuration.</summary>
/// <remarks>This object cannot be created directly. To obtain/modify this object, use <see cref="MobileCRM.Configuration.requestObject">MobileCRM.Configuration.requestObject</see> function.</remarks>
/// <field name="applicationEdition" type="String">Gets the application edition.</field>
/// <field name="applicationPath" type="String">Gets the application folder.</field>
/// <field name="applicationVersion" type="String">Gets the application version (major.minor.subversion.build).</field>
/// <field name="customizationDirectory" type="String">Gets or sets the runtime customization config root.</field>
/// <field name="externalConfiguration" type="String">Gets the external configuration directory (either customization or legacy configuration).</field>
/// <field name="isBackgroundSync" type="Boolean">Gets or sets whether background synchronization is in progress.</field>
/// <field name="isOnline" type="Boolean">Gets or sets whether the online mode is currently active.</field>
/// <field name="legacyVersion" type="String">Gets or sets the legacy redirect folder.</field>
/// <field name="licenseAlert" type="String">Gets the flag set during sync indicating that the user's license has expired.</field>
/// <field name="projectVersion" type="String">Gets customer-defined project version.</field>
/// <field name="settings" type="MobileCRM._Settings">Gets the application settings.</field>
/// <field name="storageDirectory" type="String">Gets the root folder of the application storage.</field>
},
GlobalConstants: function () {
/// <summary>Provides access to the global constants.</summary>
},
CultureInfo: function () {
/// <summary>[v10.2] Provides information about current device culture. The information includes the names for the culture, the writing system, the calendar used, and formatting for dates.</summary>
/// <field name="name" type="String">Gets the culture name in the format languageCode/region (e.g. "en-US"). languageCode is a lowercase two-letter code derived from ISO 639-1. regioncode is derived from ISO 3166 and usually consists of two uppercase letters.</field>
/// <field name="displayName" type="String">Gets the full localized culture name.</field>
/// <field name="nativeName" type="String">Gets the culture name, consisting of the language, the country/region, and the optional script, that the culture is set to display.</field>
/// <field name="localization" type="String">Gets selected localization language.</field>
/// <field name="ISOName" type="String">Gets the ISO 639-1 two-letter code for the language of the current CultureInfo.</field>
/// <field name="isRightToLeft" type="Boolean">Gets a value indicating whether the current CultureInfo object represents a writing system where text flows from right to left.</field>
/// <field name="dateTimeFormat" type="MobileCRM.DateTimeFormat">Gets a DateTimeFormat that defines the culturally appropriate format of displaying dates and times.</field>
/// <field name="numberFormat" type="MobileCRM.NumberFormat">Gets a NumberFormat that defines the culturally appropriate format of displaying numbers, currency, and percentage.</field>
},
DateTimeFormat: function () {
/// <summary>[v10.2] Provides culture-specific information about the format of date and time values.</summary>
/// <field name="abbreviatedDayNames" type="String[]">Gets a string array containing the culture-specific abbreviated names of the days of the week.</field>
/// <field name="abbreviatedMonthGenitiveNames" type="String[]">Gets a string array of abbreviated month names associated with the current DateTimeFormat object.</field>
/// <field name="abbreviatedMonthNames" type="String[]">Gets a string array that contains the culture-specific abbreviated names of the months.</field>
/// <field name="aMDesignator" type="String">Gets the string designator for hours that are "ante meridiem" (before noon).</field>
/// <field name="dayNames" type="String[]">Gets a string array that contains the culture-specific full names of the days of the week.</field>
/// <field name="firstDayOfWeek" type="Number">Gets the first day of the week (0=Sunday, 1=Monday, ...)</field>
/// <field name="fullDateTimePattern" type="String">Gets the custom format string for a long date and long time value.</field>
/// <field name="longDatePattern" type="String">Gets the custom format string for a long date value.</field>
/// <field name="longTimePattern" type="String">Gets the custom format string for a long time value.</field>
/// <field name="monthDayPattern" type="String">Gets the custom format string for a month and day value.</field>
/// <field name="monthGenitiveNames" type="String[]">Gets a string array of month names associated with the current DateTimeFormat object.</field>
/// <field name="monthNames" type="String[]">Gets a string array containing the culture-specific full names of the months.</field>
/// <field name="pMDesignator" type="String">Gets the string designator for hours that are "post meridiem" (after noon).</field>
/// <field name="shortDatePattern" type="String">Gets the custom format string for a short date value.</field>
/// <field name="shortestDayNames" type="String[]">Gets a string array of the shortest unique abbreviated day names associated with the current DateTimeFormat object.</field>
/// <field name="shortTimePattern" type="String">Gets the custom format string for a short time value.</field>
/// <field name="sortableDateTimePattern" type="String">Gets the custom format string for a sortable date and time value.</field>
/// <field name="universalSortableDateTimePattern" type="String">Gets the custom format string for a universal, sortable date and time string.</field>
/// <field name="yearMonthPattern" type="String">Gets the custom format string for a year and month value.</field>
},
NumberFormat: function () {
/// <summary>[v10.2] Provides culture-specific information for formatting and parsing numeric values.</summary>
/// <field name="currencyDecimalDigits" type="Number">Gets the number of decimal places to use in currency values.</field>
/// <field name="currencyDecimalSeparator" type="String">Gets the string to use as the decimal separator in currency values.</field>
/// <field name="currencyGroupSeparator" type="String">Gets the string that separates groups of digits to the left of the decimal in currency values.</field>
/// <field name="currencyGroupSizes" type="Number[]">Gets the number of digits in each group to the left of the decimal in currency values.</field>
/// <field name="currencyNegativePattern" type="Number">Gets the format pattern for negative currency values.</field>
/// <field name="currencyPositivePattern" type="Number">Gets the format pattern for positive currency values.</field>
/// <field name="currencySymbol" type="String">Gets the string to use as the currency symbol.</field>
/// <field name="naNSymbol" type="String">Gets the string that represents the IEEE NaN (not a number) value.</field>
/// <field name="negativeInfinitySymbol" type="String">Gets the string that represents negative infinity.</field>
/// <field name="negativeSign" type="String">Gets the string that denotes that the associated number is negative.</field>
/// <field name="numberDecimalDigits" type="Number">Gets the number of decimal places to use in numeric values.</field>
/// <field name="numberDecimalSeparator" type="String">Gets the string to use as the decimal separator in numeric values.</field>
/// <field name="numberGroupSeparator" type="String">Gets the string that separates groups of digits to the left of the decimal in numeric values.</field>
/// <field name="numberGroupSizes" type="Number[]"> Gets the number of digits in each group to the left of the decimal in numeric values.</field>
/// <field name="numberNegativePattern" type="Number">Gets the format pattern for negative numeric values.</field>
/// <field name="percentDecimalDigits" type="Number">Gets the number of decimal places to use in percent values.</field>
/// <field name="percentDecimalSeparator" type="String">Gets the string to use as the decimal separator in percent values.</field>
/// <field name="percentGroupSeparator" type="String">Gets the string that separates groups of digits to the left of the decimal in percent values.</field>
/// <field name="percentGroupSizes" type="Number[]">Gets the number of digits in each group to the left of the decimal in percent values.</field>
/// <field name="percentNegativePattern" type="Number">Gets the format pattern for negative percent values.</field>
/// <field name="percentPositivePattern" type="Number">Gets the format pattern for positive percent values.</field>
/// <field name="percentSymbol" type="String">Gets the string to use as the percent symbol.</field>
/// <field name="perMilleSymbol" type="String">Gets the string to use as the per mille symbol.</field>
/// <field name="positiveInfinitySymbol" type="String">Gets the string that represents positive infinity.</field>
/// <field name="positiveSign" type="String">Gets the string that denotes that the associated number is positive.</field>
},
Localization: {
stringTable: {},
initialized: false,
},
Reference: function (entityName, id, primaryName) {
/// <summary>Represents an entity reference which provides the minimum information about an entity.</summary>
/// <param name="entityName" type="String">The logical name of the reference, e.g. "account".</param>
/// <param name="id" type="String">GUID of the existing entity or null for new one.</param>
/// <param name="primaryName" type="String">The human readable name of the reference, e.g "Alexandro".</param>
/// <field name="entityName" type="String">The logical name of the reference, e.g. "account".</field>
/// <field name="id" type="String">GUID of the existing entity or null for new one.</field>
/// <field name="isNew" type="Boolean">Indicates whether the entity is newly created.</field>
/// <field name="primaryName" type="String">The human readable name of the reference, e.g. "Alexandro".</field>
this.entityName = entityName;
this.id = id;
this.isNew = id ? false : true;
this.primaryName = primaryName;
},
ActivityParty: function (entityName, id, primaryName, isDirectParty, addressUsed) {
/// <summary>Person or group associated with an activity. An activity can have multiple activity parties.</summary>
/// <param name="entityName" type="String">The logical entity name of the party (account, contact, lead, systemuser, etc.)</param>
/// <param name="id" type="String">GUID of the existing entity or null for new one or direct party.</param>
/// <param name="primaryName" type="String">The human readable name of the reference, e.g "Alexandro".</param>
/// <param name="isDirectParty" type="Boolean">Gets or sets whether the party is direct (email) or a pointer to an CRM record.</param>
/// <param name="addressUsed" type="String">Gets or sets the actual address used.</param>
/// <field name="entityName" type="String">The entity name of the party (account, contact, lead, systemuser, etc.)</field>
/// <field name="id" type="String">GUID of the existing entity or null for new one or direct party.</field>
/// <field name="primaryName" type="String">The human readable name of the reference, e.g. "Alexandro".</field>
/// <field name="isDirectParty" type="Boolean">Gets or sets whether the party is direct (email) or a pointer to an CRM record.</field>
/// <field name="addressUsed" type="String">Gets or sets the actual address used.</field>
MobileCRM.ActivityParty.superproto.constructor.apply(this, arguments);
this.isDirectParty = isDirectParty;
this.addressUsed = addressUsed;
},
Relationship: function (sourceProperty, target, intersectEntity, intersectProperty) {
/// <summary>Represents a relationship between two entities.</summary>
/// <param name="sourceProperty" type="String">Gets the name of the source of the relationship.</param>
/// <param name="target" type="MobileCRM.Reference">Gets the target of the relationship.</param>
/// <param name="intersectEntity" type="String">Gets the intersect entity if any. Used when displaying entities that are associated through a Many to Many relationship.</param>
/// <param name="intersectProperty" type="String">Gets the intersect entity property if any. Used when displaying entities that are associated through a Many to Many relationship.</param>
/// <field name="sourceProperty" type="String">Gets the name of the source of the relationship.</field>
/// <field name="target" type="MobileCRM.Reference">Gets the target of the relationship.</field>
/// <field name="intersectEntity" type="String">Gets the intersect entity if any. Used when displaying entities that are associated through a Many to Many relationship.</field>
/// <field name="intersectProperty" type="String">Gets the intersect entity property if any. Used when displaying entities that are associated through a Many to Many relationship.</field>
this.sourceProperty = sourceProperty;
this.target = target;
this.intersectEntity = intersectEntity;
this.intersectProperty = intersectProperty;
},
ManyToManyReference: {},
DynamicEntity: function (entityName, id, primaryName, properties, isOnline, isNew) {
/// <summary>Represents a CRM entity, with only a subset of properties loaded.</summary>
/// <remarks><p>This class is derived from <see cref="MobileCRM.Reference">MobileCRM.Reference</see></p><p>There is a compatibility issue since the version 7.4 which gets the boolean and numeric properties as native Javascript objects (instead of strings). If you experienced problems with these types of fields, switch on the legacy serialization by setting the static property MobileCRM.DynamicEntity.legacyPropsSerialization to true.</p></remarks>
/// <param name="entityName" type="String">The logical name of the entity, e.g. "account".</param>
/// <param name="id" type="String">GUID of the existing entity or null for new one.</param>
/// <param name="primaryName" type="String">The human readable name of the entity, e.g "Alexandro".</param>
/// <param name="properties" type="Object">An object with entity properties, e.g. {firstname:"Alexandro", lastname:"Puccini"}.</param>
/// <param name="isOnline" type="Boolean">Indicates whether the entity was created by online request or from local data.</param>
/// <param name="isNew" type="Boolean">Indicates whether the entity is newly created.</param>
/// <field name="entityName" type="String">The logical name of the entity, e.g. "account".</field>
/// <field name="id" type="String">GUID of the existing entity or null for new one.</field>
/// <field name="isNew" type="Boolean">Indicates whether the entity is newly created.</field>
/// <field name="isOnline" type="Boolean">Indicates whether the entity was created by online request or from local data.</field>
/// <field name="forceDirty" type="Boolean">Indicates whether to force save the provided properties even if not modified. Default behavior is to save only properties that were modified.</field>
/// <field name="primaryName" type="String">The human readable name of the entity, e.g. "Alexandro".</field>
/// <field name="properties" type="Object">An object with entity properties, e.g. {firstname:"Alexandro", lastname:"Puccini"}.</field>
MobileCRM.DynamicEntity.superproto.constructor.apply(this, arguments);
this.isOnline = isOnline;
if (isNew) {
this.isNew = isNew;
}
if (properties) {
if (MobileCRM.DynamicEntity.legacyPropsSerialization) {
// This is a workaround for failing scripts in v7.4 (string/bool issue)
for (var i in properties) {
if (typeof properties[i] == "boolean") {
properties[i] = properties[i].toString();
}
}
}
this.properties = new MobileCRM.ObservableObject(properties);
} else {
this.properties = {};
}
},
Metadata: {
entities: null,
},
MetaEntity: function (props) {
/// <summary>Represents an entity metadata.</summary>
/// <field name="isEnabled" type="Boolean">Indicates whether an entity is enabled. This field is used for limited runtime customization.</field>
/// <field name="isExternal" type="Boolean">Indicates whether an entity stores data from external sources Exchange/Google.</field>
/// <field name="name" type="String">Gets the entity (logical) name.</field>
/// <field name="objectTypeCode" type="Number">Gets the unique entity type code.</field>
/// <field name="primaryFieldName" type="String">The name of the entity primary field (name) property.</field>
/// <field name="primaryKeyName" type="String">The name of the entity primary key property.</field>
/// <field name="relationshipName" type="String">Gets the name of the many-to-many relationship name. Defined only for intersect entities.</field>
/// <field name="statusFieldName" type="String">Gets the status property name. In general it is called "statuscode" but there are exceptions.</field>
/// <field name="uploadOnly" type="Boolean">Indicates whether this entity can be downloaded during synchronization.</field>
/// <field name="attributes" type="Number">Gets additional entity attributes.</field>
MobileCRM.MetaEntity.superproto.constructor.apply(this, arguments);
},
MetaProperty: function () {
/// <summary>Represents a property (CRM field) metadata.</summary>
/// <field name="name" type="String">Gets the field (logical) name.</field>
/// <field name="required" type="Number">Gets the attribute requirement level (0=None, 1=SystemRequired, 2=Required, 3=Recommended, 4=ReadOnly).</field>
/// <field name="type" type="Number">Gets the attribute CRM type (see <see cref="http://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.metadata.attributetypecode.aspx">MS Dynamics SDK</see>).</field>
/// <field name="format" type="Number">Gets the attribute display format.</field>
/// <field name="isVirtual" type="Boolean">Gets whether the property is virtual (has no underlying storage). State and PartyList properties are virtual.</field>
/// <field name="isReference" type="Boolean">Gets whether the property is a reference (lookup) to another entity.</field>
/// <field name="isNullable" type="Boolean">Gets whether the property may contain NULL.</field>
/// <field name="defaultValue" type="">Gets the property default value.</field>
/// <field name="targets" type="Array">Gets the names of target entities, if the property is a lookup, or customer.</field>
/// <field name="minimum" type="Number">Gets the attribute minimum value.</field>
/// <field name="maximum" type="Number">Gets the attribute minimum value.</field>
/// <field name="precision" type="Number">Gets the numeric attribute's precision (decimal places).</field>
/// <field name="permission" type="Number">Gets the attribute's permission set (0=None, 1=User, 2=BusinessUnit, 4=ParentChild, 8=Organization).</field>
/// <field name="activityPartyType" type="Number">Gets the activity party type (from, to, attendee, etc.)</field>
/// <field name="isMultiParty" type="Boolean">Gets whether the activity party property can have multiple values (multiple to, cc, resources.)</field>
/// <field name="isSingularParty" type="Boolean">Gets whether the property represents a singular activity party property. These properties exists as both a Lookup property on the entity and an ActivytParty record.</field>
},
FetchXml: {
Fetch: function (entity, count, page, distinct, aggregate) {
/// <summary>Represents a FetchXml query object.</summary>
/// <param name="entity" type="MobileCRM.FetchXml.Entity">An entity object.</param>
/// <param name="count" type="int">the maximum number of records to retrieve.</param>
/// <param name="page" type="int">1-based index of the data page to retrieve.</param>
/// <param name="distinct" type="bool">Whether to return only distinct (different) values.</param>
/// <param name="aggregate" type="bool">Indicates whether the fetch is aggregated.</param>
/// <field name="aggregate" type="Boolean">Indicates whether the fetch is aggregated.</field>
/// <field name="count" type="int">the maximum number of records to retrieve.</field>
/// <field name="entity" type="MobileCRM.FetchXml.Entity">An entity object.</field>
/// <field name="page" type="int">1-based index of the data page to retrieve.</field>
/// <field name="distinct" type="Boolean">Whether to return only distinct (different) values.</field>
if (entity) {
this.entity = entity;
}
if (count !== undefined && count !== null) {
this.count = count;
}
if (page) {
this.page = page;
}
this.aggregate = !!aggregate;
if (distinct !== undefined && distinct !== null) {
this.distinct = distinct;
}
},
Entity: function (name, attributes, order, filter, linkentities) {
/// <summary>Represents a FetchXml query root entity.</summary>
/// <param name="name" type="String">An entity logical name.</param>
/// <field name="allattributes" type="Boolean">Indicates whether to fetch all attributes instead of explicitly chosen set.</field>
/// <field name="attributes" type="Array">An array of <see cref="MobileCRM.FetchXml.Attribute">MobileCRM.FetchXml.Attribute</see> objects.</field>
/// <field name="filter" type="MobileCRM.FetchXml.Filter">A query filter.</field>
/// <field name="linkentities" type="Array">An array of <see cref="MobileCRM.FetchXml.LinkEntity">MobileCRM.FetchXml.LinkEntity</see> objects.</field>
/// <field name="name" type="String">An entity logical name.</field>
/// <field name="order" type="Array">An array of <see cref="MobileCRM.FetchXml.Order">MobileCRM.FetchXml.Order</see> objects.</field>
if (name) {
this.name = name;
}
if (attributes) {
if (attributes == "*") {
this.allattributes = true;
} else {
this.attributes = attributes;
}
} else {
this.attributes = [];
}
this.order = order instanceof Array ? order : [];
this.filter = filter ? filter : null;
this.linkentities = linkentities ? linkentities : [];
},
LinkEntity: function (name, attributes, order, filter, linkentities, from, to, alias, linktype) {
/// <summary>Represents a FetchXml query linked entity.</summary>
/// <remarks>This object is derived from <see cref="MobileCRM.FetchXml.Entity">MobileCRM.FetchXml.Entity</see></remarks>
/// <param name="name" type="String">An entity name</param>
/// <field name="alias" type="String">A link alias.</field>
/// <field name="from" type="String">The "from" field (if parent then target entity primary key).</field>
/// <field name="linktype" type="String">The link (join) type ("inner" or "outer").</field>
/// <field name="to" type="String">The "to" field.</field>
MobileCRM.FetchXml.LinkEntity.superproto.constructor.apply(this, arguments);
if (from) {
this.from = from;
}
if (to) {
this.to = to;
}
if (alias) {
this.alias = alias;
}
if (linktype) {
this.linktype = linktype;
}
},
Attribute: function (name, alias, aggregate, groupBy, dateGrouping) {
/// <summary>Represents a FetchXml select statement (CRM field).</summary>
/// <param name="name" type="String">A lower-case entity attribute name (CRM logical field name).</param>
/// <field name="aggregate" type="String">An aggregation function.</field>
/// <field name="alias" type="String">Defines an attribute alias.</field>
/// <field name="dategrouping" type="String">A date group by modifier (year, quarter, month, week, day).</field>
/// <field name="groupby" type="Boolean">Indicates whether to group by this attribute.</field>
/// <field name="name" type="String">A lower-case entity attribute name (CRM logical field name).</field>
if (name) {
this.name = name;
}
if (alias) {
this.alias = alias;
}
this.groupby = !!groupBy;
if (aggregate) {
this.aggregate = aggregate;
}
if (dateGrouping) {
this.dategrouping = dateGrouping;
}
},
Order: function (attribute, descending, alias) {
/// <summary>Represents a FetchXml order statement.</summary>
/// <param name="attribute" type="String">An attribute name (CRM logical field name).</param>
/// <param name="descending" type="Boolean">true, for descending order; false, for ascending order</param>
/// <field name="alias" type="String">Defines an order alias.</field>
/// <field name="attribute" type="String">An attribute name (CRM logical field name).</field>
/// <field name="descending" type="Boolean">true, for descending order; false, for ascending order.</field>
if (attribute) {
this.attribute = attribute;
}
this.descending = descending ? true : false;
if (alias) {
this.alias = alias;
}
},
Filter: function (type, conditions, filters) {
/// <summary>Represents a FetchXml filter statement. A logical combination of <see cref="MobileCRM.FetchXml.Condition">Conditions</see> and child-filters.</summary>
/// <field name="conditions" type="Array">An array of <see cref="MobileCRM.FetchXml.Condition">Condition</see> objects.</field>
/// <field name="filters" type="Array">An array of <see cref="MobileCRM.FetchXml.Filter">Filter</see> objects representing child-filters.</field>
/// <field name="type" type="String">Defines the filter operator ("or" / "and").</field>
if (type) {
this.type = type;
}
this.conditions = conditions instanceof Array ? conditions : [];
this.filters = filters instanceof Array ? filters : [];
},
Condition: function (attribute, operator, value, entityName, refTarget, refLabel) {
/// <summary>Represents a FetchXml attribute condition statement.</summary>
/// <field name="attribute" type="String">The attribute name (CRM logical field name).</field>
/// <field name="operator" type="String">The condition operator. "eq", "ne", "in", "not-in", "between", "not-between", "lt", "le", "gt", "ge", "like", "not-like", "null", "not-null", "eq-userid", "eq-userteams", "today", "yesterday", "tomorrow", "this-year", "last-week", "last-x-hours", "next-x-years", "olderthan-x-months", ...</field>
/// <field name="entityname" type="String">The link name or alias to which this condition is relative to.</summary>
/// <field name="uiname" type="String">The lookup target entity display name.</field>
/// <field name="uitype" type="String">The lookup target entity logical name.</field>
/// <field name="value" type="">The value to compare to.</field>
/// <field name="values" type="Array">The list of values to compare to.</field>
if (attribute) {
this.attribute = attribute;
}
if (operator) {
this.operator = operator;
}
this.values = [];
if (value) {
if (value instanceof Array) {
this.values = value;
} else {
this.value = value;
}
}
if (entityName) {
this.entityname = entityName;
}
if (refTarget) {
this.uitype = refTarget;
}
if (refLabel) {
this.uiname = refLabel;
}
},
},
Platform: function () {
/// <summary>Represents object for querying platform specific information and executing platform integrated actions.</summary>
/// <remarks>This object cannot be created directly. To obtain/modify this object, use <see cref="MobileCRM.Platform.requestObject">MobileCRM.Platform.requestObject</see> function.</remarks>
/// <field name="capabilities" type="Number">Gets the mask of capability flags supported by this device (MakePhoneCalls=1; HasMapView=2).</field>
/// <field name="deviceIdentifier" type="String">Gets the unique identifier of this device.</field>
/// <field name="screenWidth" type="Number">Gets the current screen width in pixels.</field>
/// <field name="screenHeight" type="Number">Gets the current screen width in pixels.</field>
/// <field name="screenDensity" type="Number">Gets the screen density (DPI).</field>
/// <field name="isMultiPanel" type="Boolean">Gets whether the device has tablet or phone UI.</field>
/// <field name="customImagePath" type="String">Gets or sets the custom image path that comes from customization.</field>
MobileCRM.Platform.superproto.constructor.apply(this, arguments);
},
Application: function () {
/// <summary>Encapsulates the application-related functionality.</summary>
},
AboutInfo: function () {
/// <summary>[v8.2] Represents the branding information.</summary>
/// <field name="manufacturer" type="String">Gets the manufacturer text.</field>
/// <field name="productTitle" type="String">Gets the product title text.</field>
/// <field name="productTitleAndVersion" type="String">[v9.0] Gets the string with product title and version.</field>
/// <field name="productSubTitle" type="String">Gets the product subtitle text.</field>
/// <field name="poweredBy" type="String">Gets the powered by text.</field>
/// <field name="icon" type="String">Gets the icon name.</field>
/// <field name="website" type="String">Gets the website url.</field>
/// <field name="supportEmail" type="String">Gets the support email.</field>
this.manufacturer = "";
this.productTitle = "";
this.productTitleAndVersion = "";
this.productSubTitle = "";
this.poweredBy = "";
this.icon = "";
this.website = "";
this.supportEmail = "";
},
Integration: {
///<summary>Encapsulate methods and properties what can be used for integration.</summary>
},
OAuthSettings: function () {
/// <summary>[v12.4] Represents the settings what are used to authenticate using OAuth server account.</summary>
/// <field name="authorityEndPoint" type="String">Gets or sets the OAuth token url.</field>
/// <field name="authorizationUrl" type="String">Gets or sets the authorization url to get authorization code.</field>
/// <field name="clientId" type="String">Gets or sets the authentication Client Id.</field>
/// <field name="clientSecret" type="String">Gets or sets the Authentication Client Secret.</field>
/// <field name="redirectUrl" type="String">Gets or sets the authorization redirect url for service.</field>
/// <field name="resourceUrl" type="String">Gets or sets the App ID URI of the target web API (secured resource).</field>
/// <field name="scopes" type="String">Gets or sets the scope to limit an application's access to a user's account.</field>
this.authorityEndPoint = "";
this.authorizationUrl = "";
this.authorityEndPoint = "";
this.resourceUrl = "";
this.scopes = "";
this.clientSecret = "";
this.redirectUrl = "";
},
MobileReport: function () {
/// <summary>Provides a functionality of mobile reporting.</summary>
},
Questionnaire: function () {
/// <summary>Provides a functionality for questionnaires.</summary>
},
UI: {
FormManager: {},
EntityForm: function () {
/// <summary>Represents the Javascript equivalent of native entity form object.</summary>
/// <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>
/// <field name="associatedViews" type="Array">Gets the associated views as an array of <see cref="MobileCRM.UI._EntityList">MobileCRM.UI._EntityList</see> objects.</field>
/// <field name="bulkUpdateItems" type="Array">A list of entity records editted on this bulk update form.</field>
/// <field name="canEdit" type="Boolean">Gets whether the form can be edited.</field>
/// <field name="canClose" type="Boolean">Determines if form can be closed, i.e. there are no unsaved data being edited.</field>
/// <field name="context" type="Object">Gets the specific context object for onChange and onSave handlers. The onChange context contains single property "changedItem" with the name of the changed detail item and the onSave context contains property "errorMessage" which can be used to break the save process with certain error message.</field>
/// <field name="controllers" type="Array">Gets the form controllers (map, web) as an array of <see cref="MobileCRM.UI._Controller">MobileCRM.UI._Controller</see> objects.</field>
/// <field name="detailViews" type="Array">Gets the detailView controls as an array of <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> objects.</field>
/// <field name="isBulkUpdateForm" type="Boolean">Indicates whether the form is bulk update form.</field>
/// <field name="entity" type="MobileCRM.DynamicEntity">Gets or sets the entity instance the form is showing.</field>
/// <field name="form" type="MobileCRM.UI.Form">Gets the top level form.</field>
/// <field name="iFrameOptions" type="Object">Carries the custom parameters that can be specified when opening the form using <see cref="MobileCRM.UI.FormManager">MobileCRM.UI.FormManager</see>.</field>
/// <field name="isDirty" type="Boolean">Indicates whether the form has unsaved data.</field>
/// <field name="relationship" type="MobileCRM.Relationship">Defines relationship with parent entity.</field>
/// <field name="visible" type="Boolean">Gets whether the underlying form is visible.</field>
/// <field name="documentView" type="MobileCRM.UI._DocumentView">NoteForm only. Gets the view containing the note attachment.</field>
MobileCRM.UI.EntityForm.superproto.constructor.apply(this, arguments);
},
QuestionnaireForm: function () {
/// <summary>[v10.3] Represents the Javascript equivalent of native questionnaire form object.</summary>
/// <remarks>This object is not available under Essential license.</remarks>
/// <field name="form" type="MobileCRM.UI.Form">Gets the form which hosts the questionnaire.</field>
/// <field name="groups" type="MobileCRM.UI.QuestionnaireForm.Group[]">A list of <see cref="MobileCRM.UI.QuestionnaireForm.Group">QuestionnaireForm.Group</see> objects.</field>
/// <field name="questions" type="MobileCRM.UI.QuestionnaireForm.Question[]">A list of <see cref="MobileCRM.UI.QuestionnaireForm.Question">QuestionnaireForm.Question</see> objects.</field>
/// <field name="relationship" type="MobileCRM.Relationship">Gets the relation source and related entity. "null", if there is no relationship.</field>
MobileCRM.UI.QuestionnaireForm.superproto.constructor.apply(this, arguments);
},
EntityChart: function () {
/// <summary>[13.0] Represents the Javascript equivalent of native entity chart object.</summary>
/// <remarks>This object is not available under Essential license.</remarks>
MobileCRM.UI.EntityChart.superproto.constructor.apply(this, arguments);
},
EntityList: function () {
/// <summary>[v9.2] Represents the Javascript equivalent of native entity list object.</summary>
/// <remarks>This object is not available under Essential license.</remarks>
/// <field name="allowAddExisting" type="Boolean">Gets or sets whether adding an existing entity is allowed.</field>
/// <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>
/// <field name="allowedDocActions" type="Number">Gets or sets a mask of document actions (for Note and Sharepoint document lists).</field>
/// <field name="allowSearch" type="Boolean">Gets or sets whether to show the search bar.</field>
/// <field name="autoWideWidth" type="String">Gets the view auto width pixel size.</field>
/// <field name="context" type="Object">[v10.0] Gets the specific context object for onChange, onSave and onCommand handlers.<p>The onSave context contains property "entities" with the list of all changed entities and property "errorMessage" which can be used to cancel the save process with certain error message.</p><p>The onChange handler context contains "entities" property with the list of currently changed entities (typically just one entity) and property "propertyName" with the field name that was changed.</p><p>Command handler context contains the "cmdParam" property and "entities" property with the list of currently selected entities.</p></field>
/// <field name="currentView" type="String">[v10.0] Gets currently selected entity list view.
/// <field name="entityName" type="String">Gets the name of the entities in this list.</field>
/// <field name="flipMode" type="Number">Gets or sets the flip configuration (which views to show and which one is the initial).</field>
/// <field name="hasMapViews" type="Boolean">Gets whether the list has a view that can be displayed on map.</field>
/// <field name="hasCalendarViews" type="Boolean">Gets or sets whether there is a view with "CalendarFields".</field>
/// <field name="hasMoreButton" type="Boolean">Gets whether the list needs a more button.</field>
/// <field name="internalName" type="String">Gets the internal list name. Used for localization and image lookup.</field>
/// <field name="isDirty" type="Boolean">Gets or sets whether the list is dirty.</field>
/// <field name="isLoaded" type="Boolean">Gets or sets whether the list is loaded.</field>
/// <field name="isMultiSelect" type="Boolean">Gets whether multi selection is active.</field>
/// <field name="listButtons" type="Array">Gets the read-only array of strings defining the list buttons.</field>
/// <field name="listMode" type="Number">Gets the current list mode.</field>
/// <field name="listView" type="MobileCRM.UI._ListView">Gets the controlled listView control.</field>
/// <field name="lookupSource" type="MobileCRM.Relationship">Gets the lookup source. If the list is used for lookup this is the entity whose property is being "looked-up".</field>
/// <field name="options" type="Number">Gets the kinds of views available on the list.</field>
/// <field name="relationship" type="MobileCRM.Relationship">Gets the relation source and related entity. "null", if there is no relationship (if it is not an associated list).</field>
/// <field name="selectedEntity" type="MobileCRM.DynamicEntity">Gets currently selected entity. "null", if there's no selection.</field>
/// <field name="uniqueName" type="Number">Gets or sets the unique name of the list. Used to save/load list specific settings.</field>
MobileCRM.UI.EntityList.superproto.constructor.apply(this, arguments);
},
HomeForm: function () {
/// <summary>[v8.0] Represents the Javascript equivalent of the home form object which contains the Home/UI replacement iFrame.</summary>
/// <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>
/// <field name="form" type="MobileCRM.UI.Form">Gets the top level form.</field>
/// <field name="items" type="Array">Gets the list of the home items.</field>
/// <field name="listView" type="MobileCRM.UI._ListController">Gets the list view with home items.</field>
/// <field name="lastSyncResult" type="MobileCRM.Services.SynchronizationResult">[v8.1] An object with last sync results. Contains following boolean properties: newCustomizationReady, customizationDownloaded, dataErrorsEncountered, appWasLocked, syncAborted, adminFullSync, wasBackgroundSync</field>
/// <field name="syncResultText" type="String">[v8.1] The last synchronization error text.</field>
/// <field name="syncProgress" type="Object">[v8.1] An object with current sync progress. Contains following properties: labels, percent. It is undefined if no sync is running.</field>
MobileCRM.UI.HomeForm.superproto.constructor.apply(this, arguments);
},
ReportForm: function () {
/// <summary>[v8.1] Represents the Dynamics CRM report form object.</summary>
/// <remarks>This object is not available under Essential license.</remarks>
/// <field name="allowedReportIds" type="Array">The list of report entity ids that has to be included in the report form selector.</field>
/// <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>
/// <field name="defaultReport" type="String">The primary name of the report entity that should be pre-selected on the report form.</field>
this.allowedReportIds = [];
this.allowedLanguages = [];
this.defaultReport = null;
},
RoutePlan: function () {
/// <summary>[v14.2] Represents the Javascript equivalent view of RoutePlan form object.</summary>
/// <remarks>This object is not available under Essential license.</remarks>
/// <field name="myRoute" type="DynamicEntity[]">A list of route entities.</field>
/// <field name="completedEntities" type="DynamicEntity[]"> A list of completed entities that are about to be removed from route plan.</field>
/// <field name="routeEntityName" type="String">Logical name of the route visit entity.</field>
/// <field name="routeDay" type="Date">Currently selected route day.</field>
/// <field name="isDirty" type="Boolean">Controls whether the form is dirty and requires save, or whether it can be closed.</field>
MobileCRM.UI.RoutePlan.superproto.constructor.apply(this, arguments);
},
IFrameForm: function () {
/// <summary>[v9.0] Represents the iFrame form object.</summary>
/// <remarks>This object is not available under Essential license.</remarks>
/// <field name="form" type="MobileCRM.UI.Form">Gets the form hosting the iFrame.</field>
/// <field name="isDirty" type="Boolean">[v10.0] Controls whether the form is dirty and requires save, or whether it can be closed.</field>
/// <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>
/// <field name="preventCloseMessage" type="String">[v9.3] Prevents closing the form if non-empty string is set. No other home-item can be opened and synchronization is not allowed to be started. Provided message is shown when user tries to perform those actions.</field>
/// <field name="saveBehavior" type="Number">[v10.0] Controls the behavior of the Save command on this form (0=Default, 1=SaveOnly, 2=SaveAndClose).</field>
MobileCRM.UI.IFrameForm.superproto.constructor.apply(this, arguments);
},
Form: function (props) {
/// <summary>[v8.0] Represents the Javascript equivalent of the form object.</summary>
/// <remarks>This object is not available under Essential license.</remarks>
/// <field name="canMaximize" type="Boolean">Gets or sets whether form can be maximized to fullscreen (full application frame).</field>
/// <field name="isMaximized" type="Boolean">Gets or sets whether form is currently maximized to fullscreen (full application frame).</field>
/// <field name="isModal" type="Boolean">Indicates whether this form is presented as modal window.</field>
/// <field name="caption" type="String">Gets or sets the form caption.</field>
/// <field name="selectedViewIndex" type="Number">Gets or sets the selected view (tab) index.</field>
/// <field name="showTitle" type="Boolean">[v8.1] Determines whether the form caption bar should be visible.</field>
/// <field name="viewCount" type="Number">Gets the count of views in the form.</field>
/// <field name="visible" type="Boolean">Gets whether the form is visible.</field>
MobileCRM.UI.Form.superproto.constructor.apply(this, arguments);
},
ViewController: function () {
/// <summary>Represents the Javascript equivalent of view controller (map/web content).</summary>
/// <remarks>This object is not available under Essential license.</remarks>
},
ProcessController: function () {
/// <summary>[v8.2] Represents the Javascript equivalent of view process controller.</summary>
/// <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>
/// <field name="currentStateInfo" type="Object">Gets the information about the current process flow state (active stage, visible stage and process).</field>
MobileCRM.UI.ProcessController.superproto.constructor.apply(this, arguments);
},
ViewDefinition: function () {
/// <summary>Represents the entity view definition.</summary>
/// <field name="entityName" type="String">Gets the entity this view is for.</field>
/// <field name="name" type="String">Gets the name of the view.</field>
/// <field name="fetch" type="String">Gets the fetchXml query.</field>
/// <field name="kind" type="Number">Gets the kind of the view (public, associated, etc.).</field>
/// <field name="version" type="Number">Gets the version.</field>
/// <field name="buttons" type="String">Gets the view buttons.</field>
/// <field name="selector" type="String">Gets the view template selector workflow.</field>
/// <field name="templates" type="Array">Gets the list templates.</summary>
/// <field name="entityLabel" type="String">Gets the entity label.</summary>
},
MessageBox: function (title, defaultText) {
/// <summary>This object allows the user to show a popup window and choose one of the actions.</summary>
/// <param name="title" type="string">The message box title.</param>
/// <param name="defaultText" type="string">The cancel button title text.</param>
/// <field name="items" type="Array">An array of button names.</field>
/// <field name="title" type="string">The message box title.</field>
/// <field name="defaultText" type="string">The cancel button title text.</field>
/// <field name="multiLine" type="Boolean">Indicates whether the message is multi line.</field>
var nArgs = arguments.length;
var arr = [];
for (var i = 2; i < nArgs; i++) {
arr.push(arguments[i]);
}
this.title = title || null;
this.defaultText = defaultText || null;
this.multiLine = false;
this.items = arr;
},
LookupForm: function () {
/// <summary>This object allows user to select an entity from a configurable list of entity types.</summary>
/// <remarks>This object is not available under Essential license.</remarks>
/// <field name="entities" type="Array">An array of allowed entity kinds (schema names).</field>
/// <field name="allowedViews" type="String">OBSOLETE: Allowed views, or null if all are allowed.</field>
/// <field name="source" type="MobileCRM.Relationship">The entity whose property will be set to the chosen value.</field>
/// <field name="prevSelection" type="MobileCRM.Reference">The entity whose property will be set to the chosen value.</field>
/// <field name="allowNull" type="Boolean">Whether to allow selecting no entity.</field>
/// <field name="preventClose" type="Boolean">Whether to prevent closing form without choosing a value.</field>
var nEntities = arguments.length;
var arr = [];
for (var i = 0; i < nEntities; i++) {
arr.push(arguments[i]);
}
this._views = [];
this.allowedViews = "";
this.entities = arr;
this.source = null;
this.prevSelection = null;
this.allowNull = false;
this.preventClose = false;
},
MultiLookupForm: function () {
/// <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>
/// <remarks>This object is not available under Essential license.</remarks>
/// <field name="entities" type="Array">An array of allowed entity kinds (schema names).</field>
/// <field name="source" type="MobileCRM.Relationship">The entity whose property will be set to the chosen value.</field>
/// <field name="dataSource" type="MobileCRM.Reference[]">The list of entities that should be displayed as selected.</field>
/// <field name="allowNull" type="Boolean">Whether to allow selecting no entity.</field>
/// <field name="initialTab" type="Number">Optional index of the tab which has to be pre-selected - 0=All Items, 1=Selected Items (default).</field>
MobileCRM.UI.MultiLookupForm.superproto.constructor.apply(this, arguments);
this.dataSource = [];
},
TourplanForm: function (props) {
/// <summary>Represents the Javascript equivalent tourplan form object.</summary>
/// <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>
/// <field name="isDirty" type="Boolean">Indicates whether the form has been modified.</field>
/// <field name="isLoaded" type="Boolean">Gets or sets whether the form is loaded.</field>
/// <field name="view" type="MobileCRM.UI._AppointmentView">Gets tourplan form view <see cref="MobileCRM.UI._AppointmentView">MobileCRM.UI.AppointmentView</see>.</field>
MobileCRM.UI.TourplanForm.superproto.constructor.apply(this, arguments);
},
_DetailView: function (props) {
/// <summary>Represents the Javascript equivalent of detail view with set of items responsible for fields editing.</summary>
/// <remarks>This object is not available under Essential license.</remarks>
/// <field name="isDirty" type="Boolean">Indicates whether the value of an item has been modified.</field>
/// <field name="isEnabled" type="Boolean">Gets or sets whether the all items are enabled or disabled.</field>
/// <field name="isVisible" type="Boolean">Gets or sets whether the view is visible.</field>
/// <field name="items" type="Array">An array of <see cref="MobileCRM.UI._DetailItem">MobileCRM.UI._DetailItem</see> objects</field>
/// <field name="name" type="String">Gets the name of the view</field>
MobileCRM.UI._DetailView.superproto.constructor.apply(this, arguments);
},
DetailViewItems: {
Item: function (name, label) {
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> item.</summary>
/// <param name="name" type="String">Defines the item name.</param>
/// <param name="label" type="String">Defines the item label.</param>
/// <field name="name" type="String">Gets or sets the item name.</field>
/// <field name="label" type="String">Gets or sets the item label.</field>
/// <field name="dataMember" type="String">Gets or sets the name of the property containing the item value in data source objects.</field>
/// <field name="errorMessage" type="String">Gets or sets the item error message.</field>
/// <field name="supportingText" type="String">Gets or sets the item supporting text (e.g. description).</field>
/// <field name="isEnabled" type="Boolean">Gets or sets whether the item is editable.</field>
/// <field name="isVisible" type="Boolean">Gets or sets whether the item is visible.</field>
/// <field name="value" type="Object">Gets or sets the bound item value.</field>
/// <field name="isNullable" type="Boolean">Gets or sets whether the item value can be "null".</field>
/// <field name="validate" type="Boolean">Gets or sets whether the item needs validation.</field>
/// <field name="style" type="String">The name of the Woodford item style.</field>
this._type = null;
this.name = name;
this.label = label;
},
SeparatorItem: function (name, label) {
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> separator item.</summary>
/// <param name="name" type="String">Defines the item name.</param>
/// <param name="label" type="String">Defines the item label.</param>
MobileCRM.UI.DetailViewItems.SeparatorItem.superproto.constructor.apply(this, arguments);
this._type = "Separator";
},
TextBoxItem: function (name, label) {
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> text item.</summary>
/// <param name="name" type="String">Defines the item name.</param>
/// <param name="label" type="String">Defines the item label.</param>
/// <field name="numberOfLines" type="Number">Gets or sets the number of lines to display. Default is one.</field>
/// <field name="isPassword" type="Boolean">Gets or sets whether the text value should be masked. Used for password entry.</field>
/// <field name="maxLength" type="Number">Gets to sets the maximum text length.</field>
/// <field name="kind" type="Number">Gets or sets the value kind (Text=0, Email=1, Url=2, Phone=3, Barcode=4).</field>
/// <field name="placeholderText" type="Number">Gets or sets the text that is displayed in the control until the value is changed by a user action or some other operation. Default is empty string.</field>
MobileCRM.UI.DetailViewItems.TextBoxItem.superproto.constructor.apply(this, arguments);
this._type = "TextBox";
},
NumericItem: function (name, label) {
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> numeric item.</summary>
/// <param name="name" type="String">Defines the item name.</param>
/// <param name="label" type="String">Defines the item label.</param>
/// <field name="minimum" type="Number">Gets or sets the minimum allowed value.</field>
/// <field name="maximum" type="Number">Gets or sets the maximum allowed value.</field>
/// <field name="increment" type="Number">Gets or sets the increment (if the upDownVisible is true).</field>
/// <field name="upDownVisible" type="Boolean">Gets or sets whether the up/down control is visible.</field>
/// <field name="decimalPlaces" type="Number">Gets or sets the number of decimal places.</field>
/// <field name="displayFormat" type="String">Gets or sets the value format string.</field>
MobileCRM.UI.DetailViewItems.NumericItem.superproto.constructor.apply(this, arguments);
this._type = "Numeric";
//this.minimum = 0;
//this.maximum = 0;
//this.increment = 1;
//this.upDownVisible = false;
//this.decimalPlaces = 2;
//this.displayFormat = "";
},
CheckBoxItem: function (name, label) {
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> checkbox item.</summary>
/// <param name="name" type="String">Defines the item name.</param>
/// <param name="label" type="String">Defines the item label.</param>
/// <field name="textChecked" type="String">Gets or sets the text for checked state.</field>
/// <field name="textUnchecked" type="String">Gets or sets the text for unchecked state.</field>
MobileCRM.UI.DetailViewItems.CheckBoxItem.superproto.constructor.apply(this, arguments);
this._type = "CheckBox";
this.isNullable = false;
},
DateTimeItem: function (name, label) {
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> date/time item.</summary>
/// <param name="name" type="String">Defines the item name.</param>
/// <param name="label" type="String">Defines the item label.</param>
/// <field name="minimum" type="Date">Gets or sets the minimum allowed value.</field>
/// <field name="maximum" type="Date">Gets or sets the maximum allowed value.</field>
/// <field name="parts" type="Number"> Gets or sets whether to display and edit the date, time or both.</field>
MobileCRM.UI.DetailViewItems.DateTimeItem.superproto.constructor.apply(this, arguments);
this._type = "DateTime";
},
DurationItem: function (name, label) {
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> duration item.</summary>
/// <param name="name" type="String">Defines the item name.</param>
/// <param name="label" type="String">Defines the item label.</param>
MobileCRM.UI.DetailViewItems.DurationItem.superproto.constructor.apply(this, arguments);
this._type = "Duration";
},
ComboBoxItem: function (name, label) {
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> combobox item.</summary>
/// <param name="name" type="String">Defines the item name.</param>
/// <param name="label" type="String">Defines the item label.</param>
/// <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>
/// <field name="listDataSourceValueType" type="String">Type of list data source element value. Default is string, allowed int, string.</param></param>
MobileCRM.UI.DetailViewItems.ComboBoxItem.superproto.constructor.apply(this, arguments);
this._type = "ComboBox";
},
LinkItem: function (name, label, listDropDownFormat) {
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> link item.</summary>
/// <param name="name" type="String">Defines the item name.</param>
/// <param name="label" type="String">Defines the item label.</param>
/// <param name="listDropDownFormat" type="MobileCRM.UI.DetailViewItems.DropDownFormat">Defines item's drop down format.</param>
/// <field name="isMultiLine" type="Boolean">Gets or sets whether the item is multiline. Default is false.</field>
MobileCRM.UI.DetailViewItems.LinkItem.superproto.constructor.apply(this, arguments);
this._type = "Link";
if (listDropDownFormat) {
this.listDropDownFormat = listDropDownFormat;
}
},
ButtonItem: function (name, clickText) {
/// <summary>[8.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> duration item.</summary>
/// <param name="name" type="String">Defines the item name.</param>
/// <param name="clickText" type="String">Gets or sets the text content of click button.</param>
/// <param name="label" type="String">Defines the item label.</param>
MobileCRM.UI.DetailViewItems.DurationItem.superproto.constructor.apply(this, arguments);
this._type = "Button";
this.name = name;
this.isEnabled = true;
this.style = "Button";
this.clickText = clickText;
},
DropDownFormat: {
StringList: 17,
StringListInput: 18,
MultiStringList: 19,
MultiStringListInput: 20,
},
GridItem: function (name, label, gridStyleDefintion) {
/// <summary>[13.0] Represents the <see cref="MobileCRM.UI._DetailView">MobileCRM.UI._DetailView</see> grid item.</summary>
/// <param name="name" type="String">Defines the item name.</param>
/// <param name="label" type="String">Defines the item label.</param>
/// <param name="gridStyleDefintion" type="MobileCRM.UI.DetailViewItems.GridStyleDefintion">Gets or sets the style definition for grid item.</param>
this.items = [];
MobileCRM.UI.DetailViewItems.GridItem.superproto.constructor.apply(this, arguments);
if (gridStyleDefintion) {
this._setGrid(gridStyleDefintion.columns, gridStyleDefintion.rows);
}
this._type = "Grid";
},
GridStyleDefintion: function (columns, rows) {
/// <summary>[13.0] Represents the columns and rows style definition for grid item.</summary>
/// <param name="columns" type="Array">MobileCRM.UI.DetailViewItems.DetailGridLength>">Defines the columns style.</param>
/// <param name="rows" type="Array">MobileCRM.UI.DetailViewItems.DetailGridLength>">Defines the rows style.</param>
this.columns = columns;
this.rows = rows;
},
DetailGridLength: function (value, gridUnitType) {
/// <summary>[13.0] Represents the grid length in grid unit type.</summary>
/// <param name="value" type="String">Grid length value.</param>
/// <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>
this._value = value;
this._gridUnitType = gridUnitType;
},
DetailGridUnitType: {
/// <summary>[13.0] Gets the grid unit type.</summary>
/// <field name="auto" type="enum">Gets automatic unit type.</field>
/// <field name="pixel" type="enum">Gets absolute pixel unit type.</field>
/// <field name="star" type="enum">Gets relative unit type.</field>
auto: 0,
pixel: 1,
star: 2,
},
},
MediaTab: function (index, name) {
/// <summary>Represents the MediaTab controller.</summary>
/// <remarks>An instance of this class can only be obtained by calling the <see cref="MobileCRM.UI.EntityForm.getMediaTab">MobileCRM.UI.EntityForm.getMediaTab</see> method.</remarks>
/// <param name="index" type="Number">The index of an associated media tab.</param>
/// <param name="name" type="String">The name of an associated media tab.</param>