Monday, November 1, 2021

Show or Hide TIME component from Date Time in Model Driven Apps


Introduction:

In this blog we will see how to show or hide Time Component using JavaScript in Model Driven Apps/ MSCRM


Implementation Steps:

 

Some time Use want to Show/Hide Time Field Component based on their Requirement

 

rampprakash_0-1635767054619.png

 

To Achieve that we need to write some JavaScript to enable and disabled Component

 

Syntax:

 

formContext.getControl(arg).setShowTime(bool);

 

arg = Field Logical Name

bool = true/false 

 

To Enable time Component:

 

function enableTimeComponent(executionContext){
var formContext = executionContext.getFormContext();
formContext.getControl("FieldLogicalName").setShowTime(true);
}

 

To Disable time Component:

 

function enableTimeComponent(executionContext){
var formContext = executionContext.getFormContext();
formContext.getControl("FieldLogicalName").setShowTime(false);
}

 

That's it 

No comments:

Post a Comment

How to Clear Cache in Canvas PowerApps while working on Offline mode?

  Introduction In this blog, we’ll look at how to clear cache in Canvas Apps when using the Power Apps mobile application, especially when t...