web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Add 'Action' Method on Data Entity to Expose to Flow Fin & Ops Connector 'Execute Action'

(1) ShareShare
ReportReport
Posted on by 1,214

Hi,

I extended FreeTextInvoiceHeaderEntity and add a simple oData action method.

[ExtensionOf(tableStr(FreeTextInvoiceHeaderEntity))]
final class FreeTextInvoiceHeaderEntity_Test_Extension
{
    /// 
    /// Infolog
    /// 
    [SysODataActionAttribute('Post', true)]
    public void post()
    {
        info('FreeTextInvoiceHeaderEntity-Post');
    }

}

Then I create a power automate flow with Fin & Ops connector. In Execute Action, I'm unable to see my custom method to run in the flow.

I made sure to refresh entity list, restart DIXF service in DEV environment, but still the action method is not visible.

What am I missing? As far as I know, adding SysODataActionAttribute to the method is the only thing we need to do.

I was referring to official documentation here https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/odata#exposing-odata-entities .

Thank you.

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    As far as  I know, you can't add OData actions to existing entities via extension.

  • HAIRUL HAZRI Profile Picture
    1,214 on at

    Hi Nikolaos,

    that's strange. Doesn't seem documented anywhere.

    Anyway, I duplicated FreeTextInvoiceHeaderEntity, and created the same method as above.

    Then I tried to create a simple flow to run the execute action. Seems like custom action in custom entity is usable now.

    However, even after refresh entity list, running the action returns "NotFound" error:

    executeaction.png

     How to properly create a successful action? Ultimately, I want to perform free text invoice posting on the action method, but for starters I just want to test a simple action, hence only the infolog.

    If you have any example that I can refer, please share. Thank you.

  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    Hi,

    this doc page says: "OData actions added via extensions are currently not supported."

    docs.microsoft.com/.../odata

    How to create OData actions in your entities? You should find plenty of blogs, discussions and examples by searching the web.

  • André Arnaud de Calavon Profile Picture
    301,075 Super User 2025 Season 2 on at

    Hi Hairu,

    Can you show how you did setup this action in your flow? What type of environment are you using here?

  • HAIRUL HAZRI Profile Picture
    1,214 on at

    Thank you Nikolaos for pointing that out.

    Hi Andre,

    I simply use ExecuteAction action in Fin & Ops connector and call the method. This is my first time discovering oData action, so I'm testing in a cloud hosted DEV environment:

    3542.executeaction-setup.png

    Inside the method is just a simple infolog and return a string;

    public class FreeTextInvoicePostingEntity extends common
    {    
        /// 
        /// Infolog
        /// 
        [SysODataActionAttribute('TestPost', true)]
        public str testPost()
        {
            info('FreeTextInvoicePostingEntity-TestPost');
    
            return 'Test OData action here. Success.';
        }
    }

    After build the entity, I check the action metadata exists:

    executeaction-metadata.png

    But the flow output returns "not found" error:

    executeaction-output.png

    I don't understand what is the problem here. What am I still missing?

    Thank you.

  • Suggested answer
    zhifeng Profile Picture
    on at

    Hello HAIRUL ,

    Can you change method name to testPost in below code? 

    [SysODataActionAttribute('testPost', true)]

  • HAIRUL HAZRI Profile Picture
    1,214 on at

    Hi Kevin,

    thank you for your suggestion. I changed the action attribute name. However, the error persists. I even tried to:

    1. Restart IIS express

    2. Restart DIXF service

    3. Refresh entity list in Data Management

    4. Delete and recreate the flow

    But still unable to get past the error. Do you know any other possible cause? Thank you.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,075 Super User 2025 Season 2 on at

    Hi Hairul,

    I noticed another action which returns a string value in the standard application. This is having another code pattern as start of the method, e.g.:

    [
        SysODataActionAttribute('getBusinessEventsCatalog', false),
        SysODataCollectionAttribute('return', Types::String)
    ]

    It is explicitly mentioning the expected return type. You can try to align it with this example to see if it helps here.

  • HAIRUL HAZRI Profile Picture
    1,214 on at

    Hi Andre,

    After:

    1. changing 2nd argument of the action attribute to false

    2. Change the method to static

    the flow run successfully.

        [   
            SysODataActionAttribute("testPost", false)
        ]
        public static str testPost()
        {
        }

    But I still don't understand what's going on here. What does the 2nd argument & static method have to do with the "NOT FOUND" error?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 503 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 434 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans