Object Inheritance and Data Loading
Posted: Thu Dec 29, 2016 7:53 am
I have to Reusable Part Objects, MOBClient and MOBClientStatistic. MOBClientStatistic inherits from MOBClient.
I get a list of MOBClientStatistics from the ServerModule and the data coming down is correct, it has the MOBClient and MOBClientStatistic data in it.
(censored client names) However when iterating through the data on the client, the base class data is not populated in the object.
Am I doing something wrong?
Code: Select all
function options(*DIRECT)
begin_com role(*EXTENDS #PRIM_OBJT *LISTFIELDS #ListFields) defaultpty(Caption)
group_by name(#ListFields) fields(#CLOFID #CLOCN #CLOFN #CLOD)
define_pty name(OfficeId) get(*AUTO #CLOFID) set(*AUTO #CLOFID)
define_pty name(ControlNumber) get(*AUTO #CLOCN) set(*AUTO #CLOCN)
define_pty name(DepartmentCode) get(*AUTO #CLOD) set(*AUTO #CLOD)
define_pty name(Caption) get(*AUTO #CLOFN) set(*AUTO #CLOFN)
end_com
Code: Select all
function options(*DIRECT)
begin_com role(*EXTENDS #MOBClient *LISTFIELDS #ListFields)
group_by name(#ListFields) fields(#wk_TotalSales #wk_GrossMargin #wk_TotalHoursWorked #wk_EmployeeCount #wk_GrossMarginPercent #wk_GrossMarginPerHour #wk_AverageHoursWorked #wk_PercentOfSales #wk_PercentOfGrossMargin)
define_pty name(TotalSales) get(*AUTO #wk_TotalSales) set(*AUTO #wk_TotalSales)
define_pty name(GrossMargin) get(*AUTO #wk_GrossMargin) set(*AUTO #wk_GrossMargin)
define_pty name(TotalHours) get(*AUTO #wk_TotalHoursWorked) set(*AUTO #wk_TotalHoursWorked)
define_pty name(EmployeeCount) get(*AUTO #wk_EmployeeCount) set(*AUTO #wk_EmployeeCount)
define_pty name(GrossMarginPercent) get(*AUTO #wk_GrossMarginPercent) set(*AUTO #wk_GrossMarginPercent)
define_pty name(GrossMarginPerHour) get(*AUTO #wk_GrossMarginPerHour) set(*AUTO #wk_GrossMarginPerHour)
define_pty name(AverageHoursWorked) get(*AUTO #wk_AverageHoursWorked) set(*AUTO #wk_AverageHoursWorked)
define_pty name(PercentOfSales) get(*AUTO #wk_PercentOfSales) set(*AUTO #wk_PercentOfSales)
define_pty name(PercentOfGrossMargin) get(*AUTO #wk_PercentOfGrossMargin) set(*AUTO #wk_PercentOfGrossMargin)
end_com
(censored client names) However when iterating through the data on the client, the base class data is not populated in the object.
Code: Select all
#SYS_APPLN.TraceMessageText( ("GetClients Completed Found &1 Records").Substitute( #ClientStatisticsList.ItemCount.AsString ) )
for each(#client) in(#ClientStatisticsList)
#SYS_APPLN.TraceMessageText( ("Client Name:&1").Substitute( #client.Caption ) )
endfor