1

I have master child relationship form.

In child form, I have a Grid, I want my own "Insert" functionality so i just disabled "AddNew" Grid action button and Add new Custom button, Now what i want

  1. In custom Add button, I am calling child.Insert() method to add row,
  2. Now i can see added row in Grid,
  3. I want to update added row using Detail form, not using Grid row so i added a Formview, below of Grid
  4. In formview i want to show inserted row detail, it is showing the current added row.
  5. On selection of Grid row, I want to show detail in detail Grid

If user edit the detail then i wanted to show all edit detail in the Grid,

so similarly user can add/edit multiple rows using detail form, How may i achieve this? After adding a row, If i want to add another row then on click add button getting unsaved data error, How may i achieve above functionality?

 <px:PXFormView ID="rootCauseanaDataTab" runat="server" Width="100%" DataMember="MyData"
                        DataSourceID="ds" SkinID="Transparent">
                        <Template>
                            <px:PXLayoutRule runat="server" StartRow="true" StartColumn="True" LabelsWidth="SM" ControlSize="XM"></px:PXLayoutRule>
                            <px:PXButton ID="pxAddNew" runat="server" CommandName="AddNewData" CommandSourceID="ds" Text="Add Rootcause"></px:PXButton>
                            <px:PXLayoutRule runat="server" StartRow="true" StartColumn="True" LabelsWidth="SM" ControlSize="XM"></px:PXLayoutRule>
                            <px:PXSelector ID="edRootId" runat="server" AlreadyLocalized="False" DataField="CauseId" AutoRefresh="true">
                            </px:PXSelector>
                            <px:PXRichTextEdit ID="edRootCauseDesc" runat="server" AlreadyLocalized="False" DataField="Description">
                            </px:PXRichTextEdit>

                        </Template>
                    </px:PXFormView>
                    <px:PXGrid ID="PXGridNCTranRootCauseanaData" RepaintColumns="true" runat="server" Caption="Root Cause anaData" DataSourceID="ds" Height="150px" Width="100%" SkinID="Details" SyncPosition="true">
                        <ActionBar>
                            <Actions>
                                <AddNew Enabled="false" />
                            </Actions>
                        </ActionBar>
                        <Levels>
                            <px:PXGridLevel DataKeyNames="CauseId" DataMember="MyData">
                                <RowTemplate>
                                    <px:PXLayoutRule runat="server" ControlSize="XM" LabelsWidth="M" StartColumn="True" />
                                    <px:PXSelector ID="gdRootcauseId" runat="server" AllowEdit="true" AlreadyLocalized="False" DataField="RootCauseId" AutoRefresh="true">
                                    </px:PXSelector>
                                    <px:PXSelector ID="gdanaDataPerformedBy" AllowEdit="true" runat="server" AlreadyLocalized="False" DataField="anaDataPerformedBy" AutoRefresh="true">
                                    </px:PXSelector>
                                </RowTemplate>
                                <Columns>
                                    <px:PXGridColumn DataField="CauseId" TextAlign="Left" Width="135px" />
                                    <px:PXGridColumn DataField="Description" Width="80px" />
                                    
                                </Columns>
                            </px:PXGridLevel>
                        </Levels>
                        <AutoCallBack Target="tree" Command="Refresh" ActiveBehavior="True">
                            <Behavior RepaintControlsIDs="rootCauseanaDataTab"></Behavior>
                        </AutoCallBack>
                    </px:PXGrid>
user_mat
  • 191
  • 2
  • 16
  • I have solved above issue by adding a button outside of grid. Just a small issue. When i select a row then i want to show detail of selected row in detail form, formpostback in row selection but form view data is not refreshing. Please check above Html why? – user_mat Aug 04 '20 at 16:03
  • I am not sure whether you have already checked this blog post: https://asiablog.acumatica.com/2019/04/grids-master-detail-relationship.html – Joseph Caruana Aug 11 '20 at 21:48

1 Answers1

0

Regarding your issue that the form is not being refreshed I noticed that your Target is set as Tree, can you try changing that to rootCauseanaDataTab as well? And also try adding BlockPage="True" CommitChanges="True"

Sample Code:

  <AutoCallBack Target="rootCauseanaDataTab" Command="Refresh" ActiveBehavior="True">
        <Behavior RepaintControlsIDs="rootCauseanaDataTab"  BlockPage="True" CommitChanges="True"></Behavior>
    </AutoCallBack>
Joseph Caruana
  • 2,241
  • 3
  • 31
  • 48