Hello,
I have a group reference control that references the field Person from DirPerson as seen below. the field group AutoIdentification in the table HRMCourseAttendee contains two fields (hrmCourseId and Name). On a custom form, I have a grid where I am using this reference group control. How can I access and set the value of the fields in the group reference so that when the form is opened, the grid is prefiltered according to those values since I want to refine the results instead of displaying all the results.
Note: I am able to access and set the value of any of the other fields by simply setting the value of the QueryBuildRange on the executeQuery method of the datasource but I am not sure how to set the values of the fields inside the Group Reference Control.
Thank you
You need to understand one thing - Reference group control will show the user needed fields like Name etc. Instead of RecId.
In SQL, reference group control field will be stored as RecId values only. It never stores like Course Id and name.
You used the reference group control for HrmCourseAttendee table - So you need to pass the RecId of the table as query range.
You cannot pass only the course id field only in the reference group control.
Thanks,
Girish S.
Hi Girish,
My goal is to just initialize the Course Id inside the reference group control (that has two fields - Course ID and Name).
The following code initialized the course id to ''00001' only for the field HRMCourseId in the HRMCourseAttendee datasource and not the reference group control as shown below. How can I achieve this but for the Course ID shown in the group reference control. Thank you
QueryBuildDataSource qb; Range courseIDString; QueryBuildRange courseRange; qb = this.query().dataSourceTable(tableNum(HRMCourseAttendee)); courseRange = qb.addRange(fieldNum(HRMCourseAttendee, HrmCourseId)); courseIDString = strFmt("%1", queryValue('00001')); courseRange.value(courseIDString);
Hi Anthonymgy,
You need to pass the recid of DirPerson table to the reference group control.
Its same as you are adding other ranges.Add the range to person field and In the query value you need to pass the recid of DirPerson table.
Thanks,
Girish S.
André Arnaud de Cal...
292,162
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156