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

Invalid OptionsetNames - UnknownLabel1 #349

Closed
JannyM85 opened this issue Dec 12, 2019 · 10 comments
Closed

Invalid OptionsetNames - UnknownLabel1 #349

JannyM85 opened this issue Dec 12, 2019 · 10 comments

Comments

@JannyM85
Copy link

When generate optionSets earlyboundtypes from CRM then you have problem with EarlyBoundTypes-Optonset name for example :

[System.Runtime.Serialization.DataContractAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "9.0.0.9154")]
public enum account_preferredcontactmethodcode
{

[System.Runtime.Serialization.EnumMemberAttribute()]
UnknownLabel1 = 1,

[System.Runtime.Serialization.EnumMemberAttribute()]
UnknownLabel2 = 2,

[System.Runtime.Serialization.EnumMemberAttribute()]
UnknownLabel3 = 3,

[System.Runtime.Serialization.EnumMemberAttribute()]
UnknownLabel4 = 4,

[System.Runtime.Serialization.EnumMemberAttribute()]
UnknownLabel5 = 5,

}

@teppolainio
Copy link
Contributor

Also short comment here from my response on #334.

I definitely understand the need for having optionset labels like "Päätös" not to end up in code in a form of "Pts" or "UnknownLabel1". I actually came here to look out for a possibility to add such functionality by myself. I was happy to find out someone had already done that. Nevertheless #334 seems to make labels like "_Päätös" if my mind debugging of the PR code was succesfull although "Päätös" (or a word starting with for example Ä) is perfectly valid enum label.

@JannyM85
Copy link
Author

Hi, thanks you for your comment. If you have better solutions please make pull request and I will test it. My solutions is base on my experience.

@teppolainio
Copy link
Contributor

teppolainio commented Apr 17, 2020

If I recall correctly I tried to say optionset enum values should not be prefixed with _ unless it is required by .NET and my intepretation of code was that it would generate _ prefix for every value.

JannyM85 pushed a commit to JannyM85/SparkleXrm that referenced this issue Apr 17, 2020
@JannyM85
Copy link
Author

I tried your word Päätös and when I use the method RemoveDiracritics result is Paatos, which is absolutely correct by my view. Can you explain me why you wont to use Diacritics in your code?

image

@teppolainio
Copy link
Contributor

I prefer code which communicates as closely as possible with terms used by end user. When end user uses a term "Päätös" it will improve cimmunication between developer and end user when both use same term for same matter. This in turn will reduce possibilities of misunderstanding hence improving maintainability.

Another issue is when you remove diacritics you get "Paatos" which has very different meaning in Finnish language than "Päätös". This makes enum label meaning more vague requiring more effort from developer and end user to agree what is specified which in turn is impediment from my perspective.

I would be satisfied if there would be option not to remove diacritics etc. characters if those characters are valid for .NET enums and remove if you want to. I think this would not be huge rework and it would allow non-ascii countries to use special characters when wanted to.

@JannyM85
Copy link
Author

Hi, I understand your view. Your request is quite unusable for me, but i understand it can be useful to different people. If you want change this functionality you can add pull request to my branche. Thanks for you comments.

@JannyM85
Copy link
Author

JannyM85 commented Nov 24, 2020

Hello Scott, we start new project and we use 1.0.432-beta and we have still same problem. Can you help as please? Default language is 1029.

5a7bc51b-cb3a-4e1b-9d37-9a7925f03bf7

@teppolainio
Copy link
Contributor

@scottdurow any thougts what should be done in order to get this functionality into released into spkl_dev? We had a internal discussion about this quite critical missing feature. We'd love to be able to use spkl to generate enums which are meaningful instead of being UnknownLabel1234567. Currently we need to manually fiddle around this impediment and doing so hinders our development process quite a bit.

One person from our team is doing work which would solve #349 (comment). He is working on top of excellent work already done by @JannyM85 regarding this issue into a branch https://github.com/scottdurow/SparkleXrm/compare/spkl/issues/349-earlyboundoptionsettranslation which has now been stale for almost 12 months.

@scottdurow
Copy link
Owner

Thanks for the push on this - I think I have solved this with a very small change - see #417
This will go into the next beta build

scottdurow added a commit that referenced this issue Apr 28, 2021
🐛 Force optionset label to 1033 since it's hard coded in CrmSvcUtil
@scottdurow
Copy link
Owner

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

Successfully merging a pull request may close this issue.

3 participants