xaf - devexpress get field from last row in child list -
i need in this. have table (master) , table b (child). i'm using devexpress xaf. need evaluate last row in child , show users in master table a.
lets table has followind fields: oid, employee, address [name] = persistent filed employee
lets table b has following fields: oid, employee (references tbale a), status (open, assigned, closed), status date
the child table has @ least 2 records each master record: oid employee status status date 1 mark open 2015-12-12 2 mark assigned 2015-12-13 3 mark closed 2015-12-29
so far used this:
[persistentalias("tableb[status != 'closed']")] public getstatus { {return evaluatealias(getstatus)}; }
i want show in master table a, each employee, last status of child list. when run code, open, because different closed, want if last line in table b status = closed, should return closed. don't know if explayned right! ideas? thanks
you should use aggregate functions pick last element of collection, instance, max , single functions.
[persistentalias("tableb.max(date)")] public datetime? getlastactiondate { {return (datetime?)evaluatealias(getlastactiondate)}; } [persistentalias("tableb[date == getlastactiondate].single()")] public tableb getstatus { {return (tableb)evaluatealias(getstatus)}; }
Comments
Post a Comment