Skip to content
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

EBGv2 OptionSet Values are generated in base-language not English or the selected one #415

Closed
iggsn opened this issue Jun 1, 2023 · 13 comments
Assignees
Labels

Comments

@iggsn
Copy link
Contributor

iggsn commented Jun 1, 2023

Tool and Version
EarlyBoundGenerator V 2.2023.4.24

Describe the bug
My environment is in base-language German and has English as second language.
When I generate the EarlyBound files, I have tried to leave the setting "OptionSet Value Language Code Override" empty or use 1033 to have the values in English language.
image

However in both scenarios I am receiving German values:
image
By description I would expect to receive "Active" and "Inactive".

To Reproduce
Steps to reproduce the behavior:

  1. Have an environment with different base-language then English
  2. Leave "OptionSet Value Language Code Override" empty or use 1033
  3. See the resulting Optionset Values to be in your base language (at least I expect it uses currently the base language)

Expected behavior
I expect to have the OptionSet Values in the selected Override Language, if it exists in that language, otherwise fallback to base language.

Additional context
Beside of that, I really like version 2.0. It is streamlines, faster and handles Custom Api's better as Version 1.

@iggsn iggsn added the bug label Jun 1, 2023
@iggsn
Copy link
Contributor Author

iggsn commented Jun 12, 2023

Issue is persistent in the new Release as well: 2.2023.5.13

@daryllabar
Copy link
Owner

Forgive me if I ask a stupid question, since I don't have much experience working with other languages, I'm assuming you have the English language installed in your environment?

@iggsn
Copy link
Contributor Author

iggsn commented Jun 12, 2023

Hi Daryl. There are no only stupid answers. Yes, english is installed as second language. Base language is German.

I didn't found the right line of code. But I would try to return the label in the selected language. If empty I would return the label from the base.

Thank you for picking it up. By the way EBGv1 works correct with the languages. Still using it, with some issues in the Custom API.

@iggsn
Copy link
Contributor Author

iggsn commented Jun 19, 2023

Hi @daryllabar,

I digged a little bit into the code. I was not able to run/debug it without issues. Followed the instructions from www.xrmtoolbox.com but I was getting missing dll's issue or wrong versions.
Anyhow I tried to check the code by hand and think the potential root cause is potentially in the NameServices.cs.

Maybe in the function"private static string Transliterate(OptionMetadata optionMetadata, string englishName)".
In this function you assume, that the parameter "englishName" is really english. But in fact it is the translation of the Base-Language.

Do you have some instructions, how to debug the current main branch? I made a fork and was setting EarlyBoundV2-Project as starting project. Then I realized, that the project settings do not match the instructions of www.xrmtoolbox.com. So I assume, you do it somehow different. Trying to apply the official instruction lead me into missing assembly issues.

If you can give me some kickstart for setting the project up correctly, I can create a PR with a potential fix.

@daryllabar
Copy link
Owner

Sorry @iggsn, meant to send you some information on this before I headed out for my Holiday. The easiest is to debug it through the unit tests. There is a config value that you can set in the test project that actually attempts to hit a crm instance so you can debug. If you look through the build history, you will see failures where I accidentally checked in the app setting with the flag on. If you need more help, feel free to ask, but I may not be able to respond until I get back from holiday.

@bananamufu
Copy link

Any updates on this issue? It's keeping me from upgrading to v2 since every single option set value would have to be updated to use the base language instead of English.

@daryllabar
Copy link
Owner

I either need access to a Org that is setup with another language, or I need to get the metadata file and settings to be able to debug it. I was hoping @iggsn might have been able to debug and figure out the issue. I'm happy to try and do a screen share some time to walk through it as well...

@iggsn
Copy link
Contributor Author

iggsn commented Nov 11, 2023

Hi @daryllabar, I am sorry. I tried it (debugging in XrmToolBox), but didn't found yet the time to follow your advise of using the unit test.

Did some first experiment but I think I might need some additional help. I could figure out to run the test "CreateTestFileGeneration". However I don't get any OptionSet-File at all. Only Messages and Entities.

I was trying with the default configuration first and a metadata.xml from my environment (generated / saved) with EarlyBoundGeneratorV2.

I am interessted on what I am doing wrong, but I can also provide you the metadata.xml-file. Packed with 7zip it is only 553kb.

@daryllabar
Copy link
Owner

daryllabar commented Nov 11, 2023

Hmm... so the options for OptionSets are a single file, or separate files. I don't think there is an option for no files... unless you select only used option sets, and non of your option sets are global.

Also that is a really small metadata xml file. @iggsn I sent you a linked in connection, you can send me a message and attach the zip file there.

@iggsn
Copy link
Contributor Author

iggsn commented Nov 11, 2023

Unzipped it is about 40 MB. I created it with EBG and just saved it. It is filtering down just to a handfull of tables. So thatswhy it is small :-)

I tried single file. I am using the default settings file as I wanted to debug first. Second step would be to change the default setting to add language code 1033 for German to see where it steps out.

In the metadata are several global optionsets. I mostly use global.
@daryllabar: I attached you the filed as PM in LI.

@iggsn
Copy link
Contributor Author

iggsn commented Nov 11, 2023

@bananamufu I just had a quick session with @daryllabar.
We could figure out, what the problem is. Most likely this will find it's way into the next release.

Big thanks to Daryl for taking the time.

@bananamufu
Copy link

Sounds great, thanks for taking the time!

@daryllabar
Copy link
Owner

Fix is in the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants