Action assignment and ui page don't communicate in workspace

UltimaKatana
Tera Contributor

Hello, everyone,
my problem is that my action assignment and ui page seem not to communicate. I have also tested the include script and it all seems to be working correctly yet when the data needs to be processed by the ui page the process crashes...can you help me?
Thanks in advance!


Action assignment:

(function() {
    var selectedRecords = g_list.getChecked();
    if (!selectedRecords || selectedRecords.length == 0) {
        alert('Seleziona almeno un record.');
        return;
    }
    var ui_page_id = '6ca928328336821090a55929feaad3f0';
    g_modal.showFrame({
        url: '/ui_page.do?sys_id=' + ui_page_id + '&sysparm_sys_ids='+ selectedRecords,
        title: 'Confronta Dipendenti',
        width: 1000,
        height: 800
    });
})();

script include:

(function() {
    var selectedRecords = g_list.getChecked();
    if (!selectedRecords || selectedRecords.length == 0) {
        alert('Seleziona almeno un record.');
        return;
    }
    var ui_page_id = '6ca928328336821090a55929feaad3f0';
    g_modal.showFrame({
        url: '/ui_page.do?sys_id=' + ui_page_id + '&sysparm_sys_ids='+ selectedRecords,
        title: 'Confronta Dipendenti',
        width: 1000,
        height: 800
    });
})();

 

UI page:

<?xml version="1.0" encoding="UTF-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
  <j:choose>
    <j:when test="${!empty(sysparm_sys_ids)}">
      <j:script>
        var ga = new GlideAjax('HRProfileComparisonAjax');
        ga.addParam('sysparm_name', 'getProfilesByIds');
        ga.addParam('sysparm_ids', '${sysparm_sys_ids}');
        var response = ga.getXML(updateEmpl);
 function updateEmpl(response) {
     var answer = response.responseXML.documentElement.getAttribute("answer");
  alert(answer);
     var comparisonData = response;
      </j:script>
      <div>
        <h1>Confronto Dipendenti</h1>
        <j:forEach var="employee" items="${comparisonData}">
          <div style="background-color: green; padding: 10px; margin: 10px; color: white;">
            <p>Numero Dipendente: ${employee.number}</p>
            <p>Nome: ${employee.name}</p>
            <p>Email: ${employee.email}</p>
            <!-- Aggiungi altri campi qui -->
          </div>
        </j:forEach>
      </div>
    </j:when>
    <j:otherwise>
      <div>
        <h1>Nessun dato disponibile</h1>
      </div>
    </j:otherwise>
  </j:choose>
</j:jelly>

 

 

4 REPLIES 4

Lom
Tera Contributor

Hello UltimaKatana,

Your Action Assignment seems not to work. Maybe try to create an UI Action on your table like in this screenshot:

 

SS_UltimaKatana.png

 

 

UltimaKatana
Tera Contributor

Thanks Lom, but i must use the action assignment because i need to have the button in the "hr agent workspace", and the ui action appear only in the table, or in the workspace. I'm going crazy... XD XD

Lom
Tera Contributor

Lom
Tera Contributor