Hi all,
I am trying to insert a record to an entity using esq as follows in my web service.
[OperationContract]
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
ResponseFormat = WebMessageFormat.Json)]
public string InsertCaseESQPostForSATS(DebitCardDataForSATS debitCardData)
{
try
{
var caseSchema = SystemUserConnection.EntitySchemaManager.GetInstanceByName("SBLSRM");
var entity = caseSchema.CreateEntity(SystemUserConnection);
entity.SetColumnValue("SBLAccountNumber", debitCardData.AccountNo);
entity.SetColumnValue("SBLService", debitCardData.ServiceId);
entity.SetDefColumnValues();
var result = entity.Save();
return result.ToString();
}
catch(Exception ex)
{
return ex.Message;
}
}
Column 'SBLService' is a lookup column and I am having problem while inserting a record, says, "Value 'SBLService' was not found.". I have checked and confirmed that the object has the column and is published fine. Can somebody assist me on this? How can I set value for a lookup column?