Hello,
I have developed one service which inserts contact and contact-address from the third party to bpm'online. I have written below code to add contact and its Address simultaneously:
var insertContactQuery = new InsertQuery()
{
// Root schema name.
RootSchemaName = "Contact",
OperationType = QueryOperationType.Insert,
// New column values.
ColumnValues = new ColumnValues()
{
// Key-value collection.
Items = new Dictionary()
{
{
"Account",
new ColumnExpression()
{
ExpressionType = EntitySchemaQueryExpressionType.Parameter,
ColumnPath = "Account",
Parameter = new Terrasoft.Nui.ServiceModel.DataContract.Parameter()
{
Value = item.AccountId,
DataValueType = DataValueType.Lookup
}
}
},
{
"Name",
new ColumnExpression()
{
ExpressionType = EntitySchemaQueryExpressionType.Parameter,
ColumnPath = "Name",
Parameter = new Terrasoft.Nui.ServiceModel.DataContract.Parameter()
{
Value = item.StoreContactFirstName + " " + item.StoreContactLastName,
DataValueType = DataValueType.Text
}
}
},
{
"MobilePhone",
new ColumnExpression()
{
ExpressionType = EntitySchemaQueryExpressionType.Parameter,
ColumnPath = "MobilePhone",
Parameter = new Terrasoft.Nui.ServiceModel.DataContract.Parameter()
{
Value = item.StorePhoneNumber,
DataValueType = DataValueType.Text
}
}
},
{
"ContactAddress",
new ColumnExpression()
{
ExpressionType = EntitySchemaQueryExpressionType.Parameter,
ColumnPath = "Address",
Parameter = new Terrasoft.Nui.ServiceModel.DataContract.Parameter()
{
Value = item.StoreStreetAddress,
DataValueType = DataValueType.Text
}
}
},
{
"ContactCity",
new ColumnExpression()
{
ExpressionType = EntitySchemaQueryExpressionType.Parameter,
ColumnPath = "City",
Parameter = new Terrasoft.Nui.ServiceModel.DataContract.Parameter()
{
Value = item.StoreCityName,
DataValueType = DataValueType.Text
}
}
},
{
"ContactZip",
new ColumnExpression()
{
ExpressionType = EntitySchemaQueryExpressionType.Parameter,
ColumnPath = "Zip",
Parameter = new Terrasoft.Nui.ServiceModel.DataContract.Parameter()
{
Value = item.StoreZipCode,
DataValueType = DataValueType.Text
}
}
}
}
}
};
am I doing something wrong? Please guide.