delegateas / XrmDefinitelyTyped

Tool to generate TypeScript declaration files for Dynamics 365/CDS client-side coding.
http://delegateas.github.io/Delegate.XrmDefinitelyTyped/
MIT License
133 stars 53 forks source link

Error when using XrmQuery.Create and XrmQuery.Update #94

Closed GianiNoyez closed 5 years ago

GianiNoyez commented 5 years ago
XrmQuery.create(x => x.accounts, { name: "test"}).execute((id: String) => {})

Argument of type '{ name: string; }' is not assignable to parameter of type 'Account_Create'. Type '{ name: string; }' is missing the following properties from type 'Account_Create': displayName, id, rpDisplayNamets(2345)

XrmQuery.update((x) => x.accounts, currentid, { name: "test" }).execute((id: string) => {});

Gives : Argument of type '{ name: string; }' is not assignable to parameter of type 'Account_Update'. Type '{ name: string; }' is missing the following properties from type 'Account_Update': displayName, id, rpDisplayNamets(2345)

Even when I'm copying examples I get these errors

magesoe commented 5 years ago

Add a namespace in the configuration where you specify you want to generate for web

magesoe commented 5 years ago

The issue comes from the fact that typescript has a namespace called Account

GianiNoyez commented 5 years ago

Add a namespace in the configuration where you specify you want to generate for web

That is the fix. Thanks a lot for the quick reply.

magesoe commented 5 years ago

No problem, thanks for trying out XDT!