BPM on Attachments

I am trying to create a BPM on attachments. I have created a Pre-Processing record on XFileRef.Update. I want to prevent users from adding shortcuts as attachments. I cannot seem to get the BPM to work with any type of conditional I use.

Has anyone been able to do something like this?

Thanks!

Try a data directive the attachments stuff is tricky and I don’t think it uses the same BO for everything. Try a DD in XFileAttach or XFileRef

I have a BPM that checks to see if it’s a local drive or a mapped drive, it’s an In-Transaction Data Directive on XFileRef, seems to work for us. Here’s a screenshot of the setup, maybe you can tweak it to check for shortcuts files.

2 Likes

You should check for the file extension. Windows 7 shortcut files have the .lnk extension.

1 Like

I got it to show a message. I used an In-transition data directive. But it still allows the user to attach the file, after clicking OK. How do i stop the attachment?

image

I needed “Show Message” to be “Raise Exception”

1 Like

You need use the Raise an Exception to flow control to abort the current code block and exit from the BPM.

This is a code controlled example:
if(lastUnderScore + 1 == PartNum.Length)
{
throw new Ice.BLException(“Add manufacturer to end of part number”);
}
else

1 Like

The show message flow does not provide you with control. Use the Rise Exception to Display a message and abort the flow.

[/uploads/default/original/2X/a/a13d2883d4d54488fa7489cc1dc6b50356e3039d.png]

[/uploads/default/original/2X/b/b0ece0013a1eb570a24fab252a7469c798321a8c.png]