Skip to main content
Solved

Cannot reference custom Action in process form


Modified the Customer Screen and one of the mods was to add a custom action button to calculate some custom fields.   The button and fields work perfectly.  But now I am trying to Add a custom process screen to allow us to run those buttons for all customers on a schedule. 

First I could not reference the Extension I created in the Process Form definition: 

It only accepted: 

customers.SetProcessDelegate<CustomerMaint>(
        delegate (CustomerMaint graph, Customer templat)
        {

Instead of : 

customers.SetProcessDelegate<CustomerMaint_Extension>(
        delegate (CustomerMaint_Extension graph, Customer templat)
        {

So naturally when it cam time to call the custom button it would not work: 

graph.Clear();
 graph.processon_extension(templat);

there was no processon_extension() available under the graph because the graph could only be CustomerMaint not CustomerMain_Extension. 

How do I reference an Action on an Extension of a form in a Process screen which I think can only be referencing a main form, not the extensions. 

Thanks in advance

Sorry I just realized I can reference the _extension of the form by: 

var graphext = graph.GetExtension<CustomerMaint_Extension>();

Using the GetExtension<name of extension> method


Thank you for sharing your solution with the community @edwardmcgovern97!


Reply