Email button using ui macro

Community Alums
Not applicable

Hi all,

I was having a ui macro button when clicking on the button it will open with the email template filled with short description and to field

But after the instance upgrade the issue i have noticed is the email template is filled with short description but the to field value is not populating. can anyone help me how to fix the issue

 

The below is the ui macro script:

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:sc_button id="email" title="email" label="email" onclick=" return openEmail()" />
    <script language="javascript">
        function openEmail(){
        var d=g_form.getUniqueValue();
        var b=g_form.getTableName();
        popupOpenEmailClient("email_client.do?sysparm_table=" +b +"&amp;amp;sysparm_sys_id=" + a +"&amp;amp;sysparm_uniqueValue=" + a+"&amp;amp;U_table.u_choice_field=u_choice_value");
        }
            </script>
</j:jelly>
4 REPLIES 4

Sai_Charan_K
Kilo Sage

Hi @Community Alums,

 

Can you please try the below code and let me know if it helped you or not?

<?xml version="1.0" encoding="utf-8"?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide">
    <g:sc_button id="email" title="email" label="email" onclick="return openEmail()" />
    <script language="javascript">
        function openEmail(){
            var uniqueValue = g_form.getUniqueValue();
            var tableName = g_form.getTableName();
            popupOpenEmailClient("email_client.do?sysparm_table=" + tableName + "&sysparm_sys_id=" + uniqueValue + "&sysparm_uniqueValue=" + uniqueValue + "&U_table.u_choice_field=u_choice_value");
        }
    </script>
</j:jelly>

Please mark this correct if it helped you in any way.

Thanks and Regards,

K. Sai Charan

Community Alums
Not applicable

It was displaying the error in the popupemailclient i.e.,  sysparm_sys_id must end with a ";" delimiter

Hi @Community Alums,

Please update the below line :

popupOpenEmailClient("email_client.do?sysparm_table=" + tableName + "&sysparm_sys_id=" + uniqueValue + "&sysparm_uniqueValue=" + uniqueValue + "&U_table.u_choice_field=u_choice_value");

to 

popupOpenEmailClient("email_client.do?sysparm_table=" + tableName + "&sysparm_sys_id=" + uniqueValue + ";" + &sysparm_uniqueValue=" + uniqueValue + "&U_table.u_choice_field=u_choice_value");


Please mark this correct if it helped you in any way.


Thanks and Regards,

K. Sai Charan



Community Alums
Not applicable

Hi @Sai_Charan_K 

It was showing me the same error