This is Possible via Plugin Assembly and Steps. I used following code:
First declared variables:
var formContext = executionContext.getFormContext();
var casecategory = formContext.getAttribute("afm_casecategory").getValue();
var arrStatus = formContext.getAttribute("statuscode").getOptions();
var InProgress = { value: 1, text: "In Progress" };
var MissingBackup = { value: 2, text: "Missing Backup" };
var poNeeded = { value: 3, text: "PO Needed" };
var NeedClarification = { value: 4, text: "Need Clarification" };
var ManuallyPosted = { value: 5, text: "Manually Posted" };
var InApproval = { value: 6, text: "In Approval" };
var Rejected = { value: 7, text: "Approval Rejected" };
var sapPosted = { value: 8, text: "SAP Posted" };
var sapError = { value: 9, text: "SAP Error" };
Then defined criteria:
if (casecategory == 747120001) //Accounting
{
formContext.getControl("header_statuscode").addOption(InProgress);
formContext.getControl("header_statuscode").addOption(MissingBackup);
formContext.getControl("header_statuscode").addOption(poNeeded);
formContext.getControl("header_statuscode").addOption(NeedClarification);
formContext.getControl("header_statuscode").addOption(ManuallyPosted);
formContext.getControl("header_statuscode").addOption(InApproval);
formContext.getControl("header_statuscode").addOption(Rejected);
formContext.getControl("header_statuscode").addOption(sapPosted);
formContext.getControl("header_statuscode").addOption(sapError);
}
else {
formContext.getControl("header_statuscode").addOption(IP);
formContext.getControl("header_statuscode").addOption(Submitted);
formContext.getControl("header_statuscode").addOption(New);
formContext.getControl("header_statuscode").addOption(WaitingforDetails);
}
Then Built Plugin.
Once Plugin is built, then I used XRM Toolbox Plugin Registration tool.
As a result, I see Choices in BPF as below:
