Home General

Workflow Attachments Initiation Error message

Dear All,

I have a requirement to check if the user is attaching a document or not while initiating a workflow with a specific name say abc.pdf. the user initiates a workflow from the smart view, so if I add a general call back event script, in the workflow general tab has workflow initiated section where it shows my event script, registered it for initiation complete and I am checking the volume of the attachment has that file or not, if I don't add files I am returning an error message but that error message is not shown to the user, I debugged from eclipse the call is invoking fine but there is no way to throw this error back to the user as we don't have something called send on ....instead it is showing as workflow initiated successfully,.if I add this event script in other steps it is giving the error message fine, please advise, how to achieve it.

does any body come across this please advise.


Meerasaaheb Mohmmad


  • Appu NairAppu Nair Livelink Rocks!
    edited April 2 #2
    Does it happen in eclipse or what if you save everything and run it on services does it do the job? When you debug and break the work has moved on or some theory like that.

    You are doing this onInitiate of the workflow right ? I wrote about this in my blog livelink.in long time back I was thinking sim was wrong with the code but in actuality it was an idiossyncracy on the start step and me debugging with builder 🤣

    I also remember documentation was kind of wrong it says you need to return true or false but when I looked at example event scripts from OT it was an assoc or vice versa .perhaps they fixed it for real ?

    Also the cside console won’t print anything if you don’t turn up debugging. It will show startup lines but then it goes silent in recent versions

    I would open up the recman event scripts and see what they do

    BTW no real product people see this please post in development or a content server forum
    For more bright people to give you their ideas
    another question is is the experience different whether or not classic UI is used?

    This is the error on the Documentation Object
    This object contains all the scripts that can be attached to
    the general callback events. These scripts must all return
    a boolean. Undefined for success or an Error on failure. Below is the
    prototype for all scripts stored within this object.

    But if you look at a OT sample like SaveToOrig you will see it is a Dynamic which is an Assoc.
  • Another option might be to create your own workflow type (instead of using an event script). If you look on the General Tab (in the workflow painter) there is an entry called "Workflow Type" that normally only has "Standard" as an option. Your own WF type gives you access to a ReadyForInitiation script where you should be able to make the checks you describe. Orphan WFMain:WFRoot:WFTypes, set a fType, fSubtype, and fName and you are off and running. Not sure it will help you but worth a look.

    Also I have a note (from some training I took LONG ago) that WFCustomScriptPkg has a method named StartWF that gets called for ANY workflow that is initiated. This might be another way to accomplish what you are after.


  • Appu NairAppu Nair Livelink Rocks!

    also, try to put what your code needs to do on this

    Not the Step becomes ready it is too early to do anything...

    Alternatively, this comes from a new 16.2.11 system with no customer written event script as you can see OT has included in RECMAN a tonne of eventscripts perhaps opening one of them and comparing it to this might help

  • Dear Appu And Team,

    Thanks for your inputs I am able to resolve the issue by changing the syntax of the event script to return from boolean to assoc. Appu suggestion worked like a charm thanks... I had looked at the existing event scripts and come up with mine. Attached the code for your reference...

    The attachments initiation error is captured now, it is halting the user in the initiating page if there are no attachments, and also it is showing the error message which I used in the code.

    I think this is a common question asked by many clients and we don't have a correct solution as of now in any forum thread, I think this works 100%. My environment is CS16.10.

    All other recommendations to check mandatory attachments are not work up to the mark except this. even I had also mimicked some kind of thing for this check before... like checking if the user clicked on Attachments link or not and using javascript I used to populate it in the main page and using jquery I used to check contents are there or not all lead to some time errors due to user clicks fast and browser compatibility is another big issue.


    Meerasaaheb Mohmad

Sign In or Register to comment.