0

I see we have a field in mysql workbench (and any other DB) named lastUpdatedStamp. is it possible to sort the results of an entity-find using order-by tag and lastUpdatedStamp? (or maybe other solution)

like <order-by field-name="lastUpdatedStamp"/>

It's not working.

hoper
  • 1,043
  • 7
  • 15
  • Can you post all of the code you have within the entity-find tags. – Ronan Keane Feb 17 '19 at 10:49
  • More details are needed to look into this... what do you mean by 'not working' (basic issue reporting: what happened and how different from what expected) and what does the rest of your test case look like? – David E. Jones Feb 17 '19 at 20:08
  • StackOverflow is good for questions but this seems like more of an issue. For information about Moqui community infrastructure and how to interact with others in the community please see: https://www.moqui.org/m/docs/moqui/Community+Guide – David E. Jones Feb 17 '19 at 20:09
  • ` ` this is how my entity-find looks like. I edit one of the records that is among the result of this. lastUpdatedStamp changes in mysql workbench but the order of the results of this entity-find doesn't change.I also added a dash before lastUpdatedStamp for descending order but no changes in the ordering of results. – hoper Feb 18 '19 at 10:45

2 Answers2

0

Hi Zaha I think lastTimeStamp is type of date and for date types order tag is like this :

  <order-by field-name="-createdDate"/>
M.A.M
  • 53
  • 8
0

I was making a careless mistake as I was doing an entity-find on a view-entity with several member-entities. I remember that it was possible to access a member-entity field by using:

<entity-alias>.<fieldName>

but it didn't work for me recently!! So I fixed it using below line in my view-entity definition (alias lastUpdatedStamp field of THE intended member-entity )

<alias entity-alias="whatever" name="upstamp" field="lastUpdatedStamp"/>

then I was able to orderby like:

<order-by field-name="upstamp"/>
hoper
  • 1,043
  • 7
  • 15