-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output Enum int-values instead of/as well as strings #55
Comments
Hi @jespertheil, I haven't heard of it. Why do they want to have the numbers instead of the values? |
Most consumers are fine with the texts, but one wanted something that wouldnt be affected by translations. I think it should be possible to output both numbers and value as text. I'll look into it when I have a dev resource available, just curious if anyone else had similar requests. |
Well maybe creating a switch if you want to export numbers or text. |
I added the below few modifications which solves our need and outputs 2 columns for options fields, one column as now named Field-XX with the text-representation and another column named Field-XX-val with the option numeric value. The added column is added both to the csv file and to the manifest. In Util.Codeunit.al:
In CDMUtil.Codeunit.al :
I've attached the two modified files. If someone were to incorporate this in the BC2ADLS module it should maybe be controlled by an option if you want to output option values like this. /Jesper |
Thanks @jespertheil I will look at it after this week when I'm back from Directions. |
@jespertheil could you look at branche https://github.com/Bertverbeek4PS/bc2adls/tree/55-output-enum-int-values-instead-ofas-well-as-strings |
I can see that would work too, and be a better option for multi-lingual instances. But wouldn't it then make sense to output the enum-id instead of the text value for the other tables? Or make that an option as you also suggested above, that would be more intuitive to me. I'm sorry I can't test the solution since I don't have a BC instance (I don't code in BC anymore - that's at least 12 years ago :)), but I can ask someone to look at it next week. |
That is maybe also an option. But I thought this is a better design if we want to extend it with multiple languages. |
Hi Bert,
I finally got around to testing the change, and it works fine but it solves a different problem than my fix does. It might be a niche issue, but the customers BI department on the project I am on was asking to have Enum VALUES instead of / in addition to the Enum Texts because they don't want to rely on changing translations or different language switches on the system.
So my change outputs the enum value, your change supports choosing which language to use for Enum texts, also useful but different, if I have understood the use correctly.
They work fine together so for now we are using BC2ADLS with both changes.
Best regards, and a merry Christmas to you
Jesper Theil
…________________________________
Fra: Bert Verbeek ***@***.***>
Sendt: 24. november 2023 17:33
Til: Bertverbeek4PS/bc2adls ***@***.***>
Cc: Jesper Theil Hansen ***@***.***>; Mention ***@***.***>
Emne: Re: [Bertverbeek4PS/bc2adls] Output Enum int-values instead of/as well as strings (Issue #55)
That is maybe also an option. But I thought this is a better design if we want to extend it with multiple languages.
In the export are all the necessary fields. Like table id, name, field id, name, enum id and caption.
—
Reply to this email directly, view it on GitHub<#55 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKM5PDBQ53SC6KMT5FCMO6LYGDD6VAVCNFSM6AAAAAA6SZXXB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRVHA4TAMJVGQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Sorry @jespertheil I now understand it. Maybe next week I will take a look and do an proposal. Thanks! And sorry again for the confusion. |
@jespertheil I have created Pull Request: Can you take a look at it? |
@Bertverbeek4PS
I think this is a good solution, but would prefer being able to output both text and value - that is what we do at the moment. |
@jespertheil thanks! Ok I will wait until you have tested also. |
Added this in the newest release: |
I have had a request from one of the consumers of our data lake if we can support outputting the option fields as their numeric value instead of the corresponding text.
Has anybody met that requirement and maybe looked at a solution. My thought is that the ideal would be to output both as separate columns.
/Jesper
The text was updated successfully, but these errors were encountered: