Skip to Content
avatar image
Former Member

How to determine type entity type of an Odata binding

I'm trying to create a baseclass method that can be called by different view that my be looking at different entities in the model. I would like to get the name of the entity of this.getModel().getObject(this.getView().getBindingContext().sPath)

Is there some way to determine the entity type of the returned object?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 12, 2017 at 12:01 PM

    You can get the type by using

    this.getModel().getObject("/#EntitySetName/Property/@type");

    Regards,

    Jamie

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 12, 2017 at 01:32 PM

    Thanks for your reply but it is the EntitySetName that I am trying to get. My model has two entity sets, PRHeaders and PRItems. Within the common routine I am writing I execute "this.getModel().getObject(this.getView().getBindingContext().sPath)" which may return a PRHeader or a PRItem depending on the view that is calling the routine. I need to be able to determine the Entity Set Name of the returned object.

    Mike

    Add comment
    10|10000 characters needed characters exceeded