RE: Setup project resources on projects ?
Hi Andre,
Thanks for your response. Employement details (employment start/end dates and calendar) were already setup for workers.
To elaborate this issue; I have setup 4 legal entities (ABC, BCD etc) and one virtual company (SVC). Right now I am in ABC legal entity and tried to debug following code but bold conditions are failing.
\Classes\ProjProjectresourceList\getResources
this.addCompanyWorkerResourceData(currentDataArea, availableResources); // currentDataArea = 'ABC'
When above method calls;
select RecId from workerTable
join LegalEntity, ValidFrom, ValidTo from employmentTable
where employmentTable.Worker == workerTable.RecId
&& !(employmentTable.ValidTo < employmentStartDateTime)
&& !(employmentTable.ValidFrom > employmentEndDateTime)
join CalendarId from employmentCalendar
where employmentCalendar.Employment == employmentTable.RecId
&& employmentCalendar.CalendarDataAreaId == resourceDataArea
&& employmentCalendar.CalendarId != ""
join DataArea from companyTable
where companyTable.RecId == employmentTable.LegalEntity
&& companyTable.DataArea == resourceDataArea
join UserSession, ResourceSet from resourceSet
where resourceSet.UserSession == userSession
&& resourceSet.ResourceSet == ProjResourceSet::Cache;
For the first condition when I checked into WorkCalendarEmployment (EmploymentCalendar) table and found field CalendarDataAreaId = SVC not the legal entity (ABC) I am working in.
- I created new working calendar in ABC legal entity but it is still showing calendarDataAreaId = SVC. I thought it should be with calendarDataAreaId = ABC but it did not. Could you please tell me why is it so ?
- For the testing purpose I deleted virtual company from my dev enviornment which eventually deleted all entries from working calendar table. I created new working calendar in ABC legal entity and this time it was created with calendarDataAreaId = 'ABC'.
For the second condition where resourceSet.UserSession == userSession it is failing and not matching my useSession with what is stored in resourceSet table's field UserSession. Could you please tell me how to setup data into this resouceSet table so I can get this condition working.