web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need help : Parent - c...
Power Apps
Unanswered

Need help : Parent - child submitForm

(0) ShareShare
ReportReport
Posted on by 945

Hi guys,

 

Need help on my parent child problem. So I have 2 forms, lets say FormHeader and FormDetail.

There is one field in Form Header, named : NextLineNum, its datacardcontrol - default property is Parent.default

 

As I have the FormDetail, I want every time I add this with NewForm(FormDetail), when submit both form, same time, the FormHeader - field NextLineNum is added by 1, but if it is on edit form, EditForm(FormDetail), the Submit(FormHeader), don't add this field, just update which is will be same as the initial value.

 

As mentioned, I'm using Submit for both. so I didn't use Patch, because I want to make use its form validation automatically. But now I'm confuse how to make those logic works ?

 

Please help.

 

Thanks in advance

 

 

 

 

Thanks

Categories:
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    I am not sure if I understod your question... But, If you need to use something to add, why dont you use a var and set the var as default?

    If this dont solve your problem, show the "process" you want to make

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

  • Axal Profile Picture
    945 on at

    Hi @Nogueira1306 

     

    It is actually a simple process, but I found quite confusing in reality.

    Something like this :

    Axal_1-1629718440464.png

     

    I think my question is :

    1. Should I put the Default to -> already added by 1 ? or it is added by 1 after I Submit ?

    2. can I use Submit both forms, under the same button ? 

     

    For the variable, actually I managed to do it without variable, currently I put the Default of that field on FormHeader to be like this :

    If (FormDetail.Mode = FormMode.New,
     Parent.Default + 1,
     Parent.Default)

    So, refer to my question no. 1,  I am now, put the addition before it is being submitted.

    But apparently, if something wrong with FormHeader but FormDetail is ok, then FormDetail succeeded to submit,  but FormHeader won't be updated (means it falls back to the initial value + 1)

     

    Thanks

     

     

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    I think that you should only add after submit. And I would set it in a var to make it easier

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

  • Axal Profile Picture
    945 on at

    Ok,

    One last question, hopefully. Just to confirm, is it after Submit, and success, the FormMode is auto switch to View ? coz I tried to trap the process, and put some formula in OnSuccess of that FormDetail, whenever the formmode is Formmode.New, then I add Patch to update the field in table of FormHeader. It doesn't seems to work. As it looks like after success Submit of FormDetail, the form is not in New state anymore.

     

    Thanks

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    If you want to clear the form or change the view mode you need to set it onFailuer / On sucess

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard