Dear Team,
The below code is in script task .Using "Terrasoft.OrderDirection.DESC" in the below code i getting errors.Please tell me how to get the order by column desc.
var fileId = Get("FileId");
var toaddress= Get("toAddress");
Stream FileA = null;
string Fname = "";
var entitySchemaManager = UserConnection.EntitySchemaManager;
var entitySchemaQuery = new EntitySchemaQuery(entitySchemaManager, "UsrOfferManagerFile");
var fileDataColumnName = entitySchemaQuery.AddColumn("Data").Name;
var fileName = entitySchemaQuery.AddColumn("Name").Name;
entitySchemaQuery.Filters.Add(entitySchemaQuery.CreateFilterWithParameters(FilterComparisonType.Equal,"UsrOfferManager", fileId));
var collection = entitySchemaQuery.GetEntityCollection(UserConnection);
foreach(var ent in collection) {
FileA = ent.GetStreamValue("Data");
Fname = ent.GetTypedColumnValue("Name");
break;
}
try {
MailMessage mail = new MailMessage();
mail.From = new MailAddress("rpocomm@tmie2e.com");
mail.To.Add(new MailAddress(toaddress));
mail.Bcc.Add(new MailAddress("chandanak@tmie2e.com"));
mail.Subject = "Offer Letter";
//mail.Body = body;
mail.IsBodyHtml = true;
SmtpClient client = new SmtpClient();
client.Host = "210.18.64.237";
client.Port = 6676;
if (FileA != null)
{
mail.Attachments.Add(new System.Net.Mail.Attachment(FileA, Fname));
}
client.EnableSsl = false;
client.Credentials = new NetworkCredential("rpocomm","rpocomm#2018");
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Send(mail);
mail.Dispose();
}
catch(Exception e) {
throw new Exception("Mail.Send: " + e.Message);
}
return true;
Regards,
Sekhar.
Like
Terrasoft.OrderDirection.DESC is used for ordering records only in the client esq. The issue occurs because in script task the server esq is used. Please find the example of ordering records in the server esq in the article by the link below:
https://community.creatio.com/articles/how-sort-records-date-modification-entityschemaquery