Hello Community,
I have created a custom page as shown below and added a button to the top bar.
When adding a new record, I want to hide the 'Add to Timesheet' button.
I want to learn, how to define the method and Method Calling in UsrTasks_FormPage in schema Designer.
UsrTasks_FormPage Schema:
define("UsrTasks_FormPage", /**SCHEMA_DEPS*/[]/**SCHEMA_DEPS*/, function/**SCHEMA_ARGS*/()/**SCHEMA_ARGS*/ {
var IsVisible = function() {
//Logic is to Hide the Button on New Reacord Creation
};
return {
viewConfigDiff: /**SCHEMA_VIEW_CONFIG_DIFF*/[
{
"operation": "insert",
"name": "AddToTimesheet",
"values": {
"type": "crt.Button",
"caption": "#ResourceString(AddToTimesheet_caption)#",
"color": "primary",
"disabled": false,
"size": "large",
"iconPosition": "only-text",
"visible": { bindTo: "IsVisible" },
"clicked": {
"request": "crt.CreateRecordRequest",
"params": {
"entityName": "UsrTimesheet",
"defaultValues": [
{
"attributeName": "UsrProject",
"value": "$PDS_UsrProject_yuj01i4"
},
{
"attributeName": "UsrTask",
"value": "$Id"
}
]
}
},
"clickMode": "default"
},
"parentName": "ActionButtonsContainer",
"propertyName": "items",
"index": 0
}
]/**SCHEMA_VIEW_CONFIG_DIFF*/,
viewModelConfigDiff: /**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/[]/**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/,
modelConfigDiff: /**SCHEMA_MODEL_CONFIG_DIFF*/[]/**SCHEMA_MODEL_CONFIG_DIFF*/,
handlers: /**SCHEMA_HANDLERS*/[]/**SCHEMA_HANDLERS*/,
converters: /**SCHEMA_CONVERTERS*/{}/**SCHEMA_CONVERTERS*/,
validators: /**SCHEMA_VALIDATORS*/{}/**SCHEMA_VALIDATORS*/
};
});
Regards,
Ajay K