hi all,
i have created a service in ax 2012 with table name “retail pos batch table”,after deploying this service i have taken the URI from INboundport and and i am adding it in service referencenin visual stuido.
now from visual studio i want to insert data in AX “retailposbatch table” using this service reference.
the following is the code:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Globalization;
using
System.Collections;
using
Ret_PosBatch.ServiceReference1;
using
System.Xml.Linq;
namespace
Ret_PosBatch
{
class Program
{
static void Main(string[] args)
{
RtlPosBatTabServiceClient client = new RtlPosBatTabServiceClient();
AxdEntity_RBOPosBatchTable_1 retpos = new AxdEntity_RBOPosBatchTable_1();
AxdRtlPosBatTab query = new AxdRtlPosBatTab();
CallContext call = new CallContext();
call.Company =
“CERW”;
call.Language =
“en-us”;
EntityKey[] keys;
EntityKeykey;
//KeyField fld;
retpos.BatchID = 7;
retpos.BatchIDSpecified =
true;
retpos.StoreId =
“AW-SEATTLE”;
retpos.TerminalId =
“007000”;
query.RBOPosBatchTable_1 =
new AxdEntity_RBOPosBatchTable_1[1] { retpos };
try
{
keys = client.create(call, query);
key = (
EntityKey)keys.GetValue(0);
Console.WriteLine(“Created successfully”+ key.KeyData[0].Value);}
catch (Exception ex)
{
Console.WriteLine(“error” + ex.Message);
}
Console.ReadKey();
}
}
}
after running this i am getting an error saying “ERROR CREATION HAS BEEN CANCELLED”
SO,i request you all to help me on this.will be waiting for your reply.
thanks,
ankush