Question
Error getting time subcomponents
I am getting the error “Object reference not set to an instance of an object.” with the code below in a connector business rule. I feel like I’ve used this code a ton but never had this issue before. Anyone have any thoughts on what I might be doing wrong this time?
WorkflowUnitPk wfPk = api.WorkflowUnitPk;
string wfTime = TimeDimHelper.GetNameFromId(wfPk.TimeKey);
TimeMemberSubComponents objTimeCmpnts = BRApi.Finance.Time.GetSubComponentsFromName(si, wfTime);
int wfFiscalYr = objTimeCmpnts.Year;
int wfFiscalPer = objTimeCmpnts.Month;Thanks,
Scott
