- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 12-27-2017 02:04 AM
Hi All,
I have wriiten a BR as below:
When to run: after update
on table: communication(Parent table)
Conditions: NA or status is 'Deliverable approval'
CODE:
var prev_status = previous.u_status;
var event_deliverable = current.u_event_type;
if(event_deliverable == 'Paper'){
if((prev_status != 'Deliverable Approval') && (current.u_attachment_added.changes() || current.u_attachment_added == true)){
var gr_paper = new GlideRecord('u_paper_event');
gr_paper.addQuery('u_case_id_ref',current.sys_id);
gr_paper.query();
while(gr_paper.next()){
gr_paper.u_paper_last_email_date = gs.nowDateTime();
gr_paper.update();
}
}
else{
}
}
The above business run should run when an attachment is attached.
Kindly guide me on this.
Regards,
Sachin
one quick question about u_attachment_added.
what kind of field is this? Boolean type?
can you put some log in your business rule to check which if block is working or not..
Hi Harsh,
u_attachment_added is a boolean type.
The BR itself is not getting triggered when the attachment is attached.
NOTE: the form does not re-load / update when attachment is added.
Regards,
Sachin
if i am not wrong when ever you attach some file on your form then Boolean type field get updated?
or some other mechanism you have establish to check the attachment on your form?
kindly elaborate your business requirement.
Hi Harsh,
Yes 'u_attached_added' field is getting updated because in another BR i am doing as below:
When an attachment is attached:
(current.u_attachment_added.changes() && current.u_attachment_added == true)
and triggering an event
Regards,
Sachin
This document was generated from the following discussion: Business Rule not working