Access record identifier in form redirect
The record identifier can be included in the redirect string using %s placeholder. For example, if a form is used to create a new record, and you would like to redirect to a page viewrecord afterwards, then the new record identifier can be passed in the query string:
Access user contact information in code
Sometimes it’s required to access information about the currently logged-in user in PHP. It can be easily done by using Identity class that has static auto method that returns the current user identity information including the linked CRM record (if available).
Add current WordPress user to Twig
To add WordPress user as an object to Twig, use the following code:
Add custom functions and variables to Twig
To add a custom Twig function use following action:
Add twig in header/footer
Inside the page content inserting twig content is as easy as
Attachments in twig
The attachments stored in annotation entity are accessible using a special purpose-built URL:
Call workflow
While it’s not possible to call any workflow directly there is a simple workaround that involves using custom actions.
Create app id and secret for OAuth authentication
IMPORTANT! To complete the steps below you need to have one of the following roles in Microsoft Entra ID: Dynamics 365 Administrator, Power Platform Administrator, or Global Administrator.
Custom notifications for user functions
Dynamics 365 plugin has built-in notifications when a WordPress user is created, updated, or deleted. Custom actions associated with these events are distributed as part of the Dynamics 365 solution and can be customized further to perform the required operations.
Editing user profile
If a page is bound to a contact table then passing contact identifier in the query string will set the currentrecord object and allow record editing using, for example a Gravity form that relies on the record binding.
Form redirect is not working for twig forms
After submitting a form, a site visitor can be redirected to any page using redirect attribute of the {% form %} tag
Messages in custom twig form
Messages in twig forms can be customized using messages property. That approach, however, does not work for custom twig forms where the form is provided as part of the {% form %} tag.
Upload attachments in twig forms
To add attachment uploads to Twig forms, you need to build a custom form layout with an input file control and an upload handler.