Monday 29 December 2014

ENABLE OR DISABLE THE ROWS IN GRID based On CHECKBOX

STEP 1:

Create a Table with Some Fields.Add all fields into FieldGroup except CheckBox Field.



STEP 2:

Creae a Form and add a table as Datasource.



STEP 3:

Drag and drop the Group and CheckBox Field into Design node.

STEP 4:

Write a code in CheckBox  Control level modified() method:

public boolean modified()
{
    boolean ret;

    EnableDisableRows enableDisableRows11;

    ret = super();

    if(this.value()==boolean::false)
    {
        Group1.enableChilds(true);
    }
    else
    {
        Group1.enableChilds(false);
    }

    return ret;
}

STEP 5:

We can get the output,,

 
 





 

Monday 22 December 2014

SET BACKGROUND COLOR FOR PARTICULAR RECORD

public void displayOption(Common _record, FormRowDisplayOption _options)
{
    if (_record.(fieldnum(Contributions,Year))=="2011")
    {
     _options.backColor(WinAPI::RGB2int(500,100,255));
    }
    else if(_record.(fieldnum(Contributions,Year))=="2014")
   {
     _options.backColor(WinAPI::RGB2int(101,100,255));
    }

    super(_record, _options);
}


 
BASED ON SALESID GET PRIMARY PHONE NUMBER AND ADDRESS

static void TestJob(Args _args)
{
str a; 
SalesTable salestable;
LogisticsLocation logisticslocation;
LogisticsElectronicAddress logisticsElectronicAddress;
LogisticsPostalAddress logisticsPostalAddress;
select salestable where salestable.salesid=='001731';
select logisticslocation where logisticslocation.ParentLocation ==LogisticsPostalAddress::findRecId(salestable.DeliveryPostalAddress).Location;
info(LogisticsElectronicAddress::findByLocation(logisticslocation.RecId).Description);  
info(LogisticsElectronicAddress::findByLocation(logisticslocation.RecId).Locator);
}

 
BASED ON CUSTOMER GET PRIMARY PHONE NUMBER AND ADDRESS

static void TestJOb(Args _args)
{
CustTable custTable;
DirPartyPostalAddressView  dirPartyPostalAddressView ;
LogisticsEntityLocationView  logisticsEntityLocationView ;
LogisticsLocation logisticsLocation ;
LogisticsElectronicAddress logisticsElectronicAddress;
str aa;
select custTable where custTable.AccountNum=="US-005";
info(custTable.address());
aa=custTable.address();
while  select dirPartyPostalAddressView
{
if(dirPartyPostalAddressView.Address==aa)
{
select logisticsEntityLocationView  where logisticsEntityLocationView.EntityLocation==dirPartyPostalAddressView.RecId;
select logisticsLocation where logisticsLocation.ParentLocation==logisticsEntityLocationView.Location;
select logisticsElectronicAddress where logisticsElectronicAddress.Location==logisticsLocation.RecId;
info(logisticsElectronicAddress.Description);
info(logisticsElectronicAddress.Locator);
}
}

}

 

Friday 19 December 2014


Passing Multiple Records from Form to Report

Step 1: Input Form: Create an Input Form as given Below this will act as first step.





Step 2: Button Clicked: Create a Button which will contain a clicked method which can help in transferring data(records) from form to reports.

void clicked()
{
CustTable    custTable1;
container    con;
Args            args;
str               multiSelectString;

ReportRun reportRun;

args = new Args();

while select custTable1 where custTable1.Checker==boolean::true
{

//Checker is our field

con = conIns(con,1, custTable1.AccountNum);

multiSelectString = con2Str(con, ',' );

}


args.parm(multiSelectString);

args.name(reportstr(ReportCusty_GV));

//ReportCusty_GV is Report Name.

reportRun = classFactory.reportRunClass(args);
reportRun.init();
reportRun.run();
}


Step 3: Create a Report with necessary designs.

Step 3.1: Init Method: Write the below mentioned code in init() method to get values from the form.


public void init()
{
str multipleRecords;

super();

multipleRecords = element.args().parm();
this.query().dataSourceTable(Tablenum(CustTable)).addRange(fieldNum(CustTable,AccountNum)).value(multipleRecords);


}
































EDIT AND DISPLAY METHODS IN AX 2012


EDIT METHOD:


Edit CustAccount custItemGroupId(boolean _set , CustAccount _custItemGroupId)
{
CustTable custTable;
;
if(_set)
{
if(_custItemGroupId)
{
ttsbegin;
custTable = CustTable::find(this.ID,true);
                                         // this mention our Table and ID is  our field
custTable.AccountNum = _custItemGroupId;
custTable.update();
ttscommit;
}
}
else
{
_custItemGroupId = CustTable::find(this.ID).AccountNum;
}
return _custItemGroupId;
}


DISPLAY METHOD


Display CustAccount custItemGroupId1 ()
{
CustTable custTable;
;
return CustTable::find(this.ID).AccountNum;
}

Monday 10 November 2014

Based on Barcode Populating Item Details Including Dimensions in TransferLine

Based on Barcode populate Item Details including Dimensions in TransferLine

Note:

The bar code for each item is available in the "InventItembarcode" table and refer this table to understand about "bar code".

Steps:

1.create a new field "barcode" in InventTransferTable table and drag and drop the field into table grid in the InvenTransferOrders form.




2.Craete the same field in InventTransferLine table also ,and drag and drop the field into table grid in the InvenTransferOrders form.

3.When we select a new barcode in the header table, All item details will be populated and the same will be inserted as new line in the transfer screen including all the dimensions like color, size and serial numbers.

It is possible to add multiple lines for the same transfer order [same item can also be inserted with different bar code]




4.If the selected bar code is already used by the same or any other transfer orders,
  then it should prompt an error with that existing transfer order number [Eg:"The bar code is already    exist in the Transfer order 000008"]



5.The bar code field in the header should be empty each time after the selection of bar code .

6.So write the code in the Modified() method of the barcode field in Datasourse "InventTransferTable"


public void modified()
{
    InventTransferTable _inventTransferTable;
    InventTransferLine line,line1;
    InventItemBarcode _InventItemBarcode;
    InventDim inventDim1;

    super();


         if(InventTransferTable.itemBarCode)

          {
                 if(InventTransferTable.validateWrite())

                   {
                     select _InventItemBarcode where                      _InventItemBarcode.itemBarCode==InventTransferTable.itemBarCode;

                           if(_InventItemBarcode)

                            {

                             line.initValue();

                             line.initFromInventTableModule(InventTableModule::find(line.ItemId,ModuleInventPurchSales::Invent));

                             line.initFromInventTransferTable(InventTransferTable,true);

                             line.itemBarCode=_InventItemBarcode.itemBarCode;

                             line.ItemId=_InventItemBarcode.itemId;

                             line.LineNum=InventTransferLine::lastLineNum(InventTransferLine.TransferId)+1.0;

                             select InventDim where InventDim.inventDimId==_InventItemBarcode.inventDimId;

                             line.InventDimId=InventDim.inventDimId;

                                               if(line.validateWrite())

                                                 {
                                                   select ItemBarCode from line1 where line1.itemBarCode==line.itemBarCode ;

                                                      if(!line1)
                                                        {
                                                            line.insert();
                                                        }
                                                      else
                                                        {
                                                           InventTransferTable.itemBarCode = " ";
                                                           select TransferId from line1 where line1.itemBarCode ==           line.itemBarCode;
                                                           throw error("Barcode Already Exist in Transfer Order"+"   "+ line1.TransferId);
                                                        }

                                                  }

                               }


                      }

              InventTransferTable.itemBarCode = " ";

              InventTransferLine_ds.executeQuery();


       }


}


Now you can run the form and get the output.....................................



Tuesday 21 October 2014

UPDATING THE PRODUCT ATTRIBUTE FOR PARTICULAR PRODUCT FROM EXCEL

By using job we update the product attributes for particular product in product information management module.

static void excelattribute(Args _args)
{
    SysExcelApplication application;
    SysExcelWorkbooks workbooks;
    SysExcelWorkbook workbook;
    SysExcelWorksheets worksheets;
    SysExcelWorksheet worksheet;
    SysExcelCells cells;
    COMVariantType type;
    FilenameOpen  filename;
    EcoResAttributeGroupAttribute ecoResAttributeGroupAttribute;
    EcoResProduct  ecoResProduct ;
    EcoResProductCategory ecoResProductCategory;
    EcoResCategory ecoResCategory;
    EcoResCategoryAttributeLookup ecoResCategoryAttributeLookup;
    EcoResAttribute ecoResAttribute;
    EcoResAttributeType ecoResAttributeType;


    int row ;                   // if the excel has the header
    str attribute ,attribute1;
    str attribute2;
       
    application = SysExcelApplication::construct();
    workbooks = application.workbooks();

    filename  = "C:\\Users\\charlie\\Desktop\\RamaProductAttribute.xlsx"; // file path
    try
    {
        workbooks.open(filename);
    }
    catch (Exception::Error)
    {
        throw error("File not found");
    }
    workbook = workbooks.item(1);
    worksheets = workbook.worksheets();
    worksheet = worksheets.itemFromNum(1);
    cells = worksheet.cells();

    //Iterate through cells and get the values
    do
    {
 
    //Incrementing the row line to next Row
      row++;

        attribute              = cells.item(row, 1).value().bStr();
        attribute1              = cells.item(row, 2).value().bStr();
        attribute2              = cells.item(row, 3).value().bStr();          
           
     
/*Insert ProductAttribute values*/

        select ecoResAttributeType;
        ecoResAttributeType.Name=attribute1;
       
        ecoResAttributeType.DataType=any2int(str2enum(AttributeDataType::Decimal,attribute2));
        ecoResAttributeType.insert();
        select ecoResAttribute;
        ecoResAttribute.Name=attribute;
        if(ecoResAttribute.AttributeType)
        ecoResAttribute.AttributeType=ecoResAttributeType.RecId;
        
        ecoResAttribute.insert();

/* assign above productAttributes to "0117" product*/

    select ecoResProduct join ecoResProductCategory join ecoResCategory join                                 

ecoResCategoryAttributeLookup join ecoResAttribute  join ecoResAttributeType  where 

ecoResProduct.DisplayProductNumber=="0117" && 

ecoResProductCategory.Product==ecoResProduct.RecId     && 

ecoResCategory.RecId==ecoResProductCategory.Category;

    if(ecoResCategoryAttributeLookup)

    ecoResCategoryAttributeLookup.Category=ecoResCategory.RecId;

    while   select Name from ecoResAttribute

     if(ecoResAttribute.Name==attribute)
       
    {

     ecoResCategoryAttributeLookup.Attribute=ecoResAttribute.RecId;
           
     while select Attribute from ecoResAttributeGroupAttribute
                 
      if(ecoResAttributeGroupAttribute.Attribute== ecoResCategoryAttributeLookup.Attribute)          
               
            ecoResCategoryAttributeLookup.AttributeGroupAttribute=ecoResAttributeGroupAttribute.RecId;
     
      ecoResCategoryAttributeLookup.insert();

       }

       while select ecoResAttribute where

       ecoResAttribute.RecId==ecoResCategoryAttributeLookup.Attribute

     //  if(ecoResAttribute.RecId==ecoResCategoryAttributeLookup.Attribute)
 
         {
   
         info(ecoResAttribute.Name);
     
         }


     // Loads the next row into the variant type and validating that its is empty or not
 
       type = cells.item(row+1, 1).value().variantType();
     
       }
   
       while (type != COMVariantType::VT_EMPTY);

     // quits the application
 
       application.quit();    


}

Here we should understand the table realtions.

1.EcoResProduct              

    // Here select the product to update product attribute

2.EcoResProductCategory    

 // EcoResProductCategory.product==EcoresProduct.RecId

3.EcoResCategory                

  // EcoResCategory .RecId==EcoResProductCategory.Category

4.EcoResCategoryAttributeLookup                                          

 // EcoResCategoryAttributeLookup.Category==EcoResCategory.RecId

5.EcoResAttribute            

  // EcoResAttribute.RecId==EcoResCategoryAttributeLookup.Attribute







Friday 3 October 2014

OPEN A WEBPAGE IN SINGLE LINE THROUGH X++

 We already seen,by using ActiveX Control to  open the web page,

 Now without using ActiveX control how will get webpage...


  static void WebPage(Args _args)
  {
  infoLog.urlLookup('http://www.google.co.in'); //name of the page                                                                                 you want to open.
  } 


Output window:


FINDING ALL DATASOURCE IN A FORM THROUGH JOB

Code for finding datasources in a form..

static void AllDataSourcesInForm(Args _args)

{
    Args args = new Args();
    
    FormRun fr;
    
    FormBuildDataSource formBuildDataSource;
  
    counter i;
   
    ;
  
    args.name("VendTable");   // its your FORM name
   
    fr = ClassFactory.formRunClass(args);
  
    for(i=1 ; i<=fr.form().dataSourceCount();i++)
  
    {
   
       formBuildDataSource = fr.form().dataSource(i);
    
       info(new DictTable(formBuildDataSource.table()).name());
  
     }
}



LISTVIEWCONTROL IN DYNAMICS AX.

By using ListViewControl We have to see some functions,

1.How to select multiple records and shown from ListViewControl.

2.In ListViewControl how  to transfer multiple records from one  to another.

3.Inside the ListViewControl how to make Up and Down arrow Actions for that records.


Function 1:

Select Multiple records and shown in the infolog.

Step 1:

Create a new form(ListViewControl) and add the control ListView under Design node.



Step 2:

Change the properties for that control is Autodeclaration -->yes and viewtype-->report.



Step 3:

Mention the columns for that ListViewControl by using Init() method in form level,

public void init()
{

super();

LeftListView.addColumn(1, new FormListColumn("Customer AccountNumber"));

//LeftListView is Control Name.

}

Step 4:

Get the records from Somewhere.(Here I want to show all customer's account number. so I am taking
 records from custTable).

public void run()
{
CustTable custTable;
;
super();

// Adding items to the list
while select AccountNum from custTable
{
LeftListView.add(custTable.AccountNum);
}
}

Step 5:
Add a new button and put name as "selected records".Under this button write clicked() method for getting selected records in the infolog.

void clicked()
{
FormListItem item;
int i;
;

super();
i = LeftListView.getNextItem(FormListNext::Selected);
while (i != -1)
{
item = LeftListView.getItem(i);
info (item.text());
i = LeftListView.getNextItem(FormListNext::Selected,i);
}
}


Step 6:

       Now we complete the first function.




Function 2:

In ListViewControl how  to transfer multiple records from one  to another.

we have to follow some steps,,

Step 1:

Similar to first function put one more ListViewControl under design node.Set name as RightListView button.change the property as Autodeclaration-->yes and viewtype-->Report.

Step 2:

Add a new button and set name as MoveButton. Under this write clicked() method for transfer records from one control to another ListView, At the same time the transfer records should delete from first ListViewControl.

void clicked()
{
FormListItem item;
int i;
;

super();
i = LeftListView.getNextItem(FormListNext::Selected);
while (i != -1)
{
item = LeftListView.getItem(i);
RightListView.addItem(item);                      //Add items 
LeftListView.delete(i);      // Delete the selected item  from the LeftListView            i = LeftListView.getNextItem(FormListNext::Selected);
}
}

Step 3:

Now we complete the second function.




Function 3:

Inside the ListViewControl how to make Up and Down arrow Actions for that records.

Step 1:

Add two more buttons in the form.Set name as "ÃœpButton" and "DownButton".Write the single line code for that buttons under clicked() method.

Code for move the item Upwards,

void clicked()
{
int i = LeftListView.getNextItem(FormListNext::Selected); 

LeftListView.moveItem(i, i-1);





Code for move the items Downwards,

void clicked()
{
int i = LeftListView.getNextItem(FormListNext::Selected); 

LeftListView.moveItem(i, i+1);





Step 2:

       We complete the third function also.



Friday 19 September 2014

OPEN A FORM FROM INFOLOG USING X++ CODE

We have to open a form for particular record from infolog using x++ code,

Here main class "SysInfoAction_tablefield" is used.

Write a job and get that task,

static void FormFromInfolog(Args _args)
{
    CustTable custTable;
    select  custTable where custTable.AccountNum == "US-001";
    info(strFmt("%1",custTable.AccountNum),"",SysInfoAction_tablefield::newBuffer(custTable));
}

Here i have given CustTable record and get that CustTable Form using "SysInfoAction_tablefield".

The output screen is,

                                 Once you click the Record in the infolog then only it shows the Show"" Button.




Main Form


CURRENCY CONVERTER USING X++ CODE

We have to convert the currency from "Some other country to US Dollar" in Job,

Here  "CurrencyExchangeHelper" is the Main class for convert the currency.

Then   CurrencyCode,  AmountCur, AmountMst  are EDT elements.

static void CurrencyConvertor(Args _args)
{
CurrencyExchangeHelper currencyExchangeHelper;
CurrencyCode transCurrency = "INR";
AmountCur amountCur = 500.00;
AmountMst amountMST;

currencyExchangeHelper = CurrencyExchangeHelper::newExchangeDate(Ledger::current(), systemDateGet());
amountMST = currencyExchangeHelper.calculateTransactionToAccounting(transCurrency, amountCur ,true);
info(strFmt("%1",amountMST));
}

The Output Screen is,


Now it converts INR  to US Dollar.If you change the INR into EUR then it converts the currency EUR into US Dollar.

CREATING A NEW FORM USING X++ CODE IN JOB

Here we want to create new form using x++ code in job,

Here all of the Form classes(Form,FormRun.......) are system Documentation classes.These are predefined classes.

static void CreateFormThroughCode(Args _args)
{
   Args                                      args;
    Form                                       form;
    FormRun                                formRun;
    FormBuildDesign                  formBuildDesign;
    FormBuildControl                 formBuildControl;
    FormBuildTabControl           formBuildTabControl;
    FormBuildTabPageControl   formBuildTabPageControl;
    FormBuildGridControl         formBuildGridControl;
    FormBuildDatasource           formBuildDatasource;
    FormBuildStringControl       formString;  


    form = new Form();
    formBuildDatasource             =  form.addDataSource(tableStr(PurchTable));
    formBuildDesign                    = form.addDesign("design");
    formBuildTabControl             = formBuildDesign.addControl(FormControlType::Tab, "Tab");
    formBuildTabPageControl     = formBuildTabControl.addControl(FormControlType::TabPage,    "TabPage");
    formBuildGridControl            = formBuildTabPageControl.addControl(FormControlType::Grid, "Grid");
    formString                              = formBuildGridControl.addDataField(formBuildDatasource.id(),  
                                                        fieldNum(PurchTable, PurchId));
    formString.label("PurchId");
    formString                             = formBuildGridControl.addControl(FormControlType::Real,   "Korcomptenz");
    formString.label("Korcomptenz");


    args  = new Args();
    args.object(form);
    formRun = classFactory.formRunClass(args);
    formRun.init();
    formRun.run();
    formRun.wait();
}

The output Screen is,


HIDE SELECTED ENUM VALUES IN FORM CONTROL USING X++

I referred the blog  axwiki.blogspot.in and get this idea,

Main task is Removing some of the elements from Enum value that are not needed. Example WeekDays is one of the Enum in AX. It shows name of 7 days in the Week. Here I want to show only 3 days. How I do,

By using one of the Ax class "SysFormEnumComboBox" we can get.

We want to follow some steps:

Step 1:

Create a new form . Add a ComboBox control under design node in the form.Then set the property of control EnumType --> Weekdays and  AutoDeclaration-->Yes.



Step 2:

Write the code in form level  init() method,

public void init()
{
    SysFormEnumComboBox     sysFormEnumComboBox;
    Set enumSet = new Set(Types::Enum); // collection of selected values.

    enumSet.add(WeekDays::Monday);
    enumSet.add(WeekDays::Wednesday);
    enumSet.add(WeekDays::Friday);

    SysFormEnumComboBox =                     SysFormEnumComboBox::newParameters(element,

        element.controlId(formControlStr(HideEnumValue, HideEnumValueControl)),  enumName2Id(enumStr(WeekDays)), enumSet);


 super();

}

SynTax for SysFormEnumComboBox  is,

SysFormEnumComboBox::newParameters(FormRun _FormRun, ComBocontrolId,EnumId,set);

So  here,

HideEnumValue-->FormName
HideEnumValueControl-->ComBoxControlName
WeekDays-->BaseEnum
enumset-->Variable of Set.

The output Screen is,



RETRIEVING MULTIPLE SELECTED RECORDS FROM GRID USING X++.

We want to follow some steps....

Step 1:

Create a new Table(Multiselecttable).Add the fields lilke Name,IdNumber.



Step 2:

Insert some records into the Table.

Step 3:

Create a new Form(MultiSelectForm) and Add the table as a datasource  into the Form.

Step 4:

Drag and Drop the fields into Grid under design node.

Step 5:

Create new Button(MultiSelectButton).Add the clicked() method under this Button.



Step 6:

Set the Property for Button Autodeclaration -->Yes and MultiSelect-->Yes.



Step 7:

Write the code for selecting multiple records.

void clicked()
{

    int             recordsCount;
    MultiSelectTable multiSelectTable1;
    super();

    recordsCount = MultiSelectTable_ds.recordsMarked().lastIndex();  // Total number of marked records.
  
  multiSelectTable1 = MultiSelectTable_ds.getFirst(1);

    while (multiSelectTable1)
    {
        info(multiSelectTable1.Name +" " +strFmt("%1",multiSelectTable1.Idnumber));
        multiSelectTable1 = MultiSelectTable_ds.getNext();
    }
}





Monday 15 September 2014

HOW TO DISPLAY GOOGLE WEBPAGE IN AX 2012

Now we are going to Discussing about display google webpage in ax 2012.I referred the blog axguruu.blogspot.in and got this ideas.

we have to follow some steps....

Step 1:

Create one form (GooglepageForm)

Step 2:

Under the Design node right click select Activex control.



Step 3:

After selecting this control we get one dialog box here select "Microsoft web browser" option.



Step 4:

After write the Init() method in form level.
public void init()
{
super();
Activex.Navigate("www.google.com");
}

Step 5:

We get the output,,,


Friday 12 September 2014

Import Records from CSV file for Particular TransferOrder in Inventory management module.

           Its similar to previous post but here we don't have any Menuitembutton and here we use main form(inventory module
  -->Transfers order).
              By using X++ code we generate New transfer order and Import items for that Transfor order from CSV file automatically.

Follow this Link you get more ideas and proper code,

Thursday 11 September 2014

Import records from CSV file to Ax for particular Transfer order by using MenuItemButton.


We have to follow some steps:-

Step 1:

Create a Table(ImportOption) with some fields.TransferId is one of the field which is mandatory.



Step 2:

Create a relation for TransferId with InventTransferTable.Set the Relation properties as follows..



Step 3:

Add Table as datasource into form(ImportOption).drag and drop the fields into design node.



Step 4:

Now add the form into Menuitem-->display node in AOT.

Step 5:

Create an Excel file with records which we need to import into ImportOption table.

Step 6:

Convert the excel file into CSV file(file-->save as-->Filename-->Book1-->Type-->CSV (comma delimited).



Step 7:

Create the MenuItemButton in the Action pane of the InventTransferOrder (or) CopyofinventTransferOrder form.



Step 8:

Now set the property menuItemName for that menuitembutton is ImportOption.



Step 9:

Under the menuitembutton write the clicked() method with following code,

void clicked()
{
Dialog dialog;
DialogField dialogFileName;
SysOperationProgress simpleProgress;
Filename filename;
FileIOPermission permission;
TextIO textIO;
ImportOption importOption;
InventTransferTable iinventTransferTable;


str itemname,transferid;

real qty;

str s11;
int i;
Container c1,c2;
CompanyInfo companyInfoLoc = CompanyInfo::find();
Container filterCriteria;
#File
#avifiles
super();

dialog = new Dialog("Importing Text File");
dialogFileName = dialog.addField(extendedTypeStr(Filenameopen), "File Name");
filterCriteria = ['*.txt'];
filterCriteria = dialog.filenameLookupFilter(filterCriteria);
dialog.run();
if (dialog.run())
filename = dialogFileName.value();
if(!filename)
{
info("Filename must be filled");

}
permission = new fileIOpermission(filename,#io_read);
permission.assert();
textIO = new TextIO(filename,#io_read);
textIO.inFieldDelimiter(',');///Change the Delimeter if it is , or ; etc
simpleProgress = SysOperationProgress::newGeneral(#aviUpdate, 'Importing data',100);
if(textIO)
{
while(textIO.status() == IO_Status::Ok)
{
c1 = textIO.read();
s11 = conpeek(c1,3);
if(strlen(s11) > 1)
{
select importOption ;
importOption.Qty=conPeek(c1,1);
importOption.ItemName=conPeek(c1,2);
importOption.TransferIdentity=conPeek(c1,3);
importOption.insert();
i++;
simpleProgress.incCount();
simpleprogress.setText(strfmt("Lines imported: %1", i));
sleep(10);
}
}
}
}

Step 10:

This code used to import records from csv file.

If you want to modify records in csv files then right click the csv file-->open with -->notepad.Here change the records and save it.




Finally We get the output....