Hi Raman,
i tried but it will be not working,i wrote code below like:\
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using Microsoft.Dynamics.BusinessConnectorNet;
namespace SampleInventory
{
///
/// Summary description for Service1
///
[WebService(Namespace = “http://tempuri.org/”)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class Service1 : System.Web.Services.WebService
{
Axapta ax;
[WebMethod]
public string CrateInventory(String accountID, String name, String bankGroupId, String currencyCode, String registrationNum, String ledgerAccount, String accountNum, String sWIFTNo,
String companyPaymId, String iBAN, String address, String street, String zipCode, String city, String county, String state, String countryRegionId)
{
try
{
ax = new Axapta();
ax.Logon(“CEU”, “en-us”, “”, “”);
AxaptaRecord axRecord;
String tableName = “BankAccountTable”;
using (axRecord = ax.CreateAxaptaRecord(tableName))
{
axRecord.InitValue();
axRecord.set_Field(“AccountID”, accountID);
axRecord.set_Field(“Name”, name);
axRecord.set_Field(“BankGroupId”, bankGroupId);
axRecord.set_Field(“CurrencyCode”, currencyCode);
axRecord.set_Field(“RegistrationNum”, registrationNum);
axRecord.set_Field(“LedgerAccount”, ledgerAccount);
axRecord.set_Field(“AccountNum”, accountNum);
axRecord.set_Field(“SWIFTNo”, sWIFTNo);
axRecord.set_Field(“CompanyPaymId”, companyPaymId);
axRecord.set_Field(“IBAN”, iBAN);
axRecord.set_Field(“Address”, address);
axRecord.set_Field(“Street”, street);
axRecord.set_Field(“ZipCode”, zipCode);
axRecord.set_Field(“City”, city);
axRecord.set_Field(“County”, county);
axRecord.set_Field(“State”, state);
axRecord.set_Field(“CountryRegionId”, countryRegionId);
axRecord.set_Field(“BankCodeType”,“BL”); // this one is enumtype
//axRecord.set_Field(“BankCodeType”, bankCodeType);
axRecord.Insert();
}
}
catch (Exception e)
{
Console.WriteLine(“Error encountered :{0}”, e.Message);
}
return “Created”;
}
}
}
when i started debug,goto the service,i entered all values,after that ,i checked in ax 2009 bankaccounttable,but the record not inserted,
when i remove the enum field it will be displayed the record