UI: page not found error

Ayushi Saxena
Tera Contributor

I have created ui page, ui action in "source-to-pay common architecture scope", but getting error page not found when I try to click ui action. Attach that error image.

 

HTML in UI page 

=================================

 

<j:jelly xmlns:j="jelly:core" xmlns:g="glide" xmlns:g2="jelly:com.glide.ui.tags">

<g:evaluate var="jvar_sys_id" expression="jvar_sys_id = request.getParameter('sys_id')" />

<g:ui_form>
  <h2>Compose Email</h2>
  <form method="post">
    <label>To:</label><br/>
    <input type="text" name="email" id="email" style="width:100%" value="${jvar_email}"/><br/><br/>

    <label>Subject:</label><br/>
    <input type="text" name="subject" id="subject" style="width:100%" value="${jvar_subject}" /><br/><br/>

    <label>Body:</label><br/>
    <textarea name="body" rows="8" id="body" style="width:100%" value="${jvar_body}"></textarea><br/><br/>

    <input type="submit" id="submit" value="Send Email" class="btn btn-primary" onclick="actionOK()"/>
    <button type="button" class="btn btn-default" onclick="cancel()">Cancel</button>
  </form>
</g:ui_form>
</j:jelly>
 
 
Client script
=================================
function actionOK() {
   
     GlideDialogWindow.get().destroy();
    return false;
}

function cancel() {
    GlideDialogWindow.get().destroy()
    return false;
}
 
 
Processing Script:
================================
var to = request.getParameter('email');
var subject = request.getParameter("subject");
var body = request.getParameter("body");
var mail = new GlideEmailOutbound();
mail.setSubject(subject);
mail.setBody(body);
mail.addRecipient(to);
mail.save();
GlideDialogWindow.get().destroy();
 
 
UI Action: client side 
================================
 
function composeEmail() {
    var dialog = new GlideDialogWindow('compose_email_dialog');
    dialog.setTitle('Compose Email');
    dialog.setPreference('sys_id', g_form.getUniqueValue());
    dialog.render();
}
1 ACCEPTED SOLUTION

KrishnaMohan
Giga Sage

Hi @Ayushi Saxena ,

Try to create UI page in global scope and call it in your ui action.

 

Please mark my answer as helpful/resolved if it resolves your query.

 

Thanks,

krishnamohan

 

View solution in original post

4 REPLIES 4

Chaitanya ILCR
Kilo Patron

Hi @Ayushi Saxena ,

you have to use the Endpoint of the UI page without .do

example  for case_creation form the endpoint is sn_hr_core_case_creation.do you have to use sn_hr_core_case_creation

ChaitanyaILCR_0-1748187537863.png

 

update your UI action script with endpoint of the UI page without .do 

function composeEmail() {
    var dialog = new GlideDialogWindow('YOUR UI page"s Endopoint without .do'); //
    dialog.setTitle('Compose Email');
    dialog.setPreference('sys_id', g_form.getUniqueValue());
    dialog.render();
}

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

KrishnaMohan
Giga Sage

Hi @Ayushi Saxena ,

Try to create UI page in global scope and call it in your ui action.

 

Please mark my answer as helpful/resolved if it resolves your query.

 

Thanks,

krishnamohan

 

Robert H
Mega Sage

Hello @Ayushi Saxena ,

 

Slightly off-topic, may I ask why you need a custom UI Action for sending an email? You could just use the built-in email client feature.

 

RobertH_0-1748191594568.png

 

If not present you can enable it for this particular table using these instructions.

 

Regards,

Robert

Hi @Robert H,

 

Out-of-the-box (OOB) functionality in the Source to Pay scoped application restricts email communication when a Purchase Requisition (PR) is in any of the following states:
• Closed - Rejected
• Closed - Complete
• Closed - Canceled
• Pending Submission
To overcome this limitation, we are creating custom UI Action.