Hi guys,
I have created a web form using visual studio 2010 and getting the customer id in the listbox1 by using one button in the form and based on the value selected the customer name will be showed in the second list box2 by using a servicegroup from ax 2012.
Upto this this was working well and good for me.
Now now I have created my own datacontract class and tried to get the custname,Custgroupid,defaultlanguageid in the form and updated that service group and deployed it again.
In my visual studio also i updated the service reference and wrote the logic for the third button and looks good.
But i am getting error in the code of the second button.
private void button2_Click(object sender, EventArgs e)
{
BkCustomAXservice.BKCustomserviceClient servclient = new BkCustomAXservice.BKCustomserviceClient();
string[] strItem = null;
int i = 0;
strItem = new string[listBox1.SelectedItems.Count];
//Get selected customer ids and prepare a string array
foreach (Object selecteditem in listBox1.SelectedItems)
{
string item = selecteditem as string;
strItem[i++] = item;
}
//Use the string array to get the “Customer Id: Customer Name” Combo data
string[] custIds = servclient.retrivecustomernames(new BkCustomAXservice.CallContext(), strItem);
//string[] custIds = servclient.retrivecustomernames(new BkCustomAXservice.CallContext(), strItem);
listBox2.Items.Clear();
foreach (string custId in custIds)
listBox2.Items.Add(custId);
}
But i am getting error in the below line,
string[] custIds = servclient.retrivecustomernames(new BkCustomAXservice.CallContext(), strItem);
Error 1 Cannot implicitly convert type 'WindowsFormsApplication1.BkCustomAXservice.BKCustomservicecontract[]' to 'string[]' c:\users\bharathk\documents\visual studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs 52 24 WindowsFormsApplication1
Please advise.
Regards,
AxTechie 2120