Home / Questions / SysOperationControlVisibilityAttribute
Explanatory Question

SysOperationControlVisibilityAttribute

👁 0 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

SysOperationControlVisibilityAttribute is a very useful attribute in Dynamics 365 Finance & Operations (D365FO), especially when you are designing SysOperation (aka Data Contract) forms for batch jobs or services. Let me explain it clearly:


1️⃣ What it is

  • SysOperationControlVisibilityAttribute is an X++ attribute applied to Data Contract fields.

  • It controls the visibility of a control (field) on the SysOperation form (the dialog generated automatically for your batch job/service).


2️⃣ Why it exists

When you use SysOperation / Service Framework, D365FO automatically generates a form for your Data Contract (the contract parameters you define).

Sometimes you want:

  • Certain fields to always be hidden.

  • Fields to be visible only when certain conditions are met.

  • Fields to not appear at all in the UI, even though they are in the contract.

That’s what SysOperationControlVisibilityAttribute does.

Common Usage

To hide a contract parameter from the UI, decorate the parameter method as follows:


[DataMemberAttribute, SysOperationControlVisibilityAttribute(false)]
public int64 parmHiddenWorkItemId(int64 _workItemId = workItemId)
{
    workItemId = _workItemId;
    return workItemId;
}