Enum conflicting with DB field name

DCraig

New Member
Hi All,

I've come across a strange issue. I have a simple class i use as an enum called OrderType like so:

CLASS Entity.Order.Enums.OrderType:
DEFINE PUBLIC STATIC PROPERTY TestOrder AS CHARACTER NO-UNDO INIT "TESTORDER" GET.
END CLASS.

Which i use in code like so:

MESSAGE OrderType:TestOrder VIEW-AS ALERT-BOX.

I have also just added a new DB table called 'SalesOrder' with a field called 'OrderTypeCode'.

Since adding the DB table above, .p or .cls files that use the enum class above now receive the following compilation error:

- ** OrderType is ambiguous with SalesOrder.OrderTypeCode

I am lost as to how this is happening? Considering the Db field is called OrderTypeCode?? If the field was called OrderType i would understand. I should also note that no code changes have been made. All i did was add the new DB table.

It's also worth noting that if i fully qualify the path to the enum class then the code compiles. E.g. this works:

MESSAGE Entity.Order.Enums.OrderType:TestOrder VIEW-AS ALERT-BOX.

If anyone could shed some light on why this is, that would be fantastic!

Thanks
 
Last edited:

Cringer

ProgressTalk.com Moderator
Staff member
It's probably because Progress allows you to be lazy. To refer to a table field you can qualify it with the minimum number of characters to make it unique AFAIK. So in your case, it thinks OrderType is shorthand for your field. IMO it is a bug and should be raised.
 

DCraig

New Member
Thanks for the response Cringer.

Well if that's the case it sure is annoying... its very strange though because i don't even have the DB table name in front of the 'OrderType'. Would it really try to assume what table to shorthand the field from?

Also, i'm using Progress version 10.2A02 if it helps at all?

Thanks
 

Cringer

ProgressTalk.com Moderator
Staff member
Any chance you can get on to 10.2B in the near future? As far as I know there are a lot of improvements and bug fixes to the OO stuff that you're missing out on.
 

DCraig

New Member
Well the company i'm working for has been on this version for a long time i think so there's probably slim chance of an upgrade happening but i will raise it with them.

So i guess a workaround for now would be to fully qualify the path to the enum class in all places it is referenced?

Thanks
 

Cringer

ProgressTalk.com Moderator
Staff member
Yeah it's a pain but at least it works :)
 
Top