I have a form with a formCommandButtonControl in d365. I want to change the command associated to the button dynamically according to the condition in the code. I can't find any base enum to choose the value.
switch (x)
{
case 1:
formButton.command(New);
break;
case 2:
formButton.command(DeleteRecord);
break;
}
This is the property in the form
How can I choose New and deleteRecord value in x++ code?