I have a subgrid on Form A entity and based on the record count in Subgrid i need to Show/Hide +Generate button.
If Record count>0
then
show +Generate Button
else
Hide +Generate Button.
I added below code but that is not working
------------------------------------------------------------
function ShowGenerateButton(context) {
try {
var gridContext = context.getControl(/Section Name/);// get the grid context
var GridOnloadFunction = function () {
if (context != null && context != undefined && context.getControl(/Section Name/) != null
&& context.getControl(/Section Name/) != undefined) {
let count = context.getControl(/Section Name/).getGrid().getTotalRecordCount();
if (count > 0) {
return true;
}
else {
return false;
}
}
};
gridContext.addOnLoad(GridOnloadFunction); //run onload of subgrid
}
catch (error) {
}
};
-------------------------------------------------------------------
I added Enable Rule command and Parameter as Primary control in Ribbon workbench
Any quick suggestion will be marked as verified
Thanks
Sandeep