I created a view to get if all Items in a WBS activity respect some item attribute.
When I added this datasource view on a existing form with a inner join, the form don't open (please wait...). but when I link my view with delayed join, form openned, but getting information is not user friendly! (I can inner join table and view on SQL easily)
So I supposed my view was too complexe.
So I created a TmpTable to get information for this specific project/HierarchyId and I inner join this TmpTable on my form. When a fill manually my TmpTable, form work properly. So I need now fill the TmpTable when I open my form.
[FormEventHandler(formStr(ProjWorkBreakdownStructureV2), FormEventType::Initializing)]
public static void ProjWorkBreakdownStructureV2_OnInitializing(xFormRun sender, FormEventArgs e)
{
FormDataSource ProjPlanVersion_ds = sender.dataSource(formDataSourceStr(ProjWorkBreakdownStructureV2, ProjPlanVersion));
ProjPlanVersion projPlanVersion = ProjPlanVersion_ds.cursor();
HierarchyIdBase CurrentHierarchy = projPlanVersion.HierarchyId;
WBSAttributsTableTmp::fillTmpTable(CurrentHierarchy);
}
But ProjPlanVersion is empty because there is a inner join with my empty TmpTable, so I cannot get CurrentHierarchy to fill my TmpTable.
In sender variable, CurrentHierarchyId is available, but I don't know how to get it.
Is someone can help me to open my form with the Inner join on my datasource view
or
Get CurrentHierarchId in the xFormRun?