Thanks Re: Just keep in mind, if you rename a field or relation, you must restart the database before you can use those renamed fields or relations. I am sorted from the previous answer and strongly suspect it was this that caught me out, or I was having a decidedly off day. Steve
On 29/01/2020, 13:43, "4D_Tech on behalf of James Crate via 4D_Tech" <[email protected] on behalf of [email protected]> wrote: In the debugger, look at your “emp” entity. It will show you the fields *and* relations. Just use the name it shows for the relation, I.e. $text:=$emp.Text and then access fields on $text like any other entity, or you can access the related one field directly. $description:=$emp.Text.description Just keep in mind, if you rename a field or relation, you must restart the database before you can use those renamed fields or relations. Jim Crate On Jan 28, 2020, at 4:25 AM, UKVetDerm via 4D_Tech <[email protected]> wrote: > > Hi ORDA users > > I am starting to explore ORDA and with many false steps I have reduced some code to just a few lines which is great. However, I am struggling to extract a field from a related one table when working principally in the many table. > > > In the following selection – I cannot find the code to extract the field value from a related one table (Events is the many table) – I am building a calendar view with hmCal. > > I have named my relation and looked at the various examples and cheat sheets and just can’t get to grips with this. > > > > 4D there would be a good place for a 4D ORDA manual like when SQL was introduced for those of us that are not full time at this! > > > > I am sure I am missing something very obvious so any suggestions would be gratefully received! > > > > Thanks > > > > Steve > > UKVD > > > > -------------------------------------------------------------------------------------------------- > > > > C_OBJECT(emp) > > > > For each (emp;ds.Events.query("StartDate > :1 & StartDate < :2 & Calendar = :3";vMondaydate;vMondayDate2;True) > > $text:= a related one value! > > $err:=hmCal_Add Appointment (calarea;emp.AppointmentNumber;$text;emp.MainContact emp.AllDay;emp.StartDate;emp.StartTime;emp.FinishDate;emp.FinishTime;0) > > Blah blah … > > End for each > > > > > > ********************************************************************** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:[email protected] > ********************************************************************** ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] ********************************************************************** ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

