最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

如何在Odata实体上添加“操作” / How to add ‘Actions’ on Odata entities

网络文摘 William 1501浏览 0评论
 
Hi Folks,
In this post, I'll show how to add a new action to D365FO Odata entities which you may want to access in Logic apps or Microsoft Flow. There could be two possible scenarios, either you have custom data entity where you can directly add a method or you have standard data entity for that you need to create extension class.  
First, let's see how to add on the custom entity (yes cause, it's straight forward 😉 ), 
Add your method on data entity and add below attribute
 [SysODataActionAttribute("<MethodName>", false)]
public static void <methodName>(<parameters(optional)>)
{
}
Save, Synch and Build your changes. This method should be available now on OData action in the Logic app or Flow. 
Now the other part, how to add the same in Data entity extension. Create a new class and add below attribute.
[ExtensionOf(tableStr(<data entity name>))]
final class <data entity name>_Extension
{
         [SysODataActionAttribute("<MethodName>", false)]
         public static void <methodName>(<parameters(optional)>)
        {
         }
}
Pl make sure you use '_Extension' keyword for above class, it's mandatory.
That's all for today. Try it and share your feedback. 
Related topics:
-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta
 
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址