• About
  • D365 Consulting
  • Technical Services
  • D365 Integration
  • D365 Upgrade
  • Blog
  • Contact
  • About
  • D365 Consulting
  • Technical Services
  • D365 Integration
  • D365 Upgrade
  • Blog
  • Contact
Category:

Dynamics 365 F&O

Browse: Home / Blog / Dynamics 365 F&O
09Dec2020

Power Apps – Code Reuse

by Wolftek in Dynamics 365 F&O, Power Apps

Yes, we know. No self-respecting D365 developer can stand the idea of writing the same line of code twice. Code reusability is at the core of the object-oriented development and certainly is in our book. As it stands, Power Apps aren’t lending easily to code reuse at the moment. Therefore, a creative approach is called for. One way code reuse can be achieved is by implementing the logic on a ‘click’ of a button (OnSelect event) and then ‘clicking’ the button programmatically throughout the application. Note, that this approach is limited to the same-page context; and while it is possible to extend it to other pages in your application, the user experience may be compromised (page flickering etc.).

Here is a flavor of how it is done:

  • Create ‘invisible’ buttons to mimic functions – we like to prefix these with ‘function*’ to indicate their purpose.
  • Implement logic on the OnSelect event
  • In the below example, one ‘function’ calls two other functions. RefreshCollections() invokes the getSales() and the getCustomers() logic:

  • This ‘function’ could then be leveraged from different events on the page. For example, on page load and on a periodic data refresh timer tick:

07Dec2020

Power Apps – The Three Flavors of D365 Connections

by Wolftek in Dynamics 365 F&O, Power Apps
Tags: D365FO, Power Apps, Power Platform

There are many different ways to connect Power Apps to D365 F&O. We’ll discuss the following three common approaches in this post:

  • Standard D365 F&O Connector
  • Custom Connector
  • Power Automate

We threw together a simple App to demonstrate these options:

 

Standard D365 F&O Connector

The use case here is simple. If you’re able to leverage the Standard F&O Connector, go for it! For simple update scenarios the connector does the job fairly well. Use the standard Patch function to insert or update the data.

Here is a simple example of creating or updating Customer Groups with a standard connector:

Custom Connector

The tool of choice for anything more complex and custom. This feature gives you the full flexibility that comes with custom services in D365.

Really briefly, we threw together a custom RESTful service in D365 and wrapped it in a Custom Connector:

Call the custom connector on button click:


Power Automate

The very nice fallback to the above methods is Power Automate. The use case here are scenarios that call for iteration of collections, multiple staggered actions, etc.

 

 

Recent Posts

  • Power Apps – Code Reuse

    Yes, we know. No self-respecting D365 developer can stand the…

  • Power Apps – The Three Flavors of D365 Connections

    There are many different ways to connect Power Apps to…

  • AIF Error – ContractFilter mismatch at the EndpointDispatcher

    If you’re seeing this error when consuming an AIF service,…

  • Wolftek.Dynamics.AX
    DIXF Crash – Decimals in CSV Source files

    We have noted an issue with the DIXF *.CSV source…

  • 12 Nov. 2015 AIF Sales order document service – XML Mystery

      We were asked to troubleshoot an interesting issue. The…

Categories

  • AIF
  • AIF
  • AX2012
  • Configuration
  • Deployment
  • DIXF
  • Dynamics 365 F&O
  • Integration
  • Integration
  • Power Apps
  • Production
  • Services
  • SSRS
  • TFS
  • Uncategorized
  • Upgrade

Add some widgets to this area!

  • About
  • D365 Consulting
  • Technical Services
  • D365 Integration
  • D365 Upgrade
  • Blog
  • Contact

© 2020 Wolftek, Inc.