Solved

On Hyperlink Click,Even after clicking other records its opening first row By default.


Userlevel 1
Badge


Hi

Workflow :

In QualityOrderMaint.cs, On Related QC order Tab, When on “Update Results and Sign Off” button, I am inserting the same records in SelectQC view. (TSRelatedQCOrderUpdate.cs - Acting as aUnbound DAC)
On Hyperlink Click,Even after clicking other records its opening first row By default.

 

TS301025

      <px:PXSmartPanel runat="server" ID="PXSmartPanel_processqc" DesignView="Content" Height="360px" TabIndex="2000" Width="1000px"
 CreateOnDemand="True" CaptionVisible="True" Caption="Select QC to Process" AlreadyLocalized="False" Key="selectQC" 
 AutoCallBack-Target="PXGrid10_qc" AutoCallBack-Command="Refresh">

      <%--  <px:PXGrid ID="PXGrid10_qc" runat="server" DataSourceID="ds" SkinID="Details" AutoAdjustColumns="True" SyncPosition="true"
            AdjustPageSize="Auto" AllowPaging="True" AllowSearch="True" Width="900px" Height="200px">--%>

                <px:PXGrid runat="server" ID="PXGrid10_qc" SyncPosition="True" Height="200px" SkinID="DetailsInTab" 
    TabIndex="2100" Width="900px" DataSourceID="ds">
          <EmptyMsg ComboAddMessage="No records found.
Try to change filter or modify parameters above to see records here." NamedComboMessage="No records found as '{0}&#39;.
Try to change filter or modify parameters above to see records here." NamedComboAddMessage="No records found as &#39;{0}&#39;.
Try to change filter or modify parameters above to see records here." FilteredMessage="No records found.
Try to change filter to see records here." FilteredAddMessage="No records found.
Try to change filter to see records here." NamedFilteredMessage="No records found as &#39;{0}&#39;.
Try to change filter to see records here." NamedFilteredAddMessage="No records found as &#39;{0}&#39;.
Try to change filter to see records here." AnonFilteredMessage="No records found.
Try to change filter to see records here." AnonFilteredAddMessage="No records found.
Try to change filter to see records here." />
      <AutoSize Enabled="True" MinHeight="200" />
      <Mode AllowAddNew="False" AllowDelete="False" />
            <Levels>

                <px:PXGridLevel DataKeyNames="QCOrderType,QCOrderNbr" DataMember="selectQC">
                      <RowTemplate>
                 <px:PXLinkEdit ID="PXLinkEditQCOrderNbr" runat="server" AlreadyLocalized="False" DataField="QCOrderNbr">
                        </px:PXLinkEdit>
                        <px:PXCheckBox ID="edselectedpro" runat="server" AlreadyLocalized="False" DataField="Selected"></px:PXCheckBox>
             

                    </RowTemplate>
           
                    <Columns>
                        <px:PXGridColumn DataField="QCOrderType" Width="150px">
                        </px:PXGridColumn>
                         <px:PXGridColumn DataField="QCOrderNbr" Width="200px" LinkCommand="QCNbr" CommitChanges="true"></px:PXGridColumn>
                      
                        <px:PXGridColumn DataField="Selected" Width="350px" Type="CheckBox">
                        </px:PXGridColumn>
                    </Columns>
                </px:PXGridLevel>
            </Levels>
            <AutoSize Enabled="True" MinHeight="200" ></AutoSize>
            <Mode AllowAddNew="False" AllowDelete="False" ></Mode>
        </px:PXGrid>
        <px:PXPanel ID="PXPanel14" runat="server" SkinID="Buttons" AlreadyLocalized="False" DataMember="">
            <px:PXButton ID="PXButton21" runat="server" DialogResult="OK" Text="OK" AlreadyLocalized="False" />
            <px:PXButton ID="PXButton24" runat="server" DialogResult="Cancel" Text="Cancel" AlreadyLocalized="False" />
        </px:PXPanel>
    </px:PXSmartPanel>

 

QualityOrderMaint.cs 

 

 public PXAction<TSRelatedQCOrderUpdate> QCNbr;
        [PXUIField(DisplayName = "QC Nbr", MapEnableRights = PXCacheRights.Select)]
        [PXButton(SpecialType = PXSpecialButtonType.Report)]
        // protected virtual void extDoc(PXAdapter adapter)
        protected virtual IEnumerable qcnbr(PXAdapter adapter)
        {
         

            var parameters = new Dictionary<string, string>();
            parameters["OrderType"] = this.selectQC.Current.QCOrderType;
            parameters["OrderNbr"] = this.selectQC.Current.QCOrderNbr;

            TSQCQualityOrderType Otype = PXSelect<TSQCQualityOrderType, 
                Where<TSQCQualityOrderType.qualityOrderType, Equal<Required<TSQCQualityOrderType.qualityOrderType>>>>.Select(this, parameters["OrderType"]);
            if (Otype != null)
            {
                throw new PXReportRequiredException(parameters, Otype.CertificateOfAnalysis.Replace(".rpx", ""), PXBaseRedirectException.WindowMode.New, string.Empty);
            }
            else
            {
                throw new PXReportRequiredException(parameters, "TS000002", PXBaseRedirectException.WindowMode.New, string.Empty);
            }

        }

 

Can you provide Solution for this?

 

Thank You

icon

Best answer by Naveen Boga 27 March 2023, 06:49

View original

10 replies

Userlevel 5
Badge +1

@rajanip50 Have you used DependOnGrid="PXGrid10_qc" in the call back commands?

Userlevel 7
Badge +17

@rajanip50 

Is this grid, unbound DAC?

It seems this grid not holding the current value, hence it is redirecting to the first record.

 

Have you debugged and verify the current values?

Userlevel 1
Badge

@Naveen Boga 

Yes its unbound DAC.

I have debug the code and checked.

Records are inserting in the view but while clicking hyperlink its showing first record only.

In below highlighted line itself its taking first row by default.

 public PXAction<TSRelatedQCOrderUpdate> QCNbr;
        [PXUIField(DisplayName = "QC Order Nbr.", MapEnableRights = PXCacheRights.Select)]
        [PXButton(SpecialType = PXSpecialButtonType.Report)]
        protected virtual void qcnbr()
        {
            this.selectQC.View.RequestRefresh();
            if (selectQC.Current != null)
            {
                TSRelatedQCOrderUpdate Ord = selectQC.Current;
                if (Ord.QCOrderType != null && Ord.QCOrderNbr != null)
                {
                    QualityOrderMaint QualityOrderGraph = PXGraph.CreateInstance<QualityOrderMaint>();
                    QualityOrderGraph.TSqcneworderView.Current = PXSelect<TSNewQCOrder, Where<TSNewQCOrder.qCOrderType, Equal<Required<TSNewQCOrder.qCOrderType>>,
                        And<TSNewQCOrder.qCOrderNbr, Equal<Required<TSNewQCOrder.qCOrderNbr>>>>>.Select(QualityOrderGraph, Ord.QCOrderType, Ord.QCOrderNbr);

                    if (QualityOrderGraph.TSqcneworderView.Current != null && QualityOrderGraph.TSqcneworderView.Current.QCOrderType != null && QualityOrderGraph.TSqcneworderView.Current.QCOrderNbr != null)
                    {
                  
                        PXRedirectRequiredException requiredException = new PXRedirectRequiredException(QualityOrderGraph, "TS301025");
                        {
                            requiredException.Mode = PXRedirectRequiredException.WindowMode.NewWindow;
                            throw requiredException;
                        };
                    }
                }
            }


        }

Userlevel 1
Badge

@Vinay Koppula 

No i didnt use DependOnGrid="PXGrid10_qc" in the call back commands.

Userlevel 7
Badge +17

@rajanip50  Since this is Unbound DAC, just wanted to know are you maintaining the Key fields?

The above redirection issue is related to KEY fields, can you please share the Unbound DAC and also share the code to insert the values in the GRID. which can help us to identify the root cause for this issue.

 

 

Userlevel 1
Badge

@Naveen Boga 

 

 

Userlevel 5
Badge +1

@Vinay Koppula

No i didnt use DependOnGrid="PXGrid10_qc" in the call back commands.

Use the following code to declare the callbackcommand.  

<px:PXDSCallbackCommand Name="QCNbr" Visible="false" CommitChanges="true" DependOnGrid="PXGrid10_qc"  />

Userlevel 1
Badge

@Vinay Koppula Still its not working.

Userlevel 7
Badge +17

Hi @rajanip50 

  1. As you have created database table for the DAC, then it will be a BOUND DAC.
  2. As suspected, selectQC.Current, here it self you are getting the first record, which is an issue.
  3. Since this is a Pop-up can you change the Skin ID = “DetailsInTab” to “SkinID =”Inquire” ” if you are not inserting the details from Pop-up
  4. Can you please also remove this code ==> this.selectQC.View.RequestRefresh(); before checking the selectQC.current !=null

 

Can you please verify now and confirm?

Userlevel 1
Badge

Hi @Naveen Boga 

Its Working.

In Aspx added “SkinID =”Inquire”

In DAC , We have added Selector.

We did Some changes in Below method(QCNbr)

   #region RE Hyperlink Quality Order Number
        public PXAction<TSRelatedQCOrderUpdate> QCNbr;
        [PXButton]
        [PXUIField]
        protected virtual void qCNbr()
        {
            TSRelatedQCOrderUpdate row = selectQC.Current;
            if (row.QCOrderNbr != null)
            {
                TSNewQCOrder formula = PXSelect<TSNewQCOrder,
                    Where<TSNewQCOrder.qCOrderNbr, Equal<Required<TSNewQCOrder.qCOrderNbr>>>>
                    .Select(this, row.QCOrderNbr);
                if (formula != null)
                {
                    QualityOrderMaint graph = PXGraph.CreateInstance<QualityOrderMaint>();
                    graph.TSqcneworderView.Current = formula;
                    if (graph.TSqcneworderView.Current != null)
                    {
                        throw new PXRedirectRequiredException(graph, true, "Quality Order");
                    }
                }
            }
        }
        #endregion

 

Thank you so much for your Support!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved