Code: Select all
using (dynamic order = os.NewOrder(orderSpec))
{
.......
IOrder o = order;
dynamic spNote = o.CreateNew("Note");
spNote.Text = "Howdy123";
spNote.IsInternal = true;
order.Notes.Add(spNote);
os.ApplyChanges(order);
and if yes, is this (below code) the right way to get & set an identity?
Code: Select all
ISecurityManager securityManager = (ISecurityManager)o.GetService(typeof(ISecurityManager));
string username = "Hari Katukuri";
ISecurityIdentity identity = securityManager.Identities.Where(i => !i.IsGroup && i.Enabled && !i.Deleted && !i.IsSystem && i.FullName == username).FirstOrDefault();
if (identity != null)
{
//ISecurityUser user = securityManager.GetUser(identity.ID);
spNote.CreatedBy = identity;
}