Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Form with multi-datasources inserting new record into one table only

(0) ShareShare
ReportReport
Posted on by 65

Hi

I have some parameterization table (table X) which have personnel number and its custom properties. This table is a data source for a simple form with two command buttons (NewButton, DeleteButton).
Now, I have to add to that form a column with department (from OMOperatingUnit.Name). I have added few new data sources to get information about department (HcmWorker -> HcmPositionWorkerAssignment -> HcmPosition -> HcmPositionDetail -> OMOperatingUnit; LinkType - OuterJoin).
The problem is: when I'm trying to add a new record to my parm table (table X) I have validation error with info, that some field in OMOperatingUnit is empty. When I change LinkType to Delayed or Passive I can add new record without problem but in form grid data in department column isn't visible (sometimes active or first record only)
How to set it up?

  • Martin Dráb Profile Picture
    232,858 Most Valuable Professional on at
    RE: Form with multi-datasources inserting new record into one table only

    If the topic of this thread (Form with multi-datasources inserting new record into one table only) is resolved, please verify the answer. And either create a new thread for the other topic, or I (as a moderator) can split this thread for you.

  • everand Profile Picture
    65 on at
    RE: Form with multi-datasources inserting new record into one table only

    Thank you - it works fine (previously I have tryied override write() and initValue() method instead validateWrite())

    Another, but coresponding problem is:

    The table X (next one - I have few such parm forms) has ValidTimeStateFieldType set as Date. The form's datasource (table x) has ValidTimeStateAutoQuery set to DateRange. Unfortunatelly connecting table x datasource to HcmPositionWorkerAssigment (through HcmWorker) I'm getting error with incomatible data type in ValidTimeStateFieldType between those two tables. The form woks only if ValidTimeStateAutoQuery on table X datasource is set to AsOfDate, what is undesirable.

    Is the any way to achieve it without changing ValidTimeStateAutoQuery to AsOfDate?

  • Verified answer
    Martin Dráb Profile Picture
    232,858 Most Valuable Professional on at
    RE: Form with multi-datasources inserting new record into one table only

    You'll need some code to achieve that; fortunately it's very simple. You'll need to override two methods of the joined data source(s).

    Remove super() from write() to prevent saving of the record. And skip super() in validateWrite() as well (and return true) to skip all the irrelevant validations.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,060 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,858 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans