-
Notifications
You must be signed in to change notification settings - Fork 0
/
cls_Data_Entry_Validation.qfl
2493 lines (2439 loc) · 209 KB
/
cls_Data_Entry_Validation.qfl
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
Public Data
Set Data = DataInstance
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
Class clsData
'------------------------------------------------------------------------------------------------------------------
Private Sub Class_Initialize
End Sub
'------------------------------------------------------------------------------------------------------------------
Public Function GetDataForSection(iTestID, strTable, strProcess)
Dim objRS
Dim thisArr()
Dim iColumns, iCount
Dim strData
iCount = 0
strTable = Replace(strTable, " ", "_")
Set objRS = DB.ReturnRecordSet("select * from " & strTable & " where Test_ID = " & iTestID & " and Process_Type = '" & strProcess & "' and Entity_Type ='" & strEntityType & "'")
iColumns = objRS.Fields.Count
' Build the array
Do While Not objRS.EOF
ReDim Preserve thisArr(iCount)
For n = 4 To iColumns - 1
strData = strData & "|" & objRS.Fields(n).Name & ","& objRS.Fields(n).Value
Next
strData = Mid(strData, 2)
thisArr(iCount) = strData
strData = ""
iCount = iCount + 1
objRS.MoveNext
Loop
GetDataForSection = thisArr
Set objRS = Nothing
End Function
'------------------------------------------------------------------------------------------------------------------
Public Function GetDataForValidation(iTestID, strTable, strProcess, strCurrOrig)
Dim a, b, c, d, e, f, g
Dim thisArr, typeArr
' See if we're getting current or original
Select Case strCurrOrig
Case "Current"
' Get the record set depending on process type
strTable = Replace(strTable, " ", "_")
Select Case strProcess
Case "Create", "Prep For Create"
typeArr = Array("Create")
Case "Prep For Deactivate"
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend")
Else
typeArr = Array("Create", "Input For Create")
End If
Case "Prep For Reactivate"
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend", "Input For Deactivate", "Reactivate")
Else
typeArr = Array("Create", "Input For Create", "Input For Deactivate", "Reactivate")
End If
Case "Input For Create"
strStatus = DB.ReturnValue("select Status from Validation where Test_ID = " & iTestID & " and Entity_Type = '" & strEntityType & "'")
If strStatus = "Pending-RequestorInput" Or strStatus = "Open-ReturnedEMPreparation" Then
typeArr = Array("Create")
Else
typeArr = Array("Create", "Input For Create")
End If
Case "Input For Amend"
strStatus = DB.ReturnValue("select Status from Validation where Test_ID = " & iTestID & " and Entity_Type = '" & strEntityType & "'")
If strStatus = "Pending-RequestorInput" Then
typeArr = Array("Create", "Input For Create", "Amend")
Else
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend")
End If
Case "Approve For Amend"
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend")
Case "Deactivate"
typeArr = Array("Create", "Input For Create")
Case "Input For Deactivate"
strStatus = DB.ReturnValue("select Status from Validation where Test_ID = " & iTestID & " and Entity_Type = '" & strEntityType & "'")
If strStatus = "Pending-RequestorInput" Then
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend")
Else
typeArr = Array("Create", "Input For Create")
End If
Else
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend", "Input For Deactivate")
Else
typeArr = Array("Create", "Input For Create", "Input For Deactivate")
End If
End If
Case "Approve For Deactivate"
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend", "Input For Deactivate")
Else
typeArr = Array("Create", "Input For Create", "Input For Deactivate")
End If
Case "Input For Reactivate"
strStatus = DB.ReturnValue("select Status from Validation where Test_ID = " & iTestID & " and Entity_Type = '" & strEntityType & "'")
If strStatus = "Pending-RequestorInput" Then
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend", "Input For Deactivate", "Reactivate")
Else
typeArr = Array("Create", "Input For Create", "Input For Deactivate", "Reactivate")
End If
Else
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend", "Input For Deactivate", "Reactivate", "Input For Reactivate")
Else
typeArr = Array("Create", "Input For Create", "Input For Deactivate", "Reactivate", "Input For Reactivate")
End If
End If
Case "Approve For Reactivate"
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend", "Input For Deactivate", "Reactivate", "Input For Reactivate")
Else
typeArr = Array("Create", "Input For Create", "Input For Deactivate", "Reactivate", "Input For Reactivate")
End If
Case "Approve For Create"
typeArr = Array("Create", "Input For Create")
Case "Amend", "Prep For Amend"
typeArr = Array("Create", "Input For Create", "Amend")
Case "Reactivate"
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend", "Input For Deactivate", "Reactivate")
Else
typeArr = Array("Create", "Input For Create", "Input For Deactivate", "Reactivate")
End If
End Select
Case "Original"
Select Case strProcess
Case "Prep For Deactivate"
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend", "Deactivate")
Else
typeArr = Array("Create", "Input For Create", "Deactivate")
End If
Case "Prep For Reactivate"
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend", "Input For Deactivate", "Reactivate")
Else
typeArr = Array("Create", "Input For Create", "Input For Deactivate", "Reactivate")
End If
Case "Input For Amend"
typeArr = Array("Create", "Input For Create", "Amend")
Case "Approve For Amend", "Deactivate"
typeArr = Array("Create", "Input For Create")
Case "Input For Deactivate"
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend", "Deactivate")
Else
typeArr = Array("Create", "Input For Create", "Deactivate")
End If
Case "Approve For Deactivate"
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend", "Deactivate", "Input For Deactivate")
Else
typeArr = Array("Create", "Input For Create", "Deactivate", "Input For Deactivate")
End If
Case "Input For Reactivate", "Approve For Reactivate"
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend", "Input For Deactivate", "Reactivate")
Else
typeArr = Array("Create", "Input For Create", "Input For Deactivate", "Reactivate")
End If
Case "Prep For Amend"
typeArr = Array("Create", "Input For Create")
Case "Reactivate"
If blnAmend = True Then
typeArr = Array("Create", "Input For Create", "Amend", "Input For Amend", "Input For Deactivate")
Else
typeArr = Array("Create", "Input For Create", "Input For Deactivate")
End If
End Select
End Select
Select Case UBound(typeArr)
Case 6
a = GetDataForSection(iTestID, strTable, typeArr(0))
b = GetDataForSection(iTestID, strTable, typeArr(1))
c = GetDataForSection(iTestID, strTable, typeArr(2))
d = GetDataForSection(iTestID, strTable, typeArr(3))
e = GetDataForSection(iTestID, strTable, typeArr(4))
f = GetDataForSection(iTestID, strTable, typeArr(5))
g = GetDataForSection(iTestID, strTable, typeArr(6))
thisArr = MergeArrays(a, b)
thisArr = MergeArrays(thisArr, c)
thisArr = MergeArrays(thisArr, d)
thisArr = MergeArrays(thisArr, e)
thisArr = MergeArrays(thisArr, f)
thisArr = MergeArrays(thisArr, g)
Case 5
a = GetDataForSection(iTestID, strTable, typeArr(0))
b = GetDataForSection(iTestID, strTable, typeArr(1))
c = GetDataForSection(iTestID, strTable, typeArr(2))
d = GetDataForSection(iTestID, strTable, typeArr(3))
e = GetDataForSection(iTestID, strTable, typeArr(4))
f = GetDataForSection(iTestID, strTable, typeArr(5))
thisArr = MergeArrays(a, b)
thisArr = MergeArrays(thisArr, c)
thisArr = MergeArrays(thisArr, d)
thisArr = MergeArrays(thisArr, e)
thisArr = MergeArrays(thisArr, f)
Case 4
a = GetDataForSection(iTestID, strTable, typeArr(0))
b = GetDataForSection(iTestID, strTable, typeArr(1))
c = GetDataForSection(iTestID, strTable, typeArr(2))
d = GetDataForSection(iTestID, strTable, typeArr(3))
e = GetDataForSection(iTestID, strTable, typeArr(4))
thisArr = MergeArrays(a, b)
thisArr = MergeArrays(thisArr, c)
thisArr = MergeArrays(thisArr, d)
thisArr = MergeArrays(thisArr, e)
Case 3
a = GetDataForSection(iTestID, strTable, typeArr(0))
b = GetDataForSection(iTestID, strTable, typeArr(1))
c = GetDataForSection(iTestID, strTable, typeArr(2))
d = GetDataForSection(iTestID, strTable, typeArr(3))
thisArr = MergeArrays(a, b)
thisArr = MergeArrays(thisArr, c)
thisArr = MergeArrays(thisArr, d)
Case 2
a = GetDataForSection(iTestID, strTable, typeArr(0))
b = GetDataForSection(iTestID, strTable, typeArr(1))
c = GetDataForSection(iTestID, strTable, typeArr(2))
thisArr = MergeArrays(a, b)
thisArr = MergeArrays(thisArr, c)
Case 1
a = GetDataForSection(iTestID, strTable, typeArr(0))
b = GetDataForSection(iTestID, strTable, typeArr(1))
thisArr = MergeArrays(a, b)
Case Else
thisArr = GetDataForSection(iTestID, strTable, typeArr(0))
End Select
GetDataForValidation = thisArr
End Function
'------------------------------------------------------------------------------------------------------------------
Public Sub EnterData(iTestID, strSection, strProcess)
Dim objRS
Dim thisData
' Set up correct table for main details
If strSection = "Main Details" Then
strSectionSearch = strEntityType & "_Details"
Else
strSectionSearch = strSection
End If
' Get the data
thisData = GetDataForSection(iTestID, strSectionSearch, strProcess)
strSection = Replace(strSection, "_", " ")
Select Case strSection
Case "Main Details"
MainDetails_Entry thisData
Case "Alternate Names"
AlternateNames_Entry thisData
Case "Addresses"
AddressDetails_Entry thisData
Case "Email Addresses"
EmailAddresses_Entry thisData
Case "Website Addresses"
WebsiteAddresses_Entry thisData
Case "Telephone Details"
TelephoneDetails_Entry thisData
Case "SICs"
SICs_Entry thisData
Case "Government IDs"
GovernmentIDs_Entry thisData
Case "Alternate IDs"
AlternateIDs_Entry thisData
Case "Due Dates"
DueDates_Entry thisData
Case "Notes"
Notes_Entry thisData
Case "Prep Details"
PrepDetails_Entry thisData
Case "Inputter Details"
InputterDetails_Entry thisData
Case "Approve Details"
ApproveDetails_Entry thisData
Case "Amend Details"
AmendDetails_Entry thisData
Case "Deactivate Details"
DeactivateDetails_Entry thisData
Case "Reactivate Details"
ReactivateDetails_Entry thisData
End Select
End Sub
'------------------------------------------------------------------------------------------------------------------
Public Sub SubmitEntity(iTestID, strProcess)
Dim strStatus, strEntityStatus, strApprovalStatus, strDataValidationStatus
' Switch depending on process
Select Case strProcess
Case "Create"
WebButton.Click "Finish"
GenericObject.HandlePopUp "OK"
strStatus = "Open-EMPreparation"
strEntityStatus = "Active"
strApprovalStatus = "Draft"
strDataVerificationStatus = ""
strRequestType = "Create"
Case "Amend"
WebButton.Click "Submit"
GenericObject.HandlePopUp "OK"
strStatus = "Open-EMPreparation"
strEntityStatus = "Active"
strApprovalStatus = "Draft"
strDataVerificationStatus = DB.ReturnValue("select Data_Verification_Status from Validation where Test_ID =" & iTestID & " and Entity_Type = '" & strEntityType & "'")
Case "Deactivate"
WebButton.Click "Submit"
GenericObject.HandlePopUp "OK"
strStatus = "Open-EMPreparation"
strEntityStatus = "Inactive"
strApprovalStatus = "Draft"
strDataVerificationStatus = DB.ReturnValue("select Data_Verification_Status from Validation where Test_ID =" & iTestID & " and Entity_Type = '" & strEntityType & "'")
Case "Reactivate"
WebButton.Click "Submit"
GenericObject.HandlePopUp "OK"
strStatus = "Open-EMPreparation"
strEntityStatus = "Active"
strApprovalStatus = "Draft"
strDataVerificationStatus = DB.ReturnValue("select Data_Verification_Status from Validation where Test_ID =" & iTestID & " and Entity_Type = '" & strEntityType & "'")
Case Else
WebButton.Click "Submit"
GenericObject.HandlePopUp "OK"
strStatus = DB.ReturnValue("select Status from Validation where Test_ID =" & iTestID & " and Entity_Type = '" & strEntityType & "'")
strEntityStatus = DB.ReturnValue("select Entity_Status from Validation where Test_ID = " & iTestID & " and Entity_Type = '" & strEntityType & "'")
strApprovalStatus = DB.ReturnValue("select Approval_Status from Validation where Test_ID = " & iTestID & " and Entity_Type = '" & strEntityType & "'")
strDataVerificationStatus = DB.ReturnValue("select Data_Verification_Status from Validation where Test_ID =" & iTestID & " and Entity_Type = '" & strEntityType & "'")
End Select
' Check for errors
If ErrorCheck() = True Then
ExitTest
Else
' Get the ERD and Grid Values and ouput to report and DB if on create
Select Case strProcess
Case "Create"
strERD = WebElement.GetROProperty("Thank you for submitting", "innertext")
arrRequest = Split(strERD, " ")
iVal = UBound(arrRequest)
strERD = arrRequest(iVal)
strERDLen = Len(strERD)
strERD = Mid(strERD, 1, strERDLen-1)
strGRID = WebElement.GetROProperty("The ERDS GRID for this", "innertext")
arrGrid = Split(strGRID, " ")
iVal = UBound(arrGrid) - 1
strGRID = arrGrid(iVal)
Reporter.ReportEvent micDone, "ERD Created", "The ERD Value for this case is [" & strERD & "]."
Reporter.ReportEvent micDone, "ERDS Grid Created", "The GRID Value for this case is [" & strGRID & "]."
DB.WriteToTable "Validation", iTestID, "Grid_ID," & strGRID & "|ERD_ID," & strERD, True
' Write Expected values to Validation table
DB.WriteToTable "Validation", iTestID, "Entity_Status,"& strEntityStatus & "|Approval_Status," & strApprovalStatus & "|Status," & strStatus & "|Data_Verification_Status," & strDataVerificationStatus & "|Request_Type,Create", True
Case "Amend"
strERD = WebElement.GetROProperty("Thank you for submitting", "innertext")
arrRequest = Split(strERD, " ")
iVal = UBound(arrRequest)
strERD = arrRequest(iVal)
strERDLen = Len(strERD)
strERD = Mid(strERD, 1, strERDLen-1)
Reporter.ReportEvent micDone, "Amended ERD Created", "The ERD Value for this amendment case is [" & strERD & "]."
DB.WriteToTable "Validation", iTestID, "ERD_ID," & strERD, True
' Write Expected values to Validation table
DB.WriteToTable "Validation", iTestID, "Entity_Status,"& strEntityStatus & "|Approval_Status," & strApprovalStatus & "|Status," & strStatus & "|Data_Verification_Status," & strDataVerificationStatus, True
Case "Deactivate"
strERD = WebElement.GetROProperty("Thank you for submitting", "innertext")
arrRequest = Split(strERD, " ")
iVal = UBound(arrRequest)
strERD = arrRequest(iVal)
strERDLen = Len(strERD)
strERD = Mid(strERD, 1, strERDLen-1)
Reporter.ReportEvent micDone, "Deactivated ERD Created", "The ERD Value for this deactivation case is [" & strERD & "]."
DB.WriteToTable "Validation", iTestID, "ERD_ID," & strERD, True
' Write Expected values to Validation table
DB.WriteToTable "Validation", iTestID, "Entity_Status,"& strEntityStatus & "|Approval_Status," & strApprovalStatus & "|Status," & strStatus & "|Data_Verification_Status," & strDataVerificationStatus & "|Deactivated,Yes", True
Case "Reactivate"
strERD = WebElement.GetROProperty("Thank you for submitting", "innertext")
arrRequest = Split(strERD, " ")
iVal = UBound(arrRequest)
strERD = arrRequest(iVal)
strERDLen = Len(strERD)
strERD = Mid(strERD, 1, strERDLen-1)
Reporter.ReportEvent micDone, "Reactivated ERD Created", "The ERD Value for this reactivation case is [" & strERD & "]."
DB.WriteToTable "Validation", iTestID, "ERD_ID," & strERD, True
' Write Expected values to Validation table
DB.WriteToTable "Validation", iTestID, "Entity_Status,"& strEntityStatus & "|Approval_Status," & strApprovalStatus & "|Status," & strStatus & "|Data_Verification_Status," & strDataVerificationStatus & "|Deactivated,No|Reactivated,Yes", True
End Select
End If
End Sub
'------------------------------------------------------------------------------------------------------------------
Public Sub VerifyEntity(iTestID)
Dim thisData, strThisProcess
' Check the top panel
Entity_Verify_Top strProcessType
' Now the Entity Details
thisData = GetDataForValidation(iTestID, strEntityType & " Details", strProcessType, "Current")
Entity_Verify thisData, "Main Details"
thisData = GetDataForValidation(iTestID, "Alternate Names", strProcessType, "Current")
Entity_Verify thisData, "Alternate Names"
thisData = GetDataForValidation(iTestID, "Addresses", strProcessType, "Current")
WebElement.Click "html tag:=LABEL|innerhtml:=Address details|outerhtml:=<LABEL inAnchor>Address details</LABEL>"
Entity_Verify thisData, "Addresses"
thisData = GetDataForValidation(iTestID, "Email Addresses", strProcessType, "Current")
WebElement.Click "html tag:=LABEL|innerhtml:=Electronic Address details|outerhtml:=<LABEL inAnchor>Electronic Address details</LABEL>"
Entity_Verify thisData, "Email Addresses"
thisData = GetDataForValidation(iTestID, "Website Addresses", strProcessType, "Current")
Entity_Verify thisData, "Website Addresses"
thisData = GetDataForValidation(iTestID, "Telephone Details", strProcessType, "Current")
WebElement.Click "html tag:=LABEL|innerhtml:=Telephone details|outerhtml:=<LABEL inAnchor>Telephone details</LABEL>"
Entity_Verify thisData, "Telephone Details"
If strEntityType <> "Individual" Then
thisData = GetDataForValidation(iTestID, "SICs", strProcessType, "Current")
WebElement.Click "html tag:=LABEL|innerhtml:=SIC details|outerhtml:=<LABEL inAnchor>SIC details</LABEL>"
Entity_Verify thisData, "SICS"
End If
thisData = GetDataForValidation(iTestID, "Government IDs", strProcessType, "Current")
WebElement.Click "html tag:=LABEL|innerhtml:=Government Identifiers|outerhtml:=<LABEL inAnchor>Government Identifiers</LABEL>"
Entity_Verify thisData, "Government IDs"
thisData = GetDataForValidation(iTestID, "Alternate IDs", strProcessType, "Current")
WebElement.Click "html tag:=LABEL|innerhtml:=Alternate Identifiers|outerhtml:=<LABEL inAnchor>Alternate Identifiers</LABEL>"
Entity_Verify thisData, "Alternate IDs"
If DB.ReturnValue("select Legal_Parent_Added from Validation where Test_ID = " & iTestID & " and Entity_Type = '" & strEntityType & "'") = "Yes" Then
thisData = GetDataForValidation(iTestID, "Duplicate_Search", strProcessType, "Current")
WebElement.Click "html tag:=LABEL|innerhtml:=Related Entities|outerhtml:=<LABEL inAnchor>Related Entities</LABEL>"
Entity_Verify thisData, "Related Entities"
End If
If strProcessType <> "Create" Then
If DB.ReturnValue("select Duplicate_Of_Added from Validation where Test_ID = " & iTestID & " and Entity_Type = '" & strEntityType & "'") = "Yes" Then
thisData = GetDataForValidation(iTestID, "Duplicate_Search", strProcessType, "Current")
WebElement.Click "html tag:=LABEL|innerhtml:=Related Entities|outerhtml:=<LABEL inAnchor>Related Entities</LABEL>"
Entity_Verify thisData, "Related Entities"
End If
If DB.ReturnValue("select Vendors_Added from Validation where Test_ID = " & iTestID & " and Entity_Type = '" & strEntityType & "'") = "Yes" Then
thisData = GetDataForValidation(iTestID, "Vendors", strProcessType, "Current")
WebElement.Click "html tag:=LABEL|innerhtml:=Vendor Links|outerhtml:=<LABEL inAnchor>Vendor Links</LABEL>"
Entity_Verify thisData, "Vendors"
End If
End If
' Now verify Notes
Utility.VerifyNotes
End Sub
'------------------------------------------------------------------------------------------------------------------
Private Sub MainDetails_Entry(thisArr)
For Each splitEle In thisArr
thisSplit = Split(splitEle, "|")
For Each nextEle In thisSplit
nextSplit = Split(nextEle, ",")
For x = 0 To UBound(nextSplit) -1
strField = Replace(nextSplit(0), "_", " ")
strData = nextSplit(1)
If strData <> "" Then
Select Case strField
Case "Legal Name", "Date of Incorporation", "Date Of Birth", "First Name", "Middle Name", "Last Name"
WebEdit.SetText strField, strData
Case "HSBC Affiliate", "Strategic Client"
WebRadioGroup.SelectItem strField, strData
Case "Legal Parent"
Utility.LegalParent strData
Case "Remove Legal Parent", "Validate Legal Parent", "Entity Type", "Process Type"
Case Else
If strProcessType = "Input For Create" Or strProcessType = "Input For Amend" Or strProcessType = "Input For Deactivate" Or strProcessType = "Input For Reactivate" Then
If strField = "Legal Entity" Or strField = "Requestor Location" Then
Exit for
End If
End If
WebList.WaitProperty strField, "disabled", 0, 15
WebList.SelectItem strField, strData
If strField = "Legal Entity" And strData = "Not Applicable" Then
If Not WebList.Exist("Requestor Location", 15) Then
Reporter.ReportEvent micFail, "Create Process Failure", "[ Not Applicable ] was selected from the [ Legal Entity ] list and the [ Requestor Location ] list was not displayed. Please check..."
End If
End If
If strField = "Requestor Location" Then
DB.WriteToTable "Validation", iTestID, "Requestor_Location," & strData, True
End If
End Select
If strField = "Legal Entity" Then
DB.WriteToTable "Validation", iTestID, "HSBC_Legal_Entity_Name," & strData, True
End If
If strField = "Legal Name" Then
DB.WriteToTable "Validation", iTestID, "Entity_Legal_Name," & strData, True
End If
If strField = "Country of Incorporation" Then
DB.WriteToTable "Validation", iTestID, "Country_of_Incorporation," & strData, True
End If
If strField = "First Name" Then
DB.WriteToTable "Validation", iTestID, "First_Name," & strData, True
End If
If strField = "Middle Name" Then
DB.WriteToTable "Validation", iTestID, "Middle_Name," & strData, True
End If
If strField = "Last Name" Then
DB.WriteToTable "Validation", iTestID, "Last_Name," & strData, True
End If
If strField = "Nationality" Then
DB.WriteToTable "Validation", iTestID, "Nationality," & strData, True
End If
End If
Next
Next
Next
End Sub
'------------------------------------------------------------------------------------------------------------------
Private Sub AlternateNames_Entry(thisArr)
Dim strWebList, strWebListProp, strWebEdit, strWebEditProp
Dim i
Dim objWebList, objWebEdit
i = 1
For Each splitEle In thisArr
thisSplit = Split(splitEle, "|")
For Each nextEle In thisSplit
nextSplit = Split(nextEle, ",")
For x = 0 To UBound(nextSplit) -1
strField = Replace(nextSplit(0), "_", " ")
strData = nextSplit(1)
If strData <> "" Then
Select Case strProcessType
Case "Create"
strWebEditProp = "\$PpyWorkPage\$p" & strEntityType & "\$pAlternateNames\$l1\$pName"
Select Case strField
Case "Entity Type", "Process Type"
Case "Count"
i = strData
If strData = 1 Then
strWebListProp = WebList.GetTOProperty("Name Type", "name")
Else
WebButton.Click "Icon Add - Alternate Names"
Wait 1
strWebList = Replace(strWebListProp, 1, strData)
End If
Case "Alt Name Type"
strField = Replace(strField, "Alt ", "")
If i = 1 Then
WebList.SelectItem strField, strData
Set objWebList = WebList.SetObject(strField)
Else
objWebList.SetTOProperty "name", strWebList
objWebList.Select strData
objWebList.SetTOProperty "name", strWebListProp
End If
Case "Alt Name"
strField = Replace(strField, "Alt ", "")
If Right(strData, 1) = "_" Then
strRandomName = UCase(RandomString(5, "Both"))
Else
strRandomName = ""
End If
If i = 1 Then
WebEdit.WaitProperty strField, "disabled", 0, 2
WebEdit.SetText strField, strData & strRandomName
Else
strWebEdit = Replace(strWebEditProp, 1, i)
Set myObj = WebEdit.SetObject(strField)
myObj.WaitProperty "disabled", 0, 2
myObj.SetTOProperty "name", strWebEdit
myObj.Set strData
myObj.SetTOProperty "name", strWebEditProp
End If
Case "Common Lookup Name"
If Right(strData, 1) = "_" Then
strRandomName = UCase(RandomString(5, "Both"))
Else
strRandomName = ""
End If
WebEdit.SetText strField, strData & strRandomName
End Select
Case "Input For Create", "Input For Amend", "Input For Deactivate", "Input For Reactivate", "Amend", "Reactivate"
strWebEditProp = "\$PpyWorkPage\$p" & strEntityType & "\$pAlternateNames\$l1\$pName"
Select Case strField
Case "Entity Type", "Process Type"
Case "Count"
i = strData
Set thisTable = WebTable.SetObject("innertext:=Alternate NamesName Type.*|column names:=Alternate Names;")
iRows = thisTable.RowCount
If strData = 1 Then
' See if it Exists
If thisTable.ChildItemCount(i+1, 1, "WebList") = 0 Then
If thisTable.ChildItemCount(i+1, 1, "WebElement") = 0 Then
WebButton.Click "Icon Add - Alternate Names"
Wait 1
Else
Set myObj = thisTable.ChildItem(i+1, 1, "WebEdit", 0)
myObj.Set ""
End If
End If
Else
If i+1 > iRows Then
i = i -1
End If
If thisTable.ChildItemCount(i+1, 1, "WebList") = 0 Then
If thisTable.ChildItemCount(i+1, 1, "WebElement") = 1 Then
WebButton.Click "Icon Add - Alternate Names"
Wait 1
Else
Set myObj = thisTable.ChildItem(i+1, 1, "WebEdit", 0)
myObj.Set ""
End If
End If
End If
Case "Alt Name Type"
strField = Replace(strField, "Alt ", "")
If strData = "Delete" Then
DeleteRow strField, i
Wait 1
Exit For
End If
Set thisTable = WebTable.SetObject("innertext:=Alternate NamesName Type.*|column names:=Alternate Names;")
For j = 1 To thisTable.RowCount
If thisTable.ChildItemCount(j, 1, "WebList") > 0 Then
Set myObj = thisTable.ChildItem(j, 1, "WebList", 0)
myObj.Select strData
Exit For
End If
Next
Case "Alt Name"
strField = Replace(strField, "Alt ", "")
If Right(strData, 1) = "_" Then
strRandomName = UCase(RandomString(5, "Both"))
Else
strRandomName = ""
End If
If i = 1 Then
WebEdit.WaitProperty strField, "disabled", 0 , 2
WebEdit.SetText strField, strData & strRandomName
strWebEditProp = WebEdit.GetTOProperty(strField, "name")
Else
strWebEdit = Replace(strWebEditProp, 1, i)
WebEdit.SetTOProperty strField, "name", strWebEdit
WebEdit.WaitProperty strField, "disabled", 0, 2
WebEdit.SetText strField, strData
End If
Case "Common Lookup Name"
If Right(strData, 1) = "_" Then
strRandomName = UCase(RandomString(5, "Both"))
Else
strRandomName = ""
End If
WebEdit.SetText strField, strData & strRandomName
End Select
End Select
End If
Next
Next
Next
End Sub
'------------------------------------------------------------------------------------------------------------------
Private Sub AddressDetails_Entry(thisArr)
Dim blnMain
For Each splitEle In thisArr
thisSplit = Split(splitEle, "|")
For Each nextEle In thisSplit
nextSplit = Split(nextEle, ",")
For x = 0 To UBound(nextSplit) -1
strField = Replace(nextSplit(0), "_", " ")
strData = nextSplit(1)
If strData <> "" Then
Select Case strProcessType
Case "Create"
Select Case strField
Case "Entity Type", "Process Type"
Case "Count"
If strData = 1 Then
blnMain = True
Else
blnMain = False
End If
Case "Address Type"
If blnMain = True Then
WebList.Init strField
WebList.SelectItem strField, strData
Else
WebButton.Init "Add Address"
WebButton.Click "Add Address"
WebList.WaitProperty "Contacts " & strField, "disabled", 0, 15
WebList.SelectItem "Contacts " & strField, strData
End If
Case "Country"
If blnMain = True Then
WebList.Init strField
WebList.WaitProperty strField, "disabled", 0, 15
WebList.SelectItem strField, strData
Else
WebList.WaitProperty "Contacts " & strField, "disabled", 0, 15
WebList.SelectItem "Contacts " & strField, strData
End If
Case "Address Line 1", "Address Line 2", "City", "State / Province", "Postal Code"
If blnMain = True Then
WebEdit.Init strField
WebEdit.WaitProperty strField, "disabled", 0, 15
WebEdit.SetText strField, strData
Else
WebEdit.SetText "Contacts " & strField, strData
End If
Case Else
If blnMain = True Then
WebCheckBox.WaitProperty strData, "disabled", 0, 15
WebCheckBox.Init strData
WebCheckBox.Tick strData, "ON"
Else
WebCheckBox.Tick "Contacts " & strData, "ON"
WebButton.Click "Contacts Save"
End If
End Select
Case "Input For Create", "Input For Amend", "Input For Deactivate", "Input For Reactivate", "Amend", "Reactivate"
Select Case strField
Case "Entity Type", "Process Type"
Case "Count"
i = strData
Case "Address Type"
If i = 1 Then
WebList.SelectItem strField, strData
Else
' See if we have an additional address already
If WebTable.Exist("Additional Addresses", 2) Then
strRow = Cstr(i-1)
If WebElement.Exist("innertext:=" & strRow & "|html tag:=TD|outerhtml:=<TD style=" & Chr(34) & "BACKGROUND-COLOR: .*; TEXT-ALIGN: center" & Chr(34) & " width=20>" & strRow & " </TD>", 2) Then
Set myObj = WebElement.SetObject("innertext:=" & strRow & "|html tag:=TD|outerhtml:=<TD style=" & Chr(34) & "BACKGROUND-COLOR: .*; TEXT-ALIGN: center" & Chr(34) & " width=20>" & strRow & " </TD>")
If strData = "Delete" Then
DeleteRow "Address Type", strRow
Else
myObj.Click
WebList.WaitProperty "Contacts " & strField, "disabled", 0, 15
WebList.SelectItem "Contacts " & strField, strData
End If
Else
WebButton.Click "Add Address"
WebList.WaitProperty "Contacts " & strField, "disabled", 0, 15
WebList.SelectItem "Contacts " & strField, strData
End If
Else
WebButton.Click "Add Address"
WebList.WaitProperty "Contacts " & strField, "disabled", 0, 15
WebList.SelectItem "Contacts " & strField, strData
End If
End If
Case "Country"
If i = 1 Then
WebList.WaitProperty strField, "disabled", 0, 15
WebList.SelectItem strField, strData
Else
WebList.WaitProperty "Contacts " & strField, "disabled", 0, 15
WebList.SelectItem "Contacts " & strField, strData
End If
Case "Address Line 1", "Address Line 2", "City", "State / Province", "Postal Code"
If i = 1 Then
WebEdit.SetText strField, strData
Else
WebEdit.SetText "Contacts " & strField, strData
End If
Case Else
If i = 1 Then
If strData = "Hold Mail" Then
If WebCheckBox.GetROProperty("Care Of", "disabled") = 0 Then
WebCheckBox.Tick "Care Of", "OFF"
End If
End If
If strData = "Care Of" Then
If WebCheckBox.GetROProperty("Hold Mail", "disabled") = 0 Then
WebCheckBox.Tick "Hold Mail", "OFF"
End If
End If
WebCheckBox.Tick strData, "ON"
Else
If strData = "Hold Mail" Then
WebCheckBox.Tick "Contacts " & strData, "ON"
WebCheckBox.Tick "Contacts Care Of", "OFF"
End If
If strData = "Care Of" Then
WebCheckBox.Tick "Contacts " & strData, "ON"
WebCheckBox.Tick "Contacts Hold Mail", "OFF"
End If
WebButton.Click "Contacts Save"
End If
End Select
End Select
End If
Next
Next
Next
End Sub
'------------------------------------------------------------------------------------------------------------------
Private Sub EmailAddresses_Entry(thisArr)
Dim strWebListProp, strWebList, strWebEditProp, strWebEdit
Dim i
i = 1
For Each splitEle In thisArr
thisSplit = Split(splitEle, "|")
For Each nextEle In thisSplit
nextSplit = Split(nextEle, ",")
For x = 0 To UBound(nextSplit) -1
strField = Replace(nextSplit(0), "_", " ")
strData = nextSplit(1)
If strData <> "" Then
Select Case strProcessType
Case "Create"
Select Case strField
Case "Entity Type", "Process Type"
Case "Count"
i = strData
If strData = 1 Then
strWebListProp = WebList.GetTOProperty("Email Address Type", "name")
Else
WebButton.Click "Icon Add - Email Address"
Wait 1
strWebList = Replace(strWebListProp, 1, strData)
End If
Case "Email Address Type"
If i = 1 Then
WebList.SelectItem strField, strData
Else
Set myObj = WebList.SetObject(strField)
myObj.SetTOProperty "name", strWebList
myObj.Select strData
myObj.SetTOProperty "name", strWebListProp
End If
Case "Email Address"
If i = 1 Then
WebEdit.SetText strField, strData
strWebEditProp = WebEdit.GetTOProperty(strField, "name")
Else
strWebEdit = Replace(strWebEditProp, 1, i)
Set myObj = WebEdit.SetObject(strField)
myObj.SetTOProperty "name", strWebEdit
myObj.Set strData
myObj.SetTOProperty "name", strWebEditProp
End If
End Select
Case "Input For Create", "Input For Amend", "Input For Deactivate", "Input For Reactivate", "Amend", "Reactivate"
Select Case strField
Case "Entity Type", "Process Type"
Case "Count"
i = strData
If strData = 1 Then
If WebList.Exist("Email Address Type", 2) Then
strWebListProp = WebList.GetTOProperty("Email Address Type", "name")
Else
WebButton.Click "Icon Add - Email Address"
Wait 1
strWebListProp = WebList.GetTOProperty("Email Address Type", "name")
End If
Else
Set thisTable = WebTable.SetObject("class:=repeatReadWrite|column names:=Email Address\(es\);")
iCount = thisTable.ChildItemCount(i+1, 1, "WebList")
If iCount > 0 Then
Set myObj = thisTable.ChildItem(i+1, 1, "WebList", 0)
If myObj.Exist Then
strWebList = Replace(strWebListProp, 1, strData)
Else
WebButton.Click "Icon Add - Email Address"
Wait 1
strWebList = Replace(strWebListProp, 1, strData)
End If
Else
If iRowDeleted = 0 Then
WebButton.Click "Icon Add - Email Address"
Wait 1
strWebList = Replace(strWebListProp, 1, strData)
End If
End If
End If
Case "Email Address Type"
If i = 1 Then
If strData = "Delete" Then
DeleteRow strField, i
iRowDeleted = i
Wait 1
Else
WebList.SelectItem strField, strData
End If
Else
If strData = "Delete" Then
DeleteRow strField, i
Wait 1
Else
If iRowDeleted > 0 Then
strWebList = Replace(strWebListProp, 1, iRowDeleted)
End If
Set myObj = WebList.SetObject(strField)
myObj.SetTOProperty "name", strWebList
myObj.Select strData
myObj.SetTOProperty "name", strWebListProp
If WebEdit.Exist("Email Address", 1) Then
strWebEditProp = WebEdit.GetTOProperty("Email Address", "name")
End If
End If
End If
Case "Email Address"
If i = 1 Then
WebEdit.SetText strField, strData
strWebEditProp = WebEdit.GetTOProperty(strField, "name")
Else
If iRowDeleted > 0 Then
strWebEdit = Replace(strWebEditProp, 1, iRowDeleted)
Else
strWebEdit = Replace(strWebEditProp, 1, i)
End If
Set myObj = WebEdit.SetObject(strField)
myObj.SetTOProperty "name", strWebEdit
myObj.Set strData
myObj.SetTOProperty "name", strWebEditProp
End If
End Select
End Select
End If
Next
Next
Next
Set myObj = Nothing
End Sub
'------------------------------------------------------------------------------------------------------------------
Private Sub WebsiteAddresses_Entry(thisArr)
Dim strWebListProp, strWebList, strWebEditProp, strWebEdit
Dim i
i = 1
For Each splitEle In thisArr
thisSplit = Split(splitEle, "|")
For Each nextEle In thisSplit
nextSplit = Split(nextEle, ",")
For x = 0 To UBound(nextSplit) -1
strField = Replace(nextSplit(0), "_", " ")
strData = nextSplit(1)
If strData <> "" Then
Select Case strProcessType
Case "Create"
Select Case strField
Case "Entity Type", "Process Type"
Case "Count"
i = strData
If strData = 1 Then
strWebListProp = WebList.GetTOProperty("Website Address Type", "name")
Else
WebButton.Click "Icon Add - Websites"
Wait 1
strWebList = Replace(strWebListProp, 1, strData)
End If
Case "Website Address Type"
If i = 1 Then
WebList.SelectItem strField, strData
Else
Set myObj = WebList.SetObject(strField)
myObj.SetTOProperty "name", strWebList
myObj.Select strData
myObj.SetTOProperty "name", strWebListProp
End If
Case "Website Address"
If i = 1 Then
WebEdit.SetText strField, strData
strWebEditProp = WebEdit.GetTOProperty(strField, "name")
Else
strWebEdit = Replace(strWebEditProp, 1, i)
Set myObj = WebEdit.SetObject(strField)
myObj.SetTOProperty "name", strWebEdit
myObj.Set strData
myObj.SetTOProperty "name", strWebEditProp
End If
End Select
Case "Input For Create", "Input For Amend", "Input For Deactivate", "Input For Reactivate", "Amend", "Reactivate"
Select Case strField
Case "Entity Type", "Process Type"
Case "Count"
i = strData
If strData = 1 Then
If WebList.Exist("Website Address Type", 2) Then
strWebListProp = WebList.GetTOProperty("Website Address Type", "name")
Else
WebButton.Click "Icon Add - Websites"
Wait 1
strWebListProp = WebList.GetTOProperty("Website Address Type", "name")
End If
Else
Set thisTable = WebTable.SetObject("class:=repeatReadWrite|column names:=Website Address\(es\);")
iCount = thisTable.ChildItemCount(i+1, 1, "WebList")
If iCount > 0 Then
Set myObj = thisTable.ChildItem(i+1, 1, "WebList", 0)
If myObj.Exist Then
strWebList = Replace(strWebListProp, 1, strData)
Else
WebButton.Click "Icon Add - Websites"
Wait 1
strWebList = Replace(strWebListProp, 1, strData)
End If
Else
If iRowDeleted = 0 Then
WebButton.Click "Icon Add - Websites"
Wait 1