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

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...