conorjgallagher / Dynamics.ExtendedSvcUtil

Extension of the CrmSvcUtil to allow more custom creation of early bound types
5 stars 2 forks source link

Option set friendly name #3

Open katymariehughes opened 5 years ago

katymariehughes commented 5 years ago

Thanks so much for this amazing project!!

I am just having trouble understanding the option sets. I have defined one for example as

but still only appears in the files as planning_activitystatus. Others defined in a similar way have come through correctly with their name. I am wondering how the entity attribute informs the behaviour. Can you leave it blank?

If there are dependencies on multiple entities from one option set, do you define multiple keys for each entity or just the one. Again thank you !

conorjgallagher commented 5 years ago

Apologies, I missed this. Github hasn't been notifying me about issues / comments for some reason.

Did you ever manage to get over this issue? The way this project is meant to work is it will split out the optionsets into their own class files, or group them by the entity they belong to. When you do this for Global OptionSets it should spit out into a "Global" file as they aren't related to 1 entity in particular.

katymariehughes commented 5 years ago

No problem! I just re-read my message and it didn't actually make sense, sorry! So in my config I have:

<optionsSets>
 <optionSet name="planning_applicationformtype" friendlyName="ApplicationFormType" entity="planning_applicationsubmission" />
 <optionSet name="planning_activitystatus" friendlyName="ApplicationStatus" entity="planning_applicationsubmission" />
</optionSets>

and in the generated code I see:

[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("planning_applicationformtype")]
        public ApplicationFormType? planning_ApplicationFormType {
...

 [Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("planning_applicationstatus")]
        public planning__planningactivitystatus? planning_ApplicationStatus {
...

so the friendly name only applied to one. Both are global option sets and both have multiple dependencies / used in multiple fields on the planning_applicationsubmission entity. The only difference I can see is with the one that worked, the option set name was the same as the field name. Not a big deal if I can't get it to work but thought it was worth asking about in case I was doing something silly. Thanks!

conorjgallagher commented 5 years ago

On this one it might be a bug. Not sure why it's not behaving as expected. Am I correct in saying it ended up with a double underscore for some reason on the status?

I'll review and update with a fix if I can figure out the problem

katymariehughes commented 5 years ago

Damn, how did I not see that. That is the one value in the ones I'm looking at that has a double underscore. Whichever colleague that configured this CRM was v inconsistent haha. Thank you so much!