Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Get key from XFormRun

Posted on by 230

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. 

pastedimage1610120431900v1.png

 

Is someone can help me to open my form with the Inner join on my datasource view

or

Get CurrentHierarchId in the xFormRun?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans