-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPA - UI Action Utils 20.xml
More file actions
1769 lines (1569 loc) · 132 KB
/
PA - UI Action Utils 20.xml
File metadata and controls
1769 lines (1569 loc) · 132 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
<?xml version="1.0" encoding="UTF-8"?><unload unload_date="2018-08-02 09:19:05">
<sys_remote_update_set action="INSERT_OR_UPDATE">
<application display_value="Global">global</application>
<application_name>Global</application_name>
<application_scope>global</application_scope>
<application_version/>
<collisions/>
<commit_date/>
<deleted/>
<description>Adds a few UI Actions to your Indicator and Widget Forms see https://youtu.be/sjIaUDd8P7g
• Preview Widget: Preview your wiget without adding ot or loading it on a Dashboard
• Test Conditions in List: Opens the Indicator conditions in a List, also includes Indicator source condition
• View used Indicators in List: Opens the list of used indicators in a Formula Indicator in a list (can also be added as related list to formula indicator)
• Set Conditions from Clipboard: Show a Prompt in witch you can paste your query prepared in a List, so you don't have to replicate it manually.
• Add the technical field name list to the top of a PA script
• Create and immediate run a PA Job for development from an Automated Indicator. https://youtu.be/fbAYwLHfKko
• Add all the Responsive Canvas Dashboard assets to current update set
• Run and stay data collection job
• Asses Breakdowns on any Form, and create if not exists https://youtu.be/iqo-lW9I87A
• Asses and fix Breakdowns for a Formula Indicator https://youtu.be/xjXJC6AMLVI
• Asses and manage Breakdown Exclusion matrix in a... Matrix
For questions or feedback, please reach out to Arnoud.Kooi@servicenow.com
</description>
<inserted/>
<name>PA - UI Action Utils</name>
<origin_sys_id/>
<parent display_value=""/>
<release_date/>
<remote_base_update_set display_value=""/>
<remote_parent_id/>
<remote_sys_id>c4f2832b4f631300364a4ebf9310c7b1</remote_sys_id>
<state>loaded</state>
<summary/>
<sys_class_name>sys_remote_update_set</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>c1d3072b4f631300364a4ebf9310c7ae</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<update_set display_value=""/>
<update_source display_value=""/>
<updated/>
</sys_remote_update_set>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_script_include_0bbb59e04f244b4035e0fdb28110c776</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update table="sys_script_include"><sys_script_include action="INSERT_OR_UPDATE"><access>public</access><active>true</active><api_name>global.pahelper</api_name><client_callable>true</client_callable><description/><name>pahelper</name><script><![CDATA[var pahelper = {
getTables: function (tableName) {
var tu = String(GlideDBObjectManager.get().getTables(tableName));
var mod_table_str = tu.slice(1, -1);
var table_array = mod_table_str.split(", ");
return table_array;
},
getContainingIndicators: function (indicator, includeThis, arr, cnt){
if (typeof arr == 'undefined') arr = [];
if (typeof cnt == 'undefined') cnt = 1;
if(includeThis) arr.push(indicator);
var gr = new GlideRecord('pa_indicators');
gr.get(indicator);
if (gr.getValue('type') == 2) {
var formula = gr.getValue('formula');
var matches = formula.match(/\[\[(.*?)\]\]|\{\{(.*?)\}\}/g);
for (var i=0; i< matches.length && cnt < 100; i++) {
var ind = matches[i].substring(2,34);
arr.push(ind);
arr = this.getContainingIndicators(ind,true,arr, ++cnt);
}
}
return new ArrayUtil().unique(arr);
},
type: 'pahelper'
};]]></script><sys_class_name>sys_script_include</sys_class_name><sys_created_by>Arnoud.Kooi</sys_created_by><sys_created_on>2017-08-09 18:45:40</sys_created_on><sys_customer_update>false</sys_customer_update><sys_id>0bbb59e04f244b4035e0fdb28110c776</sys_id><sys_mod_count>16</sys_mod_count><sys_name>pahelper</sys_name><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_replace_on_upgrade>false</sys_replace_on_upgrade><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_script_include_0bbb59e04f244b4035e0fdb28110c776</sys_update_name><sys_updated_by>Arnoud.Kooi</sys_updated_by><sys_updated_on>2017-08-22 08:54:09</sys_updated_on></sys_script_include></record_update></payload>
<payload_hash>-1598500985</payload_hash>
<remote_update_set display_value="PA - UI Action Utils">c1d3072b4f631300364a4ebf9310c7ae</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>01d3072b4f631300364a4ebf9310c7b0</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>164f9eb68ba0000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<table/>
<target_name>pahelper</target_name>
<type>Script Include</type>
<update_domain>global</update_domain>
<update_guid>4ca1162423b4cb00a2790e4a9e2a539e</update_guid>
<update_guid_history>4ca1162423b4cb00a2790e4a9e2a539e:-1598500985,e1b4291018bc8b007d6e290dae43f5a4:1759646603,c25c1a7e52640b005a363443fa5bb2a6:1245477554,d8f896ba73640b002d13bf90c916e75a:-193321905,f567dab6ef640b006f9d3026cda71735:953684512,5bde2af5c2a88700b33ea3fa510bd237:715590938,cfbd2af56fa88700b583aba16bdf5e32:780335369,35eca6b5b7a887007a991d2393663437:-1045895745,63ac6ab562a88700dc85c122d5daf014:371247958,f5e9e67535a88700529459beda873eef:278073252,b669a27560a887004c9686afe13b6dd6:29429536,2af36db50128870052dc4593f8df2c7a:1629838742,8412e5b523288700c9309d32ea891072:-1183924947,34a6fcf14ce48700a8cd696e6683042f:389017322,8f3d15242c244b402e3c7c3c14dfce4b:-1261376986,0ccc512412244b401196f59a7925270c:-236483492,565c9de03b244b4023fbf8d2475dc31f:581904584</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_processor_5de3cdd24f54474035e0fdb28110c779</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update table="sys_processor"><sys_processor action="INSERT_OR_UPDATE"><active>true</active><class_name/><description/><interactive>false</interactive><name>pahelper</name><parameters/><params_endpoint/><path>pahelper</path><path_endpoint/><require_csrf>false</require_csrf><roles/><script><![CDATA[(function process(g_request, g_response, g_processor) {
var action = g_request.getParameter("action");
var tables = g_request.getParameter("tables");
var table = g_request.getParameter("table");
var field = g_request.getParameter("field");
if (action == 'gettabledata')
getTableData(table);
else if (action == 'createbreakdown')
startCreateBreakDown(tables,table,field);
})(g_request, g_response, g_processor);
function getTableData(table){
var outp = {};
var table_string = String(new TableUtils("task").getAllExtensions());
var mod_table_str = table_string.slice(1, -1);
var table_array = mod_table_str.split(", ");
outp.tasktables = table_array;
table_string = String(GlideDBObjectManager.get().getTables(table));
mod_table_str = table_string.slice(1, -1);
table_array = mod_table_str.split(", ");
outp.tables = table_array;
g_processor.writeOutput(JSON.stringify(outp));
}
function startCreateBreakDown(tables, table, field){
var MAX_ROWS = parseInt(gs.getProperty('com.snc.pa.dc.max_breakdown_elements_limit'));
var obj = getDictionaryData(tables,table,field);
var cnt = getRowCount(obj.bd_source_table, obj.bd_source_conditions);
gs.log("Rowcount:" + cnt,"auto_bd_create");
if(cnt > MAX_ROWS){
var msg = {};
msg.error = "Breakdown would return " + cnt + " rows. The maximum is " +
MAX_ROWS + " Please create Breakdown manual";
g_processor.writeOutput(JSON.stringify(msg));
return false;
}
var bds = createBreakDownSource(obj);
var bd = createBreakDown(obj, bds);
var bdm = createBreakDownMapping(obj, bd);
var rtrn = {};
rtrn.name = obj.name;
rtrn.sys_id = bd;
g_processor.writeOutput(JSON.stringify(rtrn));
}
function getRowCount(bd_source_table, conditions){
var ga = new GlideAggregate(bd_source_table );
ga.addEncodedQuery(conditions);
ga.addAggregate('COUNT');
ga.query();
ga.next();
return ga.getAggregate('COUNT') || 0;
}
function getDictionaryData(tables,table,field){
var obj = {};
var gr = new GlideRecord('sys_dictionary');
gr.addEncodedQuery("nameIN" + tables + "^element=" + field);
gr.query();
if (gr.next()) {
obj.indicator_tables = tables;
obj.indicator_table = table;
obj.name = gr.getValue('column_label');
obj.field = field;
obj.field_source_table = gr.getValue('name');
obj.description = 'Auto generated using UI Action. Table: ' +
obj.indicator_table + ' Field: ' + obj.field;
if (gr.getValue('reference')){
obj.bd_source_table = gr.getValue('reference');
obj.conditions = gr.getValue('reference_qual_condition') || '';
//gr.getValue('reference_qual') || '';
}
else{
obj.choice_table = gr.getValue('choice_table') || table;
obj.choice_field = gr.getValue('choice_field') || field;
obj.bd_source_table = 'sys_choice';
obj.bd_source_conditions = 'name=' + obj.choice_table
+'^element=' +obj.choice_field
+'^language=en^inactive=false^ORinactiveISEMPTY^EQ';
}
}
return obj;
}
function createBreakDownSource(obj){
var gr = new GlideRecord('pa_dimensions');
gr.initialize();
gr.setValue('name', obj.name);
gr.setValue('facts_table', obj.bd_source_table);
gr.setValue('field', 'sys_id');
gr.setValue('description', obj.description);
gr.setValue('active', true);
gr.setValue('conditions', obj.bd_source_conditions);
gr.setValue('empty_value', 'Unmatched');
return gr.insert();
}
function createBreakDown(obj, bds){
var gr = new GlideRecord('pa_breakdowns');
gr.initialize();
gr.setValue('name', obj.name);
gr.setValue('description', obj.description);
gr.setValue('dimension', bds);
return gr.insert();
}
function createBreakDownMapping(obj, bd){
var gr = new GlideRecord('pa_breakdown_mappings');
gr.initialize();
gr.setValue('breakdown', bd);
gr.setValue('facts_table', obj.indicator_table);
gr.setValue('field', obj.field);
return gr.insert();
}
]]></script><sys_class_name>sys_processor</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>2017-08-02 17:15:06</sys_created_on><sys_customer_update>false</sys_customer_update><sys_id>5de3cdd24f54474035e0fdb28110c779</sys_id><sys_mod_count>114</sys_mod_count><sys_name>pahelper</sys_name><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_replace_on_upgrade>false</sys_replace_on_upgrade><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_processor_5de3cdd24f54474035e0fdb28110c779</sys_update_name><sys_updated_by>Arnoud.Kooi</sys_updated_by><sys_updated_on>2017-08-10 17:04:32</sys_updated_on><type>script</type></sys_processor></record_update></payload>
<payload_hash>1241352720</payload_hash>
<remote_update_set display_value="PA - UI Action Utils">c1d3072b4f631300364a4ebf9310c7ae</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>05d3072b4f631300364a4ebf9310c7af</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>164f9eb68a80000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<table/>
<target_name>pahelper</target_name>
<type>Processor</type>
<update_domain>global</update_domain>
<update_guid>08027e549730cb00b8d1975ab2381dc8</update_guid>
<update_guid_history>08027e549730cb00b8d1975ab2381dc8:1241352720,a2cec6343e6c4b401138134f21dd5526:1241352720,b88d8af01b6c4b4026726f4571b81a1c:515369509,b05882308c6c4b4001e4355891cb1dbe:-309414734,83b58abc9d2c4b4008a7a1f851735450:-237050150,b74502bcbc2c4b4034f033f78216d67c:-2062931981,ba644a3ca12c4b400923b13d4012608f:-1623113939,c143c63cc92c4b402c2b8c9b514f7ca7:1208105688,1f224ef85a2c4b4059132b638e4bab20:691349533,bcb08af81e2c4b407a354736d1f24613:-607179433,86bfb1f8c22c4b40e0a7bd7d8de754fc:725210745,059dfd78592c4b4063ddf590d1d09294:1872431418,9f0dfd781b2c4b40e3b160cdfdfe698c:-376365923,64acfd38ef2c4b40a2d932763f8211d7:1165547440,4e09b9f40d2c4b401c613a502e300cad:1096239733,258f69f0df2c4b40e1325e03bc9b8c14:1888533014,01feadb0032c4b409723e531b94aef2f:-1338899914,f37da5b0a32c4b40dfef6d36592752c3:-2137767172,738219b43ae84b409ebe6569451d692c:-1799745536,70d2ecfcb8684b40a2b371e04b314f90:1331280792,56dc1c3c90684b406e50681fc6c9300b:-2007764930,9b2958f89a684b40af57e8c50c8083d1:1857385771,378818f8dd684b40f402215e744d9c70:569409578,1ea650b8df684b4042f2c4dd6b540edf:-921615234,2c01d7a8dfe44b40881f7a9771f799df:-1141692323,5cd01ba892e44b4018273a5a8e874ff6:1839883501,47b0d7a8ade44b40c327c35326aafbec:-815585466,a06161a44a244b409d20ff2474a8aa1a:-133609478,d5c061246d244b405cec9ca275a67d4d:883645079,84d494604fa04b40060ed6a4573a9166:1044002851,7ce39460bba04b40b2841e601b37e663:1113932406,d9c3d860efa04b402b86dc1d581bee80:319951574,d0339460cea04b40c928fe804785ee5e:-1729890093,fa725460cca04b40cb5c001a7f698eb6:33222400,04629420fda04b401e9e9212c4b0fd4a:1607103945,bd219cec34604b40c113c00d209422c4:196338702,529af4a2fa1c4740c63f01fe6310c57f:-979366315,d75af4a2e91c4740c4e8750ac58969db:1340946738,207d2c2e26d8474068bfb0448e45d8c8:1348212713,6a5b98e2ddd84740308740a01db87d16:-1092442894,284b18e242d847403afd5d11c9643799:-1224902851,c82b18a249d84740375fc1b5ab593c7a:-273107520,b44918a2f0d847407a0a13fb50819e77:-1474894749,79861c22d4d84740ab89167a2648e755:433153306,8e5f91524d9447408647fe9c7b443502:1829827620,db29dd5e095447400536674597073f77:-1443119955,07a7155e9b54474097107645e650415e:1667932267,82871d1e345447405ba6cc9a44c4b477:1349322562,2b375d1eac54474042344236f7622d02:771938009,e676111e9054474032c9690a7eeea623:425573285,91c5111ed454474040f6a5dd49d8e51f:-861734686,a055dddaf9544740bdab63106fa929a6:-13825499,281599da83544740eb56691d8a1004d4:1756837724,d034d5dab5544740b26f728fb0d0bcb2:-785024364,eff29d9a515447402fb51d6f2fb59133:1576842230,b501119af6544740e1425d57ad1f376c:63159431,8aa0d95a8e5447407f46103e1bfadcc7:1314417157,52709d1aa6544740eef70eddb0a3f2db:-1899429060,2f9e0d1a615447404b80b12f68af7b69:-247671047,e16e0d1af25447408d9590a157a5a667:2117981332,e53ec51a5a5447409de93034d3466313:1943512917,427d051a235447409b82564ab11fe25c:314668122,87ec4dd6065447403de9f923f27a87b6:489136537,431cc5d602544740f6da026651266e33:1801400057,febb01d65e544740ad21a4e63113de48:44228531,7f4acd561a5447406f0d86fe186fe9be:1862319494,e7d9cd569d5447406d3d358ab7ab2fbb:1411596905,ebc9cd56ab544740925087ec26e59bb6:-1705670942,5e8805166754474086acc801141ea520:1875276116,5b74cdd2775447401cccbb59a270cf7d:1248647839</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_ui_action_d9b7ca374fde220074570ab18110c7e2</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update sys_domain="global" table="sys_ui_action"><sys_ui_action action="INSERT_OR_UPDATE"><action_name/><active>true</active><client>true</client><comments>Preview your wiget without adding ot or loading it on a Dashboard, using a GlideBox&#13;
&#13;
Part of PA - UI Action Utils by Arnoud Kooi</comments><condition/><form_action>true</form_action><form_button>false</form_button><form_context_menu>true</form_context_menu><form_link>true</form_link><hint>Preview your wiget without adding ot or loading it on a Dashboard</hint><list_action>false</list_action><list_banner_button>false</list_banner_button><list_button>false</list_button><list_choice>false</list_choice><list_context_menu>false</list_context_menu><list_link>false</list_link><list_save_with_form_button>false</list_save_with_form_button><name>Preview Widget</name><onclick>showWidget()</onclick><order>100</order><script><![CDATA[function showWidget() {
if (!g_form.submitted && g_form.modified) {
g_form.addWarningMessage('Please save widget before previewing');
return;
}
var sysId = gel('sys_uniqueValue').value;
var wtype = gel('pa_widgets.type').value;
var wwidth = (wtype == 'score') ? 350 : '85%';
var wheigth = (wtype == 'score') ? 350 : 600;
var box = new GlideBox({
iframe : '$pa_widget.do?jvar_sys_id='+ sysId
+'&jvar_display_mode=normal&jvar_widget_type='
+ wtype ,
width : wwidth,
height : wheigth,
title : "Preview: " + gel('pa_widgets.name').value,
noTitle : true
});
box.render();
}]]></script><show_insert>false</show_insert><show_multiple_update>false</show_multiple_update><show_query>false</show_query><show_update>true</show_update><sys_class_name>sys_ui_action</sys_class_name><sys_created_by>Arnoud.Kooi_SHARE</sys_created_by><sys_created_on>2016-10-10 10:00:00</sys_created_on><sys_customer_update>true</sys_customer_update><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>d9b7ca374fde220074570ab18110c7e2</sys_id><sys_mod_count>3</sys_mod_count><sys_name>Preview Widget</sys_name><sys_overrides/><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_replace_on_upgrade>false</sys_replace_on_upgrade><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_ui_action_d9b7ca374fde220074570ab18110c7e2</sys_update_name><sys_updated_by>Arnoud.Kooi_SHARE</sys_updated_by><sys_updated_on>2016-11-18 20:43:54</sys_updated_on><table>pa_widgets</table><ui11_compatible>true</ui11_compatible><ui16_compatible>false</ui16_compatible></sys_ui_action></record_update></payload>
<payload_hash/>
<remote_update_set display_value="PA - UI Action Utils">c1d3072b4f631300364a4ebf9310c7ae</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>05d3072b4f631300364a4ebf9310c7b2</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>164f9eb68010000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<table>pa_widgets</table>
<target_name>Preview Widget</target_name>
<type>UI Action</type>
<update_domain>global</update_domain>
<update_guid/>
<update_guid_history/>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_processor_0219325f4f244b009881c5c18110c7a2</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update table="sys_processor"><sys_processor action="INSERT_OR_UPDATE"><active>true</active><class_name/><description/><interactive>false</interactive><name>pa_bd_exclusion_json</name><parameters/><params_endpoint/><path>pa_bd_exclusion_json</path><path_endpoint/><require_csrf>false</require_csrf><roles/><script><![CDATA[(function process(g_request, g_response, g_processor) {
//created by Arnoud
var action = g_request.getParameter("action");
var indicator = g_request.getParameter("indicator");
var bd1 = g_request.getParameter("bd1");
var bd2 = g_request.getParameter("bd2");
if (action == "getjson")
if (indicator)
g_processor.writeOutput("application/json", getBreakdowns(indicator));
if (action == "toggleexclusion")
g_processor.writeOutput(toggleExclusion(indicator, bd1, bd2));
})(g_request, g_response, g_processor);
function getBreakdowns(indicator) {
var gr = new GlideRecord('pa_indicator_breakdowns');
gr.addQuery("indicator", indicator);
gr.orderBy('breakdown.name');
gr.query();
var bd = {};
bd.order = [];
while (gr.next()) {
var bd_sys_id = gr.getValue('breakdown');
bd[bd_sys_id] = {};
bd.order.push(bd_sys_id);
bd[bd_sys_id]['name'] = gr.getDisplayValue('breakdown');
bd[bd_sys_id]['count'] = getBreakDownCount(gr.breakdown.dimension.facts_table, gr.breakdown.dimension.conditions);
bd[bd_sys_id]['exclusions'] = [];
}
var gr2 = new GlideRecord('pa_indicator_breakdown_excl');
gr2.addQuery("indicator", indicator);
gr2.query();
while (gr2.next()) {
bd[gr2.getValue('breakdown')]['exclusions'].push(gr2.getValue('breakdown_level2'));
bd[gr2.getValue('breakdown_level2')]['exclusions'].push(gr2.getValue('breakdown'));
}
return JSON.stringify(bd);
}
function getBreakDownCount(table,conditions){
var rtrn = 0;
var count = new GlideAggregate(table);
count.addEncodedQuery(conditions);
count.addAggregate('COUNT');
count.query();
if (count.next()) {
rtrn = count.getAggregate('COUNT');
}
return parseInt(rtrn) || 0;
}
function toggleExclusion(indicator, bd1, bd2) {
var add = true;
var query = "indicator=" + indicator +
"^breakdown=" + bd1 + "^ORbreakdown=" + bd2 +
"^breakdown_level2=" + bd1 + "^ORbreakdown_level2=" + bd2;
var gr = new GlideRecord('pa_indicator_breakdown_excl');
gr.addEncodedQuery(query);
gr.query();
while (gr.next()) {
gr.deleteRecord();
add = false;
}
if (add) {
gr.initialize();
gr.setValue("indicator", indicator);
gr.setValue("breakdown", bd1);
gr.setValue("breakdown_level2", bd2);
gr.insert();
}
return '' + add;
}
]]></script><sys_class_name>sys_processor</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>2017-08-18 14:34:11</sys_created_on><sys_customer_update>false</sys_customer_update><sys_id>0219325f4f244b009881c5c18110c7a2</sys_id><sys_mod_count>15</sys_mod_count><sys_name>pa_bd_exclusion_json</sys_name><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_replace_on_upgrade>false</sys_replace_on_upgrade><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_processor_0219325f4f244b009881c5c18110c7a2</sys_update_name><sys_updated_by>Arnoud.Kooi</sys_updated_by><sys_updated_on>2017-08-20 12:56:35</sys_updated_on><type>script</type></sys_processor></record_update></payload>
<payload_hash>-798374831</payload_hash>
<remote_update_set display_value="PA - UI Action Utils">c1d3072b4f631300364a4ebf9310c7ae</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>09d3072b4f631300364a4ebf9310c7ae</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>164f9eb68a00000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<table/>
<target_name>pa_bd_exclusion_json</target_name>
<type>Processor</type>
<update_domain>global</update_domain>
<update_guid>48027e548630cb00993f5e5eee8659c7</update_guid>
<update_guid_history>48027e548630cb00993f5e5eee8659c7:-798374831,37e5bcccfd748b00610c71e0768674b3:-798374831,7fb274cc21748b002229b492d96422d6:-1879678046,a49d04e717e44b00b08f492af4038af4:-851744787,dc0b08275ce44b00e8a1e27562468f5f:428993141,70d59bdbd4644b00044a1becdd68cb91:1409691177,1824cbd3b6644b00c61454b907c120d8:1173341355,0dc3c7d3f1644b0046aa3c14a32bbc6f:-1132658533,8863c7d3b0644b00c71d95d249e0024e:848841497,fb13c3d3b0644b004bf54a0d1344f265:1119214185,8af2c3d39b644b004b9fd4225b83453a:-1169007888,bec28f9313644b00bd3e57c4b39becbb:1971753743,8aa28f9372644b0058ee10d5175d7bb7:1893315489,04824f934a644b00e927c8c545d4a4c2:-1133808351,7b324b936d644b008f96f1efc423e38d:-1169007888,406ff2530a644b00548b89c7d5677ebf:1927190256,0219325fe7244b00c584a73daaa422a3:789060927</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_ui_action_5a2694b34f5e220074570ab18110c780</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update sys_domain="global" table="sys_ui_action"><sys_ui_action action="INSERT_OR_UPDATE"><action_name>Set Conditions from Clipboard</action_name><active>true</active><client>true</client><comments>Show a Prompt in witch you can paste your query prepared in a List, so you don't have to replicate it manually. The (exact) condition of the indicator source will be omitted.&#13;
&#13;
Part of PA - UI Action Utils by Arnoud Kooi</comments><condition>current.type != 2</condition><form_action>true</form_action><form_button>false</form_button><form_context_menu>false</form_context_menu><form_link>true</form_link><hint>Show a Prompt in witch you can paste your query prepared in a List, so you don't have to replicate it manually.</hint><list_action>false</list_action><list_banner_button>false</list_banner_button><list_button>false</list_button><list_choice>false</list_choice><list_context_menu>false</list_context_menu><list_link>false</list_link><list_save_with_form_button>false</list_save_with_form_button><name>Set Conditions from Clipboard</name><onclick>setconditions();</onclick><order>40</order><script><![CDATA[function setconditions(){
var src_cond = g_scratchpad.cube_conditions.replace('^EQ','');
var conditionsOld = g_form.getValue('conditions');
var conditionsNew = prompt("Paste query", conditionsOld);
if (conditionsNew !== null) {
var ind_cond = conditionsNew;
for (var i = 0; i <10;i++){
ind_cond = ind_cond.replace(src_cond,'').replace('^NQ^','^NQ');
}
g_form.setValue('conditions',ind_cond);
}
}
]]></script><show_insert>true</show_insert><show_multiple_update>false</show_multiple_update><show_query>false</show_query><show_update>true</show_update><sys_class_name>sys_ui_action</sys_class_name><sys_created_by>Arnoud.Kooi_SHARE</sys_created_by><sys_created_on>2016-10-10 10:00:00</sys_created_on><sys_customer_update>true</sys_customer_update><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>5a2694b34f5e220074570ab18110c780</sys_id><sys_mod_count>9</sys_mod_count><sys_name>Set Conditions from Clipboard</sys_name><sys_overrides/><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_replace_on_upgrade>false</sys_replace_on_upgrade><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_ui_action_5a2694b34f5e220074570ab18110c780</sys_update_name><sys_updated_by>Arnoud.Kooi_SHARE</sys_updated_by><sys_updated_on>2016-11-18 21:05:32</sys_updated_on><table>pa_indicators</table><ui11_compatible>false</ui11_compatible><ui16_compatible>false</ui16_compatible></sys_ui_action></record_update></payload>
<payload_hash/>
<remote_update_set display_value="PA - UI Action Utils">c1d3072b4f631300364a4ebf9310c7ae</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>09d3072b4f631300364a4ebf9310c7b1</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>164f9eb67f80000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<table>pa_indicators</table>
<target_name>Set Conditions from Clipboard</target_name>
<type>UI Action</type>
<update_domain>global</update_domain>
<update_guid/>
<update_guid_history/>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_ui_action_1a9f4a324f640b009881c5c18110c7f7</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update sys_domain="global" table="sys_ui_action"><sys_ui_action action="INSERT_OR_UPDATE"><action_name/><active>true</active><client>true</client><comments/><condition>!current.isNewRecord() &amp;&amp; current.type == 2</condition><form_action>true</form_action><form_button>false</form_button><form_context_menu>false</form_context_menu><form_link>true</form_link><form_style>primary</form_style><hint/><list_action>false</list_action><list_banner_button>false</list_banner_button><list_button>false</list_button><list_choice>false</list_choice><list_context_menu>false</list_context_menu><list_link>false</list_link><list_save_with_form_button>false</list_save_with_form_button><list_style/><name>Check Breakdowns</name><onclick>checkIndicatorBreakDowns()</onclick><order>1</order><script><![CDATA[function checkIndicatorBreakDowns() {
var gm = new GlideModal('ind_bds',false, 'modal-lg');
gm.setPreference("sysparm_indicator", g_form.getUniqueValue());
gm.setTitle("Asses Breakdowns");
gm.render();
}
]]></script><show_insert>true</show_insert><show_multiple_update>false</show_multiple_update><show_query>false</show_query><show_update>true</show_update><sys_class_name>sys_ui_action</sys_class_name><sys_created_by>Arnoud.Kooi</sys_created_by><sys_created_on>2017-08-16 22:19:03</sys_created_on><sys_customer_update>false</sys_customer_update><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>1a9f4a324f640b009881c5c18110c7f7</sys_id><sys_mod_count>10</sys_mod_count><sys_name>Check Breakdowns</sys_name><sys_overrides/><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_replace_on_upgrade>false</sys_replace_on_upgrade><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_ui_action_1a9f4a324f640b009881c5c18110c7f7</sys_update_name><sys_updated_by>Arnoud.Kooi</sys_updated_by><sys_updated_on>2017-08-18 09:31:05</sys_updated_on><table>pa_indicators</table><ui11_compatible>false</ui11_compatible><ui16_compatible>false</ui16_compatible></sys_ui_action></record_update></payload>
<payload_hash>781404316</payload_hash>
<remote_update_set display_value="PA - UI Action Utils">c1d3072b4f631300364a4ebf9310c7ae</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>0dd3072b4f631300364a4ebf9310c7b0</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>164f9eb68550000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<table>pa_indicators</table>
<target_name>Check Breakdowns</target_name>
<type>UI Action</type>
<update_domain>global</update_domain>
<update_guid>93c50d90557c8b00e20ed523bdca5228</update_guid>
<update_guid_history>93c50d90557c8b00e20ed523bdca5228:781404316,4eb3b91faba04b00c2d4b6409a96a67b:781404316,c6d45636ea640b0052f7b04290f32ec5:1416311374,dfa49ef22b640b00c2fc85cf54d03185:778031264,958316f222640b003adf3dd4a3936bbf:548944602,be03deb210640b0099f1d5f89709a649:-1617184760,cbb21ab276640b00b03902868ee22b51:-474777058,45c1d2b284640b000ae0922f2146b5eb:-1717203719,2031d6725a640b00bd50ed44f53ea2ee:-191152900,c1e096728a640b0067e31cc202fb98d5:-1717203719,2680127221640b00a3ab9c7fbf8e73a2:-96106181,44505632fd640b004137eec7e8b98d8f:-161568638</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_processor_4066f9364f240b009881c5c18110c777</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update table="sys_processor"><sys_processor action="INSERT_OR_UPDATE"><active>true</active><class_name/><description>Used by UI Action to asses Formula Breakdowns</description><interactive>false</interactive><name>pa_ind_bds_json</name><parameters/><params_endpoint/><path>pa_ind_bds_json</path><path_endpoint/><require_csrf>false</require_csrf><roles/><script><![CDATA[(function process(g_request, g_response, g_processor) {
//created by Arnoud
var action = g_request.getParameter("action");
var indicator = g_request.getParameter("indicator");
var breakdown = g_request.getParameter("breakdown");
var order = g_request.getParameter("order");
if (action == "getjson")
if (indicator)
g_processor.writeOutput("application/json", GetIndicatorAndNames(indicator));
if (action == "addmapping")
g_processor.writeOutput(addMapping(indicator, breakdown, order));
})(g_request, g_response, g_processor);
function addMapping(indicator, breakdown, order) {
var gr = new GlideRecord('pa_indicator_breakdowns');
gr.initialize();
gr.setValue('indicator', indicator);
gr.setValue('breakdown', breakdown);
gr.setValue('order', order);
gr.setValue('display', true);
return gr.insert() || 'invalid';
}
function GetIndicatorAndNames(ind) {
var obj = {};
obj.indicators = {};
obj.breakdowns = {};
var inds = pahelper.getContainingIndicators(ind, true);
var gr = new GlideRecord('pa_indicators');
gr.addQuery("sys_id", inds);
gr.query();
while (gr.next()) {
var ind_sys_id = gr.getValue('sys_id');
var ibds = GetIndicatorBreakDowns(ind_sys_id);
obj.indicators['ordered'] = inds;
obj.indicators[ind_sys_id] = {};
obj.indicators[ind_sys_id].parent = (ind_sys_id == ind);
obj.indicators[ind_sys_id].type = gr.getDisplayValue('type');
obj.indicators[ind_sys_id].name = gr.getValue('name');
obj.indicators[ind_sys_id].facts_table = '' + gr.cube.facts_table;
obj.indicators[ind_sys_id].facts_tables = pahelper.getTables('' + gr.cube.facts_table);
obj.indicators[ind_sys_id].ind_bds = ibds;
obj.breakdowns['ordered'] = [];
for (var ibd in ibds) {
var sid = ibds[ibd].breakdown;
obj.breakdowns[sid] = {};
obj.breakdowns[sid]['name'] = ibds[ibd].name;
obj.breakdowns[sid]['breakdown_source'] = ibds[ibd].breakdown_source;
obj.breakdowns[sid]['breakdown_source_sys_id'] = ibds[ibd].breakdown_source_sys_id;
}
}
//tedious way to sort breakdowns by name...
var bdSorted = []; for(var bd in obj.breakdowns) bdSorted.push(bd) ;
var bds = new GlideRecord('pa_breakdowns');
bds.addQuery("sys_id", bdSorted);
bds.orderBy('name');
bds.query();
while (bds.next()) {
obj.breakdowns['ordered'].push(bds.getValue('sys_id'));
}
var bdFactsTables = GetIndicatorBreakDownMappingTables(bdSorted);
for (var bdFactsTable in bdFactsTables){
obj.breakdowns[bdFactsTable]['facts_tables'] = bdFactsTables[bdFactsTable];
}
return JSON.stringify(obj);
}
function GetIndicatorBreakDownMappingTables(bds) {
var gr = new GlideRecord('pa_breakdown_mappings');
gr.addQuery("breakdown", bds);
gr.orderBy("breakdown");
gr.query();
var bdFactsTables = {};
var bd = "";
while (gr.next()) {
if (bd != gr.getValue("breakdown")) {
bd = gr.getValue("breakdown");
bdFactsTables[bd] = [];
}
bdFactsTables[bd].push(gr.getValue("facts_table"));
}
return bdFactsTables;
}
function GetIndicatorBreakDowns(ind) {
var gr = new GlideRecord('pa_indicator_breakdowns');
gr.addQuery("indicator", ind);
gr.query();
var arr = [];
while (gr.next()) {
var ibd = {};
ibd.sys_id = gr.getValue('sys_id');
ibd.breakdown = gr.getValue('breakdown');
ibd.breakdown_source = gr.breakdown.dimension.getDisplayValue();
ibd.breakdown_source_sys_id = gr.breakdown.dimension.getValue();
ibd.name = gr.getDisplayValue('breakdown');
ibd.order = gr.getValue('order');
arr.push(ibd);
}
return arr;
}
]]></script><sys_class_name>sys_processor</sys_class_name><sys_created_by>Arnoud.Kooi</sys_created_by><sys_created_on>2017-08-16 20:25:43</sys_created_on><sys_customer_update>false</sys_customer_update><sys_id>4066f9364f240b009881c5c18110c777</sys_id><sys_mod_count>30</sys_mod_count><sys_name>pa_ind_bds_json</sys_name><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_replace_on_upgrade>false</sys_replace_on_upgrade><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_processor_4066f9364f240b009881c5c18110c777</sys_update_name><sys_updated_by>Arnoud.Kooi</sys_updated_by><sys_updated_on>2017-08-22 08:41:46</sys_updated_on><type>script</type></sys_processor></record_update></payload>
<payload_hash>-570690528</payload_hash>
<remote_update_set display_value="PA - UI Action Utils">c1d3072b4f631300364a4ebf9310c7ae</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>41d3072b4f631300364a4ebf9310c7af</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>164f9eb68b20000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<table/>
<target_name>pa_ind_bds_json</target_name>
<type>Processor</type>
<update_domain>global</update_domain>
<update_guid>fece8ee093b4cb003dc55c206a72776b</update_guid>
<update_guid_history>fece8ee093b4cb003dc55c206a72776b:-570690528,5b90391828bc8b009c721856f13572a6:-2065144148,2b50b51844bc8b0047b5e0fc699ece20:888542983,7a4589dcc13c8b00964c89126a73c1bc:542981989,9fb1e2d314244b0099e4cd460df49254:1700216523,bbff255b38a04b0054561e9766afe903:1565373998,023c6dd769a04b00b7a7e21eea9118aa:-284126251,558badd786a04b008823210e109c3cb8:2006330090,aeda2dd773a04b00cb0ffb07ea6e4ef8:1598946005,7878e19714a04b001c55171353eab8c4:-1579741323,a7d7e197dda04b00ca1c7a8f2438de83:-1751905523,1d6e2c8f76680b008c2357b0f00223d3:-1144922157,9f2eac4f11680b0027063c04d300aa0e:-883908748,19db6ccb88680b00fa34e466dd7ce648:-878953712,bf7ba08fe3680b00d41391edeca927c1:-1373161504,aed96ccbad680b003830dfc89a244542:1911966802,cb7560cb2b680b00de967271225a0dd6:-1267049991,ba24e44b95680b0096a1d08354c99e0b:1546575472,508360cb44680b00c5b4aab0992f69d3:-491366121,55b2e44b07680b008f6dd5904d046507:-94340281,2ebd9cc70e680b00d07edbf18c94d60d:-930938246,2f21e23274a40b00d5d0eef5dee4070a:392216647,3ca0663277a40b0035789b1b41990f0a:-1451109805,5d66463eb8240b00d314b8eb48daaa36:-480496242,ecf7f576b9240b00bec080f71dbd62ad:-268658128,f5c7f5768c240b002283190fe8e8fc82:371995897,a397357667240b0052da9b928933817c:302418108,5497f17631240b003c1db21cfb37b300:675191991,2567b93653240b00b04be40b9f1205ba:-282026800,f317b93666240b009e8042a5a0bd46b2:-1900055749,0466f93687240b008a72efb734adb078:1901665993</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_ui_action_bb4534fb4f5e220074570ab18110c763</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update sys_domain="global" table="sys_ui_action"><sys_ui_action action="INSERT_OR_UPDATE"><action_name>Set Conditions from Clipboard</action_name><active>true</active><client>true</client><comments>Open the list of used indicators in a Formula Indicator in a list&#13;
&#13;
Part of PA - UI Action Utils by Arnoud Kooi</comments><condition>!current.isNewRecord() &amp;&amp; current.type == 2</condition><form_action>true</form_action><form_button>false</form_button><form_context_menu>false</form_context_menu><form_link>true</form_link><form_style/><hint>Opens the list of used indicators in a Formula Indicator in a list</hint><list_action>false</list_action><list_banner_button>false</list_banner_button><list_button>false</list_button><list_choice>false</list_choice><list_context_menu>false</list_context_menu><list_link>false</list_link><list_save_with_form_button>false</list_save_with_form_button><list_style/><name>View used Indicators in List</name><onclick>viewIndicators();</onclick><order>1</order><script><![CDATA[function viewIndicators(){
window.open('/pa_indicators_list.do?sysparm_query=sys_id=javascript:pahelper.getContainingIndicators("' + g_form.getUniqueValue() + '")','indicators');
}]]></script><show_insert>false</show_insert><show_multiple_update>false</show_multiple_update><show_query>false</show_query><show_update>true</show_update><sys_class_name>sys_ui_action</sys_class_name><sys_created_by>Arnoud.Kooi_SHARE</sys_created_by><sys_created_on>2016-10-10 10:00:00</sys_created_on><sys_customer_update>true</sys_customer_update><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>bb4534fb4f5e220074570ab18110c763</sys_id><sys_mod_count>7</sys_mod_count><sys_name>View used Indicators in List</sys_name><sys_overrides/><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_replace_on_upgrade>false</sys_replace_on_upgrade><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_ui_action_bb4534fb4f5e220074570ab18110c763</sys_update_name><sys_updated_by>Arnoud.Kooi</sys_updated_by><sys_updated_on>2017-08-18 09:31:19</sys_updated_on><table>pa_indicators</table><ui11_compatible>false</ui11_compatible><ui16_compatible>false</ui16_compatible></sys_ui_action></record_update></payload>
<payload_hash>-1795855232</payload_hash>
<remote_update_set display_value="PA - UI Action Utils">c1d3072b4f631300364a4ebf9310c7ae</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>41d3072b4f631300364a4ebf9310c7b2</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>164f9eb68490000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<table>pa_indicators</table>
<target_name>View used Indicators in List</target_name>
<type>UI Action</type>
<update_domain>global</update_domain>
<update_guid>d3c50d90c77c8b0047a1a8f3bdd70527</update_guid>
<update_guid_history>d3c50d90c77c8b0047a1a8f3bdd70527:-1795855232,e5c37d1f02a04b0084de9e162c18314a:-1795855232,494b26b526a88700ff4dc790fdfc96e7:1229270002,a51ba2b511a8870055421bf6450cabeb:1147222826,-163965776:-163965776</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_ui_action_5487ec3b4f5e220074570ab18110c7af</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update sys_domain="global" table="sys_ui_action"><sys_ui_action action="INSERT_OR_UPDATE"><action_name>Set Conditions from Clipboard</action_name><active>true</active><client>true</client><comments>Open a new tab with the current condition, included with the condition of the Indicator Source &#13;
&#13;
Part of PA - UI Action Utils by Arnoud Kooi</comments><condition/><form_action>true</form_action><form_button>false</form_button><form_context_menu>false</form_context_menu><form_link>true</form_link><hint>Open a new tab with the current condition, included with the condition of the Indicator Source </hint><list_action>false</list_action><list_banner_button>false</list_banner_button><list_button>false</list_button><list_choice>false</list_choice><list_context_menu>false</list_context_menu><list_link>false</list_link><list_save_with_form_button>false</list_save_with_form_button><name>Set Conditions from Clipboard</name><onclick>setconditions();</onclick><order>40</order><script><![CDATA[function setconditions(){
var conditionsOld = g_form.getValue('conditions');
var conditionsNew = prompt("Paste query", conditionsOld);
if (conditionsNew !== null)
g_form.setValue('conditions',conditionsNew);
}
]]></script><show_insert>true</show_insert><show_multiple_update>false</show_multiple_update><show_query>false</show_query><show_update>true</show_update><sys_class_name>sys_ui_action</sys_class_name><sys_created_by>Arnoud.Kooi_SHARE</sys_created_by><sys_created_on>2016-10-10 10:00:00</sys_created_on><sys_customer_update>true</sys_customer_update><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>5487ec3b4f5e220074570ab18110c7af</sys_id><sys_mod_count>9</sys_mod_count><sys_name>Set Conditions from Clipboard</sys_name><sys_overrides/><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_replace_on_upgrade>false</sys_replace_on_upgrade><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_ui_action_5487ec3b4f5e220074570ab18110c7af</sys_update_name><sys_updated_by>Arnoud.Kooi_SHARE</sys_updated_by><sys_updated_on>2016-11-18 21:00:46</sys_updated_on><table>pa_cubes</table><ui11_compatible>false</ui11_compatible><ui16_compatible>false</ui16_compatible></sys_ui_action></record_update></payload>
<payload_hash/>
<remote_update_set display_value="PA - UI Action Utils">c1d3072b4f631300364a4ebf9310c7ae</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>45d3072b4f631300364a4ebf9310c7b1</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>164f9eb680f0000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<table>pa_cubes</table>
<target_name>Set Conditions from Clipboard</target_name>
<type>UI Action</type>
<update_domain>global</update_domain>
<update_guid/>
<update_guid_history/>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_ui_action_11d2fe9b4f244b009881c5c18110c7d0</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update sys_domain="global" table="sys_ui_action"><sys_ui_action action="INSERT_OR_UPDATE"><action_name/><active>true</active><client>true</client><comments/><condition>!current.isNewRecord() &amp;&amp; current.type == 1</condition><form_action>true</form_action><form_button>false</form_button><form_context_menu>false</form_context_menu><form_link>true</form_link><form_style>primary</form_style><hint/><list_action>false</list_action><list_banner_button>false</list_banner_button><list_button>false</list_button><list_choice>false</list_choice><list_context_menu>false</list_context_menu><list_link>false</list_link><list_save_with_form_button>false</list_save_with_form_button><list_style/><name>Check Breakdown Exclusions</name><onclick>checkBreakDownExclusions()</onclick><order>2</order><script><![CDATA[function checkBreakDownExclusions() {
var gm = new GlideModal('ind_bd_exclusion',false, 'modal-lg');
gm.setPreference("sysparm_indicator", g_form.getUniqueValue());
gm.setTitle("Asses Breakdown Exclusion Matrix");
gm.render();
}
]]></script><show_insert>true</show_insert><show_multiple_update>false</show_multiple_update><show_query>false</show_query><show_update>true</show_update><sys_class_name>sys_ui_action</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>2017-08-18 14:06:50</sys_created_on><sys_customer_update>false</sys_customer_update><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>11d2fe9b4f244b009881c5c18110c7d0</sys_id><sys_mod_count>9</sys_mod_count><sys_name>Check Breakdown Exclusions</sys_name><sys_overrides/><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_replace_on_upgrade>false</sys_replace_on_upgrade><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_ui_action_11d2fe9b4f244b009881c5c18110c7d0</sys_update_name><sys_updated_by>Arnoud.Kooi</sys_updated_by><sys_updated_on>2017-08-18 22:01:41</sys_updated_on><table>pa_indicators</table><ui11_compatible>false</ui11_compatible><ui16_compatible>false</ui16_compatible></sys_ui_action></record_update></payload>
<payload_hash>-2035740880</payload_hash>
<remote_update_set display_value="PA - UI Action Utils">c1d3072b4f631300364a4ebf9310c7ae</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>49d3072b4f631300364a4ebf9310c7b0</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>164f9eb683f0000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<table>pa_indicators</table>
<target_name>Check Breakdown Exclusions</target_name>
<type>UI Action</type>
<update_domain>global</update_domain>
<update_guid>17c50d90ce7c8b0090f9dacbd7531e26</update_guid>
<update_guid_history>17c50d90ce7c8b0090f9dacbd7531e26:-2035740880,598f9c238b284b00714a92b35c930a6a:-2035740880,94be5023a5284b004f8fa55e1792f31d:1532062353,ec1e102390284b004d4c2c8b6e7d9c5f:-233180575,ffabd4afdee44b00c3ec1a1cc1bad518:-1541043617,b1ca54af54e44b0007ccfd94e1f00c01:-1052663642,558a1c6f8de44b00734c68671f9d953f:-447360860,f10a146f27e44b0017bddc009f23deef:1354028992,cc09506f66e44b00d47efbc178147610:1623501998,6613f6dbc8244b004bc9175518298d90:1658631702,59d2fe9bc9244b000f75d9c3db796dd1:560397841</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_script_6dea047f4f1e220074570ab18110c770</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update sys_domain="global" table="sys_script"><sys_script action="INSERT_OR_UPDATE"><abort_action>false</abort_action><access>package_private</access><action_delete>false</action_delete><action_insert>false</action_insert><action_query>false</action_query><action_update>false</action_update><active>true</active><add_message>false</add_message><advanced>true</advanced><change_fields>false</change_fields><client_callable>false</client_callable><collection>pa_indicators</collection><condition/><description/><execute_function>false</execute_function><filter_condition/><is_rest>false</is_rest><message/><name>Add data to ScratchPad</name><order>100</order><priority>100</priority><rest_method/><rest_method_text/><rest_service/><rest_service_text/><rest_variables/><role_conditions/><script><![CDATA[(function executeRule(current, previous) {
if (current.type == 2)
g_scratchpad.formula = current.formula.toString();
else {
g_scratchpad.cube_conditions = current.cube.conditions.toString();
g_scratchpad.cube_facts_table = current.cube.facts_table.toString();
}
})(current, previous);]]></script><sys_class_name>sys_script</sys_class_name><sys_created_by>admin_SHARE</sys_created_by><sys_created_on>2016-10-12 22:39:59</sys_created_on><sys_customer_update>true</sys_customer_update><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>6dea047f4f1e220074570ab18110c770</sys_id><sys_mod_count>6</sys_mod_count><sys_name>Add data to ScratchPad</sys_name><sys_overrides/><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_replace_on_upgrade>false</sys_replace_on_upgrade><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_script_6dea047f4f1e220074570ab18110c770</sys_update_name><sys_updated_by>Arnoud.Kooi_SHARE</sys_updated_by><sys_updated_on>2016-11-18 20:36:43</sys_updated_on><template/><when>before_display</when></sys_script><sys_translated_text action="delete_multiple" query="documentkey=6dea047f4f1e220074570ab18110c770"/></record_update></payload>
<payload_hash/>
<remote_update_set display_value="PA - UI Action Utils">c1d3072b4f631300364a4ebf9310c7ae</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>4dd3072b4f631300364a4ebf9310c7af</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>164f9eb68080000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<table>pa_indicators</table>
<target_name>Add data to ScratchPad</target_name>
<type>Business Rule</type>
<update_domain>global</update_domain>
<update_guid/>
<update_guid_history/>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_ui_page_8ff17db24f240b009881c5c18110c774</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update table="sys_ui_page"><sys_ui_page action="INSERT_OR_UPDATE"><category>general</category><client_script><![CDATA[var data = {};
var indicator = "${sysparm_indicator}";
function addMapping(ind, bd, order) {
jQuery.get("/pa_ind_bds_json.do?action=addmapping&indicator=" + ind
+ "&breakdown=" + bd + "&order=" + order, function (resp) {
if (('' + resp).length == 32)
jQuery('#td-' + ind + '-' + bd).
html('<span class="green icon icon-success-circle"></span>');
else if (resp == 'invalid')
jQuery('#td-' + ind + '-' + bd).
html('<span title="Invalid mapping(wrong factstable?). Consider removing!" class="orange icon icon-warning-circle"></span>');
updateHyperlink();
GlideList2
.get('pa_indicators.pa_indicator_breakdowns.indicator')
.setFilterAndRefresh('');
});
}
function updateHyperlink() {
var $hl = jQuery('.blue');
if ($hl.length > 0) {
jQuery('#addall').html('<a href="javascript:addAll()">Add all missing mappings</a>');
}
else
jQuery('#addall').html('');
jQuery('#tbl > tbody > tr').each(function() {
if (jQuery(this).find('a.grey').length > 0)
jQuery(this).find('.green').addClass('orange').attr('title', 'Mapping available, but breakdown cannot be mapped to some other indicators. Consider removing!');
});
}
function addAll() {
jQuery('a.blue').each(function (el) {
$(this).click();
});
}
//not using a library > vanilla...
function cellTemplate(dataid, content, cssclass) {
cssclass = cssclass || '';
return "<td id='td-" + dataid + "' class='" + cssclass + "'>" + content + "</td>";
}
function hcellTemplate(dataid, content, cssclass) {
cssclass = cssclass || '';
return "<th id='th-" + dataid + "' class='" + cssclass + "'>" + content + "</th>";
}
function rowTemplate(dataid, content, cssclass) {
cssclass = cssclass || '';
return "<tr id='tr-" + dataid + "' class='" + cssclass + "'>" + content + "</tr>";
}
function createTable() {
//Create header row and cells
var row = hcellTemplate('breakdowns', 'Breakdowns', 'columnone');
for (var ind of data.indicators.ordered) {
var star = '';
if (data.indicators[ind].parent)
star = '<span title="Originating indicator" style="color:#FFD700" class="icon icon-star"></span> ';
row += hcellTemplate(ind, star + '<a href="/pa_indicators.do?sys_id=' + ind +
'" target="ind">' + data.indicators[ind].name + '</a><br /><span class="smaller">'
+ data.indicators[ind].type + ' <i>' + data.indicators[ind].facts_table + '</i></span>');
}
jQuery('#tbl thead').append(rowTemplate('header', row));
//create breakdown rows and cells
var tbl = '';
for (var i = 0; i < data.breakdowns.ordered.length; i++) {
var facts_tables = data.breakdowns[data.breakdowns.ordered[i]].facts_tables;
row = cellTemplate(data.breakdowns.ordered[i], '<a href="/pa_breakdowns.do?sys_id='
+ data.breakdowns.ordered[i] + '" target="bd">'
+ data.breakdowns[data.breakdowns.ordered[i]].name + '</a><br /><span title="Mappings: '+ facts_tables.toString() +'" class="smaller">'
+ data.breakdowns[data.breakdowns.ordered[i]].breakdown_source + '</span>');
for (ind of data.indicators.ordered) {
var clss = 'blue';
var ttle = 'Click to create mapping';
if (data.indicators[ind].type == 'Automated' && canBeMapped(data.indicators[ind].facts_tables, facts_tables)) {
clss = 'grey';
ttle = 'Mapping not possible Breakdown can only be mapped to table(s): ' + facts_tables.toString();
}
var hrf = '#';
if (clss == 'blue')
hrf = 'javascript:addMapping(\'' + ind + '\',\'' + data.breakdowns.ordered[i] + '\',' + ((i + 1) * 100) + ')';
row += cellTemplate(ind + '-' + data.breakdowns.ordered[i],
'<a class="' + clss + '" title="' + ttle + '" href="' + hrf + '"><span class="' + clss + ' icon icon-add-circle"></span></a>',
'tdcontent');
}
tbl += rowTemplate('row-' + data.breakdowns.ordered[i], row);
}
jQuery('#tbl tbody').append(tbl);
}
function canBeMapped(fact_tables_ind, fact_tables_bd){
var valid = true;
for (var i = 0; i < fact_tables_ind.length; i++){
if (fact_tables_bd.indexOf(fact_tables_ind[i]) > -1)
valid = false;
}
return valid;
}
function checkMappings() {
for (var ind of data.indicators.ordered) {
var ind_bds = data.indicators[ind].ind_bds;
for (var ind_bd in ind_bds) {
jQuery('#td-' + ind + '-' + ind_bds[ind_bd].breakdown).
html('<span title="Mapping is available" class="green icon icon-success-circle"></span>');
}
}
}
jQuery(function () {
jQuery.getJSON("/pa_ind_bds_json.do?action=getjson&indicator=" + indicator,
function (resp) {
data = resp;
createTable();
checkMappings();
updateHyperlink();
});
});]]></client_script><description/><direct>false</direct><endpoint/><html><![CDATA[<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<style>
.tdcontent {text-align:center;}
.blue {font-size:18px; color:#278efc;}
.green {font-size:18px; color:#04d304;}
.grey {font-size:18px; color:#CCCCCC;}
.orange {font-size:18px; color:#ff9523 !important;}
.smaller {font-size:9pt; color:#CCC;}
</style>
<div id="addall"></div>
<table class="table table-striped table-bordered" id="tbl">
<thead></thead>
<tbody></tbody>
</table>
</j:jelly>]]></html><name>ind_bds</name><processing_script/><sys_class_name>sys_ui_page</sys_class_name><sys_created_by>Arnoud.Kooi</sys_created_by><sys_created_on>2017-08-16 20:12:46</sys_created_on><sys_customer_update>false</sys_customer_update><sys_id>8ff17db24f240b009881c5c18110c774</sys_id><sys_mod_count>67</sys_mod_count><sys_name>ind_bds</sys_name><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_replace_on_upgrade>false</sys_replace_on_upgrade><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_ui_page_8ff17db24f240b009881c5c18110c774</sys_update_name><sys_updated_by>Arnoud.Kooi</sys_updated_by><sys_updated_on>2017-08-21 12:21:26</sys_updated_on></sys_ui_page></record_update></payload>
<payload_hash>1674249341</payload_hash>
<remote_update_set display_value="PA - UI Action Utils">c1d3072b4f631300364a4ebf9310c7ae</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>4dd3072b4f631300364a4ebf9310c7b2</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>164f9eb688f0000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<table/>
<target_name>ind_bds</target_name>
<type>UI Page</type>
<update_domain>global</update_domain>
<update_guid>f67739987cbc8b000b7069035b3f1567</update_guid>
<update_guid_history>f67739987cbc8b000b7069035b3f1567:1674249341,1e04315878bc8b00fcddff490c0e058b:-30536523,7c93b15802bc8b00b6e370142159e819:1156223844,fea6799fbca04b008b51c989dd4c258c:-314120370,4776399f1ba04b002d9268ccf48ac223:-176338884,12b1b59bfda04b0053e59900db923891:442488277,f47179d79ea04b00da9d064891e4fb4f:1406173920,b2ee6d971ba04b00d56e4adb605863b3:-340970877,657ee51bbba04b00d89e05c79b249c41:511710029,231de51b19a04b005b4d456042812c3c:1230119675,7750590362e80b00faab9835eb25e233:-1482020164,e735818b6fa80b0003c7ba36dbfa5457:1041448588,ebb4014be7a80b00992c9c857e84626a:1397602900,29bc3c47c8a80b00c422adf212ec8a8a:1225439358,5fdab447efa80b007053a51a62ffcdef:-2036090167,464ab447dea80b00b5e29acad56fe3e8:-1867047883,944a3007e2a80b000c69396d025ba0a4:-1631219686,7e97b48310a80b00a8201bb3cea78566:406761175,d316b48302a80b000ed85a364c81f262:-1111332980,2665b00332a80b00e2e7f85ed7a3af39:66437972,bc25f003a6a80b00e9eb90ca18af7dba:640869539,e583b043a5a80b0059fd0fa76b17ac6d:1119815723,2f533c4368a80b00c047a92e793749a3:1433274044,d2d2b04316a80b00f29deeeacd83f37d:1494255953,e0a2b0438fa80b0075f52b0fe2bd917a:-1947307806,9552b043dca80b00f9131566d58e9b76:-1080319850,54aca08f9b680b000d6e1a3a037541c7:-1134386399,7957a4cb01680b00ef09f4860987329c:188110718,e4276ccbe1680b00440cdea8ffb43ecf:1713679949,41966ccbe3680b0076d9a59aab819fcb:788079834,f2f5200f38680b0066eb60d391703abf:370911529,9cc5a00f62680b00b5d4b28137094562:1451761886,7115e84b70680b001e54fe5266228191:675272478,1b54e2b23ea40b000b2bf604a4146c0c:-170829970,cfa322b2f5a40b0047d2b08bc66c1181:980898326,4963ea7224a40b009e20b4a280fdb1b5:-1839111231,1bc12e3208a40b00c63d5894fa4e6f10:1022801543,55945236c0640b00112b8a8a634ae123:-963015304,09345ef2d9640b00c259b8bd8d6576b4:-1172910978,fbc29eb291640b0035e51d7251366dd5:-1432630733,00cd0e3ebf240b00759d1b11595b7165:418749065,a29c42fecc240b004fd0292ad7f822f7:-1259171338,18290e3e35240b008a3077463f628e94:-1941936223,f747ca3ea0240b00e1998c9533331219:-1210233118,9a278a3e52240b00490c3e71b0178af1:771400002,9de68afae5240b0045cf57255f795f8c:-85317093,9d440abaef240b00d6a040572114a33f:-395671587,df134ebad7240b008184965052786c67:-730006521,0ba20ababa240b004f35796d315a6038:690199715,fd528e7aa8240b00cde467855402cacf:79693901,b6f102ba5a240b006977d7b127dae22f:1344351933,8c418e7a3e240b006b9dd22995d7c0d8:1823066206,74110e7acb240b00918e5eb114d44dd1:-745348724,ded0c67a68240b0092ce8accc9934ada:-457008424,cbb0827a27240b00a2097075952d5948:420240940,1430827ad6240b00c4bc0f3e33ef8845:1841919985,96bf317afd240b0046c49dadd023b25e:1009970199,4cfebdf65e240b007ba92b0ed4cafd33:-124232302,766dbdf6bd240b00f90fc604dedc1504:-881566652,4f1d7db676240b00b2d804b0bf796a8d:1556810384,990bf9b604240b001d80aa0bb6a8ca06:-1401707848,81da7db66a240b00af9152b16c899a47:2104869653,1a7ab9b646240b00c7068fbf887910d8:109037038,55367136aa240b0056418625290a9697:1613986034,36f571368a240b00ebec04c309f60393:1387279587,8265713667240b00237f8ba8c4dfa18f:-990824753,ced3b9f24c240b000b056267c8bc9350:805602982,ea637db2d0240b007338a7c80a968679:-636135308</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_ui_action_325d51184f3f36009881c5c18110c795</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update sys_domain="global" table="sys_ui_action"><sys_ui_action action="INSERT_OR_UPDATE"><action_name>CollectData</action_name><active>true</active><client>true</client><comments>Create and run an ad-hoc data collection job, to test your indicator</comments><condition>!(current.isNewRecord() &amp;&amp; !current.canCreate()) &amp;&amp; current.canWrite() &amp;&amp; current.type == 1</condition><form_action>true</form_action><form_button>true</form_button><form_context_menu>true</form_context_menu><form_link>false</form_link><form_style/><hint>Create and run an ad-hoc data collection job, to test your indicator</hint><list_action>false</list_action><list_banner_button>false</list_banner_button><list_button>false</list_button><list_choice>false</list_choice><list_context_menu>false</list_context_menu><list_link>false</list_link><list_save_with_form_button>false</list_save_with_form_button><list_style/><name>Collect Test Data</name><onclick>startCollectData()</onclick><order>50</order><script><![CDATA[function startCollectData() {
var opts = prompt("Collection for period\nDaysBackStart,[DaysBackEnd],[interval (d,w,m)]","30");
if (opts === null) return; //cancel
var ga = new GlideAjax('PATestDataCollect');
ga.addParam('sysparm_name', 'startCollect');
ga.addParam('sysparm_options', opts);
ga.addParam('sysparm_indicator', g_form.getUniqueValue());
ga.getXML(CollectResponse);
function CollectResponse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.addInfoMessage(answer);
}
}
]]></script><show_insert>false</show_insert><show_multiple_update>false</show_multiple_update><show_query>false</show_query><show_update>true</show_update><sys_class_name>sys_ui_action</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>2017-07-02 17:24:30</sys_created_on><sys_customer_update>false</sys_customer_update><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>325d51184f3f36009881c5c18110c795</sys_id><sys_mod_count>15</sys_mod_count><sys_name>Collect Test Data</sys_name><sys_overrides/><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_replace_on_upgrade>false</sys_replace_on_upgrade><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_ui_action_325d51184f3f36009881c5c18110c795</sys_update_name><sys_updated_by>admin</sys_updated_by><sys_updated_on>2017-07-13 13:09:43</sys_updated_on><table>pa_indicators</table><ui11_compatible>false</ui11_compatible><ui16_compatible>false</ui16_compatible></sys_ui_action></record_update></payload>
<payload_hash>-1091380057</payload_hash>
<remote_update_set display_value="PA - UI Action Utils">c1d3072b4f631300364a4ebf9310c7ae</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2018-08-02 09:19:04</sys_created_on>
<sys_id>81d3072b4f631300364a4ebf9310c7b1</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>164f9eb682e0000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2018-08-02 09:19:04</sys_updated_on>
<table>pa_indicators</table>
<target_name>Collect Test Data</target_name>
<type>UI Action</type>
<update_domain>global</update_domain>
<update_guid>6fd39b1173ac4700fe883fc67d79c247</update_guid>
<update_guid_history>6fd39b1173ac4700fe883fc67d79c247:-1091380057,f98c4d7f9b77ba003954a6b9c79eef12:-1091380057,bc8c4d7f0d77ba00da85de4138183d93:-1577725263,2901ead8e1bf3600fe2ba146815e3774:-1091380057,907e929819bf360092c6ee0a04c59bb8:2048121351,e63eda583cbf3600458878504f25cddd:-406875108,2b789e947bbf36007aaee3c577aa566f:427745022,a146d254a0bf36002dd7ec90836fd928:-1665762301,821652549abf36007e0d61c8e43f6f5d:-875484945,49b98e9cf27f3600ead594c6e86f797e:-322098205,8db23dd0ac7f3600b9e8dc875197fe1c:-1746678654,c94271d06c7f3600e0fa37d46e030a3c:-17979084,73c1291c563f3600c37bb57b965bc318:826227216,c6a1251c0d3f36004c9ea9e645ac4e61:688844299,f941611ce83f3600f8eed2019952a0d7:904885425,5abd1198ac3f3600b87ecb2d5f0543f2:170691690,4b5d5118f83f360004244fdcd6314796:-1448950623</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_ui_action_06b13b504f604b4035e0fdb28110c78b</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update sys_domain="global" table="sys_ui_action"><sys_ui_action action="INSERT_OR_UPDATE"><action_name>tryit</action_name><active>true</active><client>true</client><comments/><condition>gs.hasRole("admin") || gs.hasRole("pa_admin") </condition><form_action>true</form_action><form_button>false</form_button><form_context_menu>true</form_context_menu><form_link>false</form_link><form_style/><hint/><list_action>false</list_action><list_banner_button>false</list_banner_button><list_button>false</list_button><list_choice>false</list_choice><list_context_menu>false</list_context_menu><list_link>false</list_link><list_save_with_form_button>false</list_save_with_form_button><list_style/><name>PA Breakdown Helper</name><onclick>pa_analyse(false,false)</onclick><order>10</order><script><![CDATA[function pa_analyse(message, isError){
g_form.clearMessages();
jQuery('.injected').remove();
g_form.addInfoMessage('Mouseover <span class="icon icon-workflow"></span> ' +
'icons, to see breakdown advice. Caution: Advanced use-cases like scripting, bucket groups and dot walking not covered');
if (message){
if (isError) g_form.addErrorMessage(message);
else g_form.addInfoMessage(message);
}
window.pahelped = true;
jQuery.getJSON( "/pahelper.do?action=gettabledata&table=" + g_form.getTableName(), function( data ) {
doChecks(data);