Can i change BaseEnums element values?

Hi All,

As of my requirement i have to add 2 addition BaseEnum elements of PurchReqStatus enum. Is it reflect to Base process?

After adding the elements in the PurchReqStatus Enum and arranged in the element value in order. But it is not working property. It is not getting enum base value in the order.

Regards,

Ganesh

Arrange your element in BaseEnum. suppose you have added test 1 and test 2 element and you want to display it on 5th and 7th position than arrange it in BaseEnum.

hi Pramod,

I arranged in that way for example:

previous
enum Value enum label
0 one
1 two
2 thre
3 four
4 five

after adding 2 elements

enum Value enum label
0 one
1 two
2 thre
3 four
4 seven
5 six
6 five

but in code getting the enum value like 4 it showing “five” not “Seven”. It is not changing it’s state.

Regards,
Ganesh

Hi ganesh,
Change the order of element as you want and set “UseEnumValue” property to “No”. hope it will work.

Why do you require a particular order? What are you trying to achieve? What do you mean by “Is it reflect to Base process?”

Note that the order of elements in AOT and their number values are two separate things.

Also, when adding enum elements, make sure you leave sufficient gaps in values to allow Microsoft to add their new elements without immediately getting conflicts. If the next value is 5, use 20 instead (for example). If you don’t do it, you can make your future upgrades very painful.

Hi pramod,

i will try as you said but it is not working.

Hi martin,

What do you mean by “Is it reflect to Base process?” for your question…

for example:

I supposed to change the enum value for purchReqStatus base enum, its going to effect any functionality flow like purchase requisition creation to purchase order creation.

I changed the enumvalue based on my requirement. It effect on whole process of purchase Requisition, status is wrongly showing without doing any thing.

If you mean whether adding a new enum element will magically add business logic using this element, the answer is obviously “no”.

If you mean whether changing a value of an element created by Microsoft is going to break your AX, the answer is “most likely”. Don’t do that. The problem is not in business logic itself, because code uses element names, not numeric values. But you have those values in database and if you suddenly changed meaning of these numbers, data in your database wouldn’t make sense.