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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

save asp.net control value to ax 2012 table from EP

(0) ShareShare
ReportReport
Posted on by 259

Is it possible to save the asp.net control value to ax 2012 directly without using any axboundfields

I have a requirement for selecting Hijri date using calender widget ,widget only works on asp.net textbox only

this textbox I cant use inside the axboundfield. I need to save the selected date to respective field in ax table.

is there any workaround for this scenario.

Thanks in advance.

Regards

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Rodolfo Recalde Profile Picture
    on at
    RE: save asp.net control value to ax 2012 table from EP

    Hi Badduke,

    You can use DataSetViewRow.

    The method  SetFieldValue([YourField], [DateValueWidget])  you can assign value to the current line.

    Depending on your page scenario, you will have to use to save the dataset control (no need to use BeginEdit()/EndEdit()). This code below is a way for you to recover the DataSetViewRow.

    ***

    The following code edits the current row in the HcmWorkerDS data source. The value of the PersonnelNumber field is set, and then the changes to the row are saved.

    ***

    using Microsoft.Dynamics.AX.Framework.Portal.Data;

    DataSetViewRow row;
    
    try
    {
        // Retrieve the current row.
        row = HcmWorkerDS.GetDataSet().DataSetViews["HcmWorker"].GetCurrent();
    
        // Edit the row and change the PersonnelNumber value.
        row.BeginEdit();
        row.SetFieldValue("PersonnelNumber", "987");
        row.EndEdit();
    }
    catch (System.Exception ex)
    {
        AxExceptionCategory exceptionCategory;
    
        // Determine whether the exception can be handled.
        if (AxControlExceptionHandler.TryHandleException(this, ex, out exceptionCategory) == false)
        {
            // The exception was fatal and cannot be handled. Rethrow it.
            throw;
        }
    }

    ***

    Take a look:

    Microsoft Dynamics AX 2012 White Paper: Enterprise Portal Development Cookbook

    https://www.microsoft.com/en-us/download/details.aspx?id=30171

    I Hope this Helps!

    Regards,

    Rodolfo Recalde.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#3
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans