Blog

Dynamics 365 & Power Platform 2023 Release Wave 1, Customer Service and AI Builder

Dynamics 365 Portals – Leverage Liquid and Java Script Custom Code to Enhance Portal Capabilities

Dynamics 365 Portals

Dynamics 365 Portals offer a great way to enhance customer experience by extending some CRM configurations directly to the customer.  There comes a time when you may want your portal to perform some action that is beyond the out-of-the-box functionality.  Extending portal functionality often requires custom Java Script and or Liquid code.  Get familiar with some of the basic understandings of these two programming languages using this guide.

Liquid Code

Liquid code runs server-side- meaning that this code works great for making queries back to Dynamics to deliver data or perform an action.  Suppose you want to display some information from a parent record on the current record that a user is viewing from the portal.  You can use Liquid Code to define the field on the parent entity as a liquid object, and display the object on the web page.  Code like this is often times implemented on the Web Template portal entity.  Web Templates are used to structure and display data in particular ways for all Web Pages that utilize that Web Template.

Java Script

Java Script comes in handy when you want to improve the user-experience, but not always the best option to meet a business process’s needs, as Java Script can be subverted.  Want to hide/show a field on a portal page based on another field’s value? This is precisely where Java Script should be implemented.  It doesn’t stop there, though.  Use this code to pre-populate fields, hide/show sections and tabs, send an alert to a user, lock down fields, even make collapsible tabs!  Java Script is most commonly used as a way to mimic Dynamics 365’s Business Rules.  Implement this style of code of Web Forms, Entity Forms, Entity Form Metadata, and Web Templates.

Using Liquid and Java Script in conjunction

It is possible to use these two styles of code on the same portal component, within the same script.  Be aware though, that this method will not work in some cases.  For example, say you have a Java Script block of code that looks for a change of a field, and you want to execute a block of Liquid code when that field changes.  While this type of code could prove useful, it’s not possible, as Liquid runs server-side and cannot run after a web page has already been loaded on a browser.

Contact us!

Beringer Technology Group is always here to provide expert knowledge in topics like these. Contact us with any questions that you may have!

Beringer Technology Group, a leading Microsoft Gold Certified Partner specializing in Microsoft Dynamics 365 and CRM for Distribution. We also provide expert Managed IT ServicesBackup and Disaster RecoveryCloud Based Computing and Unified Communication Solutions.