Bhubaneswar, Odisha, India
+91-8328865778
support@logyscal.com

Pass Parent form ID and sellected record ids from a subgrid command button in Model driven power apps

Pass Parent form ID and sellected record ids from a subgrid command button in Model driven power apps

You can pass Parent form ID and sellected record ids from a subgrid command button in Model driven power apps Follow below method.

Step 1 : Create a JS

function testParam(parentrecordid,subgridselectedids)
{
   alert(parentrecordid);
   alert(subgridselectedids);
}

Step 2 : Add Command Button & Call JS with Parameter

Now open the Model Driven App and Edit Command Bar. Select Subgrid command for Child Entity.

Make sure to select the command edit for child entity. Select Subgrid option and click Edit

Step 3 : Add a new command and call the JS library with parameter

Add a new command and specify name.

Set Visibility PowerFX to hide the command if no record is selected in the subgrid. In the Action command call the JS web resource and in function name add the function name from javascript file. Add two parameters.

  1. Parameter 1 – Primary Item Ids
  2. Parameter 2 – SelectedControlsAllitemIds

Now publis the Command and Model Driven APP. Now if you refresh and test on clicking the command button from subgrid you will see tow alerts.

First alert Parent record ID.

Second alert will diplay all selected records of subgrid with comma separated.

Now in JS you can add your own logic using the record IDs.

Hope this helps. This use case is used mostly for Cloning records.

You can enroll now !We are giving 30% discount on our Internship Program

Don’t miss the chance to participate in the upcoming Internship Program which will be done using Microsoft Dot Net Web Development Full Stack Technology. The new batch will be starting from May 20, 2024.  We will have most experienced trainers for you to successfully complete the internship with live project experience.

Why to choose Our Internship Program?

Industry-Relevant Projects
Tailored Assignments: We offer projects that align with your academic background and career aspirations.
Real-World Challenges: Tackle industry-specific problems and contribute to meaningful projects that make a difference.

Professional Mentorship
Guidance from Experts: Benefit from one-on-one mentorship from seasoned professionals in your field.
Career Development Workshops: Participate in workshops that focus on resume building, interview skills, and career planning.

Networking Opportunities
Connect with Industry Leaders: Build relationships with professionals and expand your professional network.
Peer Interaction: Collaborate with fellow interns and exchange ideas, fostering a supportive and collaborative environment.

Skill Enhancement
Hands-On Experience: Gain practical skills and learn new technologies through project-based learning.
Soft Skills Development: Enhance communication, teamwork, and problem-solving skills essential for career success.

Free Demo Class Available