Hello everyone. Im fairly new to programming and everything around it and I cant break a "wall" to continue. Code so far:
xml:
<contacts>
<contact>
<firstname>f1</firstname>
<lastname>l1</lastname>
<email>f1@email.com</email>
<customer type="Lookup" entityType="account" searchField="name" allowCreate="true">
<name>company1</name>
<street>street1</street>
<city>city1</city>
</customer>
</contact>
<contact>
<firstname>f2</firstname>
<lastname>l2</lastname>
<email>f2@email.com</email>
<customer type="Lookup" entityType="account" searchField="name" allowCreate="false">
<name>company2</name>
</customer>
</contact>
</contacts>
note: company 2 exists in crm already.
{
class Program
{
static void Main(string[] args)
{
CrmServiceClient crmConn = new CrmServiceClient(ConfigurationManager.ConnectionStrings["CRM"].ConnectionString);
IOrganizationService crmService = crmConn.OrganizationServiceProxy;
string[] info = new string[] { "firstname", "lastname", "emailaddress1" };
int i = 0;
{
while (reader.Read())
{
if (reader.IsStartElement())
{
switch (reader.Name.ToString())
{
case "firstname":
con[info[i]] = reader.ReadString();
i++;
break;
case "lastname":
con[info[i]] = reader.ReadString();
i++;
break;
case "email":
con[info[i]] = reader.ReadString();
i = 0;
crmService.Create(con);
break;
}
}
}
}
}
}
}
*This post is locked for comments