Maximo Open Forum

 View Only

 checkbox will get checked automatically, if that wo has any attachment attached it.

  • Customizations
  • Everything Maximo
  • Maximo User Groups
  • Work Management
Deepa P's profile image
Deepa P posted 11-29-2022 09:57
I have a requirement to create a checkbox in Maximo and the checkbox will get checked automatically, if that wo has any attachment attached it. How do I do this?
Jason Uppenborn's profile image
Jason Uppenborn
There are a few options for solving this, ranging from formulas to relationships and domains to automation scripts. It will help make the right choice if we know why you need a checkbox instead of just the out-of-the-box lighting-up of the Attachments control.
Deepa P's profile image
Deepa P
Hi Jason,
Thanks for replying. I believe the current out of box functionality lights up for all scenarios ex: if attachment is from.asset/ wo/ loc etc.I want a checkbox in the workorder application, which will get checked/unchecked only and only if any attachment gets added / deleted from workorder app only. Now I have written an automation script that is doing the work but the problem comes when :
there is an asset/loc, having an attachment and that asset/loc is used in the workorder, now the workorder is having attachments from asset but the checkbox is uncheck(which is good) now when I add an attachment from workorder app to that particular wo, the checkbox gets checked(which is working as expected) but when I remove the wo attachment from the workorder app now, the checkbox doesnt get unchecked. (this is the problem now, as it should only be checked if there is an attachment from wo app not from any other app). Shall I share the script code? Was I able to deliver my requirement?
Jason Uppenborn's profile image
Jason Uppenborn
You will need a script tied to a delete launch point on DOCLINKS where the owner is a work order. The script will need to cycle through the "sibling" mbos  in mbo.getThisMboSet() looking for where OWNERTABLE and OWNERID refer to the work order found by mbo.getOwner() and where toBeDeleted() is false. If you don't find any doclink mbos that fit that criteria, clear the checkbox / set the attribute value to False.
Deepa P's profile image
Deepa P
Thanks Jason. I have tried it but not successful. I am new to automation script, do not have much experience. If you could  help me a bit with the code,that would be very helpful.
Arkady Karpushin's profile image
Arkady Karpushin
Hi,
If you need just to show checkbox at related object, you can add at App Designer checkbox with reference to doclink field DOCLINKS.GETLATESTVERSION.