You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found problem with Xrm.Events.EventContext.
When I try to set the parameter type to Xrm.Events.EventContext on an event i.e. onLoad(context: Xrm.Events.EventContext)
I always get 0 attributes when calling formContext.data.entity.getAttributes().getLength();
Or iterate the attributes with formContext.getAttribute().forEach((attribute index))
Or iterate the attributes with formContext.data.entity.attributes
It's working properly if I don't strongly type the parameter i.e. onLoad(context)
It's only the attributes that not working, all the rest is working perfectly.
Discussed in #61759
Originally posted by feiry August 17, 2022
Hi,
I found problem with Xrm.Events.EventContext.
When I try to set the parameter type to Xrm.Events.EventContext on an event i.e. onLoad(context: Xrm.Events.EventContext)
I always get 0 attributes when calling formContext.data.entity.getAttributes().getLength();
Or iterate the attributes with formContext.getAttribute().forEach((attribute index))
Or iterate the attributes with formContext.data.entity.attributes
It's working properly if I don't strongly type the parameter i.e. onLoad(context)
It's only the attributes that not working, all the rest is working perfectly.
code example (not working):
`
static async onSave(context: Xrm.Events.EventContext): Promise {
const formContext = context.getFormContext();
`
working:
`
static async onSave(context): Promise {
const formContext = context.getFormContext();
`
The text was updated successfully, but these errors were encountered: