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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to insert the Grid records using form method which is implementing interface?

(0) ShareShare
ReportReport
Posted on by 110

Hi, I am creating a wizard for which I made a wizard class, in which I am inserting the data in next() method by calling a method of my Interface. My Wizard form is implementing that interface. Now I have a grid control on this wizard, how will I insert the grid lines to my required table.

interface XYZ_IWizard
{


public void insertDetails()
{
}

public void insertGridLines()
{
}

}

class XYZ_DemoWizard extends SysWizard
{   

    XYZ_IWizard       wizardInterface;

      .....................................  

      public void next()
      {


        wizardInterface = this.formRun() as wizardInterface;

   
        wizardInterface.insertDetails();
        wizardInterface.insertGridLines();        

        }

    .....................................

}

[Form]
public class XYZ_DemoWizard extends FormRun implements XYZ_IWizard
{

     ........................................................

     public void insertDetails()
     {

        .....................................

      }

      public void insertGridLines()

      {

       

      } 

     ......................................................

}

I have the same question (0)
  • Verified answer
    huijij Profile Picture
    19,811 on at

    Hi Muhammad,

    Please check the SQL statements to insert one or more rows into tables that are stored in the database to see if it is what you look for:

    docs.microsoft.com/.../xpp-insert

  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    You're focusing on a wrong thing. You never insert lines to the grid controls. You insert data to a table that is used as data source of the form. A grid is just one of possible form controls for displaying data from the table. Therefore even the method name looks wrong.

    If you want to insert data to a table, set its fields and then call insert() method. You also typically want to call validateWrite() to check correctness of data.

    For example:

    MyTable myTable;
    myTable.MyField = "test";
    myTable.insert();

    If you use a temporary table, you must either use the table buffer automatically created for the data source, or you need to link another buffer to it (with setTmpData() or linkPhysicalTableInstance(), depending on the type of the temporary table).

    By the way, please use Insert > Code (in the rich formatting view) to paste source code here.

  •  Muhammad Bilal 17 Profile Picture
    110 on at

    Hi Judy,

    how will I get the datasource fields? My datasource name is XYZ_Tag

  • Verified answer
    Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    You'll use the table, not the data source, to set fields. See my example above. If you need more help, please tell us whether your table is temporary or not. As I mentioned, it makes a difference.

    Only when you inserted data to the table, you'll need the form data source, because you'll need to load the data. User XYZ_Tag_ds.research().

  •  Muhammad Bilal 17 Profile Picture
    110 on at

    Thanks, Martin for your valuable input.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans