Thursday 13 June 2013

EP: C# Passing parametes from Modal dialog to calling page.

Parent page:

    protected void Page_Load(object sender, EventArgs e)
    {
       
        AxBaseWebPart.GetWebpart(this).ModalDialogClosed += new EventHandler(Base_ModalDialogClosed);
    }

///
    /// This method will  be used to Returning the value ModalDialogClosed.
    ///

    ///
    ///
    void Base_ModalDialogClosed(object sender, AXModalDialogClosedEventArgs e)
    {
        // Code to handle the returned value.
        string returnValue;
        returnValue = e.DialogArgs.Data;
        QtyEdit.Text = returnValue;
        try
        {
            if (returnValue != String.Empty && localRecId != String.Empty)
            {
                this.AvaOrderingListEntryDS.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("SalesLineQty", returnValue, localRecId);
            }
        }
        catch (Exception ex)
        {
            Proxy.Info objInfoLog = new Proxy.Info(this.AxSession.AxaptaAdapter);
            objInfoLog.add(Proxy.Exception.Info, "Ordering list not selected");
        }
    }

Child page:
on any button click:
protected void SaveButton_Click(object sender, EventArgs e)
    {
 AXDialogArgs args = DialogHelper.DialogArgs;
       args.Data = QtyEdit.Text;
       DialogHelper.Close(CloseDialogBehavior.Auto);
//can use the below to refresh calling page.
       //DialogHelper.Close(CloseDialogBehavior.RefreshPage);

    }

No comments:

Update NuGet package to new MS D365FO version

1. Import the NuGet package files from LCS for that particular version please take the PU version files only. a. Goto LCS-->Asset Libra...