derekfinlinson / xrm-webapi

Dynamics 365 Web Api TypeScript module
MIT License
27 stars 13 forks source link

Consider adding CRM specific types as TS definitions #2

Closed shytikov closed 7 years ago

shytikov commented 8 years ago

It would be nice to have CRM specific types be defined more strictly.

For example, OptionSetValue, Money or EntityReference, etc.

shytikov commented 8 years ago

It would also be nice to have more strict rules on Guid type, which is not CRM specific, but there are some bugs in turbo forms that causes validations fire twice if Guid to lookup filed was not supplied in uppercase! So it would be nice to ensure that Guids are always in uppercase, have right length, no braces, etc.

derekfinlinson commented 7 years ago

I added Guid, Entity and generic Attribute type for now. I'll have to think about how to add the other types, especially EntityReference, since the Web API expects certain formats for those in Create/Update.

shytikov commented 7 years ago

Regarding Attribute, you can actually reuse this definition. And that file actually contains more specific attribute types, as well as attribute values.

shytikov commented 7 years ago

Maybe is not good idea... it's better to have less dependencies as possible...

derekfinlinson commented 7 years ago

That library has a different definition of Attribute since it's form the Xrm.Page attributes. My library is really only for calling the Web API. It's a good idea to use that in your form scripts though for helping build your Web API requests,