It's possible but complex for htmpl format. Default, web engine convert htmpl files to html at run time. so by its own object(elements) you can't want to bring the CIs of affected end user dynamically.
You can applly following steps for this;
firstly you can define jquery.js in your htmpl file <script src="$CAisd/sitemods/scripts/jquery.js"></script>
1. create a new htmpl form and code typing on notebook++ or same text editör, not WSP (file name is form_getci.htmpl)
<!doctype html>
<PDM_PRAGMA RELEASE=110>
<html lang="us">
<head>
<meta charset="utf-8">
<title>jQuery UI Example Page</title>
<script src="$CAisd/sitemods/scripts/jquery.js"></script>
</head>
<script>
var data = new Array();
</script>
<body>
<script>
data = [
<PDM_LIST PREFIX=list FACTORY=nr WHERE="resource_contact.id=U'$args.KEEP.customer'">
{"ci_id":"$list.id", "ci_name":"$list.name", "persistent_id":"$list.persistent_id"},
</PDM_LIST>
{"ci_id":"$list.id", "ci_name":"$list.name", "persistent_id":"$list.persistent_id"}
];
parent.cidata = data;
parent.addCIDataRows();
</script>
</body>
</html>
<PDM_WSP>
2. Define iframe tag <iframe id="CI_Frame"> in your htmpl file but its display set is hidden.
3. Define a global array variable in your htmpl file
var cidata = new Array();
4. Define javascript function getCIByCustomer() which will call onchange event of customer field on your htmpl file
function getCIByCustomer(obj)
{
var queryStr = "$CAisd/pdmweb.exe?SID=$args.SID+FID=$args.FID+OP=DISPLAY_FORM+HTMPL=form_getnr.htmpl+KEEP.customer="+obj.value;
$$('#CI_Frame').attr('src', queryStr);
}
useage;
<PDM_MACRO name=dtlLookup hdr="Affected End User" attr="customer" evt="onChange=\\\"getCIByCustomer(this)\\\"">
5. Define a new function as addCIDataRows() for insert to customer's CIs to Affected Resource field affected resource field type definition must be "dtlDropdown"
function addCIDataRows()
{
$$('select[pdmqa="affected_resource"]').html('');
var html = '';
for (i=0;i<cidata.lenght-1;i++)
{
html += '<option value="'+cidata[i].ci_id+'">'+cidata[i].name+'</option>';
}
$$('select[pdmqa="affected_resource"]').html(html);
}
this codes is dynamicly get CI by customer field definition at run time
Best Regard,
Turker