Workflows and automated functions

So, I created a action triggering workflow that triggers on the Posting of a sales invoice... Hit post in GESSIH and this workflow fires every time, does what it is supposed to do, and life is well.

When i run FUNCFMINV to post a range of invoices, my workflow does not seem to be firing.  The end results are not there, and the trace file from 

FUNCFMINV does not include any of the Workflow debugs or traces that I added to my logic.

 Thoughts, suggestions, ideas?

I expected the workflows to work because they are triggered at the Supervisor level... and it is not function specific... it is tied to the SIH object.

thanks!

  • Hi,

    Create a Workflow Rule with an Event Type of "End of Task" and an Event Code of the Task that you've defined under the Batch Server Tasks that you want e-mailed on. Set your recipients and on the Message tab select "Linked trace file" under the Attachments section at the bottom. This will email the log file attached to the job run.Make sure in your batch task setup (GESABT) that the User Message checkbox is checked.

    For more information follow the below link
    sagecity.na.sage.com/.../275490
  • Hi,

    SivaKishna's answer may work in your case if you simply want a report about what was posted and not a specific workflow for each invoice (like printing), since it will only execute at the end of the task, not for each invoice.

    Otherwise, if you need a workflow to trigger for each invoice posting (object and task alike), I would use an entry point to call the workflow (CFMINVAFT@FUNCFMINV), by creating a dummy function and using a "Function entry" workflow.

    Unfortunately this may be out of your confort zone since development know-how is needed.
  • in reply to Roberto Nascimento
    Thanks Roberto, that is a creative approach that I had not thought of. I am a developer, so i should be able to build off of that suggestion pretty easily. I'll let ya know how it goes.
  • in reply to bmyerspgh
    Gonna eat a lil crow though... Roberto, do you know what actually triggers the "Function Entry" workflows though? is there a specific flag that the workflow logic would be looking for? thank you
  • in reply to bmyerspgh

    Like the name implies, when you enter a function! In this case, I recommend using a dummy function (which is not published) so it doesn't affect the ERP's standard processes. Because the only time the workflow will be executed is when you force it by code.

    Here are the specific steps:
    1. Create dummy function (in GESAFC): Example YMYFUNCTION
    2. Create workflow with type "Function Entry"
    3. Put this piece of magic in the entry point:
    Call WORKFLOW ("F_<function code>","","") From SUBAMSC
    Example: Call WORKFLOW ("F_YMYFUNCTION","","") From SUBAMSC

    3.1 (alternative):
    I don't use the following for "function entry" since the above code does the same and is simpler, but this should also work.
    Call WORKFLOW(TYPEVT,CODEVT,OPERAT,CLEOBJ) From AWRK
    Value Integer TYPEVT : # Type Workflow (objet/import/etc.) - the local menu of the field AWATYPEVT (3 = Function Entry)
    Value Char CODEVT : # Event Code: In this case, it's the function code.If the event type was Object it would be the object code
    Value Char OPERAT : # Operation: Empty in this case. If event type was Object we could say "C" for creation.
    Value Char CLEOBJ : # Key: Empty in this case. If event type was Object, it would be the document number

    Note: The invoice file is [F:SI2] in this specific entry point (to make the join in your data model if you want to join other tables).

  • in reply to Roberto Nascimento

    Glad I found this up here! Worked great once I quit messing up my Entry Point setup. lol