Skip to main content
Solved

How to customize workflow's action to modify data in another custom table?

  • February 7, 2023
  • 3 replies
  • 457 views

olexandrProkopovych94
Jr Varsity II
Forum|alt.badge.img

There is a Quick Checks screen (AP304000). It is maintained with predefined workflow.
I need to customize some actions of the workflow.
Just in case, I use 2022 R1 version.

Examples, to be specific with my customization needs:

  1. When is invoked the Release action, I need to write the quick check amount to my custom table.
  2. When is invoked the Void action, I need to delete the amount from my custom table.

I don't need to change the workflow. I need to expand activities that are done by the present actions.

If to customize actions properties with the customization editor. On the Field Update tab I have access to the fields of the Quick Check screen only.
When to customize via code. There is no place to declare action body.

 

I know how to extend a regular graph action – declare delegate, then in the extended method invoke base method.
But how to extend an action of a workflow?

Best answer by gprice27

Hi Olexandr

 

Yes - I think you need to do this via graph extension

FYI - all the ‘Release’ process happens in APDocumentRelease

public virtual List<APRegister> ReleaseDocProc(JournalEntry je, APRegister doc, bool isPrebooking, out List<INRegister> inDocs)

There is a call to RaiseReleaseEvent(doc); in this proc. This is a protected method but it is possible to over-ride this and create a delegate to do your ‘thing’ on this event..

Also - you can always just hook into the Persist event or RowPersisting event to do you updates to your custom DAC

View original
Did this topic help you find an answer to your question?

3 replies

gprice27
Jr Varsity I
Forum|alt.badge.img
  • Jr Varsity I
  • 25 replies
  • February 7, 2023

Hi Olexandr

I think you will find it easier to over-ride either the Persist event of the graph - or if you look at the Release delegate - you will find a public ‘AfterRelease’ method that you can plug into/over-ride with a graph extension.

It is generally easier to just use the existing methods to add your changes than to modify the workflow

 

Cheers


olexandrProkopovych94
Jr Varsity II
Forum|alt.badge.img
gprice27 wrote:

if you look at the Release delegate - you will find a public ‘AfterRelease’ method that you can plug into/over-ride with a graph extension.

Well, for visual editor the problem stays.
<Fields to Update After Transition> grid has the only fields from the Quick Check screen.
For via code in workflow class, I guess, the same situation.

I think it is not possible yet.
Or should be some gimmicks to do this.

Or it should be done as usual: via graph extension, via declaring a delegate and then declaring an extended method.


gprice27
Jr Varsity I
Forum|alt.badge.img
  • Jr Varsity I
  • 25 replies
  • Answer
  • February 7, 2023

Hi Olexandr

 

Yes - I think you need to do this via graph extension

FYI - all the ‘Release’ process happens in APDocumentRelease

public virtual List<APRegister> ReleaseDocProc(JournalEntry je, APRegister doc, bool isPrebooking, out List<INRegister> inDocs)

There is a call to RaiseReleaseEvent(doc); in this proc. This is a protected method but it is possible to over-ride this and create a delegate to do your ‘thing’ on this event..

Also - you can always just hook into the Persist event or RowPersisting event to do you updates to your custom DAC


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings