A JavaScript library for Power Apps portals (previously Microsoft CRM Portals). To write basic functions like show and hide in Power Apps portals, we need to rely on jQuery for extensive manipuliation of DOM. The library provides these functionality in simple, clear and readable syntaxes. The library will help developers who are familar with Power Apps client script.
Xrm.Portal.Form.get(fieldName).getValue(); Xrm.Portal.Form.get(fieldName).setValue(object); Xrm.Portal.Form.get(fieldName).setValue(id, name, entityLogicalName); //For lookup Xrm.Portal.Form.get(fieldName).setVisible(bool); Xrm.Portal.Form.get(fieldName).setDisable(bool); Xrm.Portal.Form.get(fieldName).setRequired(bool); //Default - a default validation and a default message Xrm.Portal.Form.get(fieldName).setRequired(bool, function, message); //A custom validation and a custom message Xrm.Portal.Form.get(fieldName).attachOnChange(callback); Xrm.Portal.Form.get(fieldName).removeOnChange(); Xrm.Portal.Form.get(dateTimeFieldName).getData().options({options}); Xrm.Portal.Form.get(dateTimeFieldName).getData().options({ sideBySide: true}); //To show date component and time component side by side Xrm.Portal.Form.get(dateTimeFieldName).getData().minDate(new Date()); //To disable selecting past date Refer to more options here
Xrm.Portal.Form.get(subGridName).getRowCountFromCurrentPage(); Xrm.Portal.Form.get(lookupName).enableOneClick(); Xrm.Portal.Form.get(quickViewName).getValue(); Xrm.Portal.Form.get(quickViewName).renderAdaptiveCard(lookupName, adaptiveCardJSON, dataInJSON); Xrm.Portal.Form.get(fieldName).setValue(object).setVisible(bool).setRequired(bool); Xrm.Portal.Form.Validation.assertRegex(fieldName, RegEx, message, [isRequired]) Xrm.Portal.Form.Validation.denyPastDate(fieldName, message, [isRequired]) Xrm.Portal.Form.Validation.denyFutureDate(fieldName, message, [isRequired]) Xrm.Portal.Form.Validation.compareDates(mainFieldName, subFieldName, message, [isRequired]) Xrm.Portal.Form.Validation.setNumberRange(fieldName, min, max, message, [isRequired]) Xrm.Portal.User.getAsync() => promise The method transforms a text field into a canvas, allowing users to draw lines or sign. Base64 string of canvas will be set to the underlying text field.
Xrm.Portal.Form.get(fieldName).transformToCanvas();