How to remove default Value

Hi Guys,

I need help here , i create a report and puts some parameters, but one of the parameter has a default value.

how can i remove that? Is there a way ? Please help and guide me…

Please see below image.

TIA.

[deleted]

If you don’t like the default value, change your data contract class and provide a different default value there. Just don’t forget enum fields (such as your status) always have a value (and of the enum elements). If you want to see an empty box, you have to have a valid enum element (often called None) without any label. (But you shouldn’t change the approval status enum.)

Hi Martin,

okay tnx i understand what your saying, can you give any codes or other way use to perform my requirements?
sorry martin but i have lack of knowledge in ax code…

thank you.

What exactly is the problem? Do you know how to assign an enum value to a variable? If so, go to your data contract class, let it implement SysOperationInitializable interface and do the work put the assignment to the initialize() method.

VersioningDocumentState     approval;


[
DataMemberAttribute(identifierStr(approval)),
SysOperationLabelAttribute('Approval Status')
]
public VersioningDocumentState parmApproval(VersioningDocumentState _approval = approval)
{
    approval = _approval;
    return approval;
}

like this?

What are you trying to show me? It looks like the definition of the data member itself. I talked about an assignment in initalize() method (as an implementation of SysOperationInitializable interface) - none of that is in your code snippet.

Ahh okay martin.
Sorry matin i never use that before, can you teach me or tell me if there is existing class in ax, so that i will study it
TIA

Can you explain your problem a little bit better? I’m not not sure what you want to see.

To implement an interface, add “implements SysOperationInitializable” in the class definition (learn more in Interfaces Overview on MSDN) and add the only method it defines, initialize().

I don’t remember where the interface is used in standard AX. Simply use cross-references to find where the interface is used; it’s exactly what I would do.

Hi Martin,

Same issue with this link >> Here

I’m sorry, but I don’t know what you want to say by the link. If you need our help with a particular, you’ll have to explain what it is.

i will revise my subject… when i generate the reports the approval status should have an empty value like those parameter such as status,itemid,PO,brand,category, sub category as shown image above…

the default value is 0 which is equivalent to “Draft”, i use SrsReportRunController to show that.

Okay, if you want to an alternative design, use the parts of my answer that applies to enums and assignments and ignore things regarding data contracts and the initialize() method. I still prefer doing it in data contracts, because it’s a better object-oriented design - it respects class responsibilities.

okay. what should i do now?

or i want to look like this…

This problem is covered in my first reply: Just don’t forget enum fields (such as your status) always have a value (and of the enum elements). If you want to see an empty box, you have to have a valid enum element (often called None) without any label. (But you shouldn’t change the approval status enum.)

what you trying to say is to add a additional new element?
okay what enum value i’m going to put?

Are you familiar with the concept of enumeration types, or enums? They’re data types defining a fix set of values. If you need an additional value there, you have to change the definition of the enum. In Dynamics AX, all these things are defined in AOT (Application Object Tree); enums are under Data Dictionary > Base enums.
If the enum in your report is the standard Approval Status enum, you shouldn’t try to change it. Instead, create a new enum with four values and later convert it to Approval Status. For instance, if your intention is to use it for filtering, None will mean that there won’t be query range, and other elements will mean a range with a values from Approval Status enum.

Nevertheless if you’re not familiar with basic concept such as enums (which explains why you don’t understand my answers), you shouldn’t be changing mission-critical enterprise application. Ask an experienced developer to help you.

Hi Martin,

I create new Enum as Approval Status same label in VesioningDocument but not EnumValues is any there any bearing ?

and another thing, can you teach me how to create range in uibuilder, your right i’m using this as filtering.

thank you.