Fix target resourceId

Fix target resource id impacted by the code change done for Guard ui bug
fix

Issue-ID: CLAMP-227
Change-Id: I73751074b7414892ed4de30f894f09be3b72eb17
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html
index 7f63a40..5a46003 100644
--- a/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html
+++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html
@@ -361,8 +361,12 @@
 	</div>
 
 	<script>
+		function getAllFormId() {
+			return Array.from(document.getElementsByClassName("formId"));
+		}
+
 		function searchActiveFormId() {
-			var formArray = Array.from(document.getElementsByClassName("formId"));
+			var formArray = getAllFormId();
 			for (var i=0, max=formArray.length; i < max; i++) {
 				
 				console.log("Search active FormId, current element "+formArray[i].id);
@@ -373,13 +377,13 @@
 			}
 			console.log("No active formId found !");
 		}
-		
+
 		function initTargetResourceId() {
-			var formItemActive = searchActiveFormId();
 			// Set all the Resource Invariant UUID in the target resource ID list (+Empty and other) 
-			Object.keys(vf_Services["shared"]["byVf"]).forEach(function(key){
-				$("#"+formItemActive.id+" #targetResourceId").append($('<option></option>').val(key).html(key));
+			Object.keys(vf_Services["shared"]["byVf"]).forEach(function(key) {
+					$("#targetResourceId").append($('<option></option>').val(key).html(key));
 			});
+			
 		}
 		
 		function changeTargetResourceIdOther() {
@@ -914,7 +918,7 @@
 		initTargetResourceId();
 		
 		//load metrics dropdown
-		if (elementMap["global"]){
+		if (elementMap["global"]) {
 			for (var i = 0; i < (elementMap["global"].length); i++){
 				if ((elementMap["global"][i]["name"]) == "actionSet"){
 					var asSel = elementMap["global"][i]["value"];