Maximo Open Forum

 View Only

 Visual Attachment

Jump to  Best Answer
  • Administration
Seppe Diels's profile image
Seppe Diels posted 02-23-2023 01:38

Hi,

For our Work Order Tracking we wrote a Conditional Expression to make text visual if an attachment is present (via sigoptions):

exists (select 1 from doclinks where ownertable = 'WORKORDER' and ownerid = :workorderid)

This works fine as long as the attachment is attached via the work order. However it does not work when the attachment is placed in a service request and afterwards the work order is created via that service request.

Has someone an idea what conditional expression I need to use if an attachment is present in a work order, even if it is from the related service request?

Thanks in advance!

Seppe

Prashant Sharma's profile image
Prashant Sharma  Best Answer

Hi - Try this.

exists (
(select 1 from doclinks where (ownertable='WORKORDER' and ownerid=:workorderid))
UNION ALL
(select 1 from doclinks where (ownertable in ('SR','INCIDENT','PROBLEM') and ownerid in
(select ticketuid from ticket,relatedrecord where ticketid=recordkey and ticket.class = relatedrecord.class and
relatedrecclass=:woclass and relatedreckey=:wonum and relatedrecsiteid=:siteid))))
Seppe Diels's profile image
Seppe Diels

Hi,

This worked. Thank you very much! :)

Quick additional question: What does the 'UNION ALL' do in the expression?

Thanks in advance!

Seppe

DHL Aviation