Search Results for

    Show / Hide Table of Contents

    Class TriggerContext

    The context class that holds all the changes that triggered a IActionTriggerGate

    Inheritance
    System.Object
    StandardFunctions
    FormulaFunctions
    FormulaFunctionsWithContext
    TriggerContext
    Implements
    IFormulaFunctionsWithContextItem
    IFormulaFunctions
    Inherited Members
    FormulaFunctionsWithContext.Item
    FormulaFunctionsWithContext.ItemAs<T>()
    FormulaFunctionsWithContext.GetValue<T>(String)
    FormulaFunctionsWithContext.Create(IEntityRetriever, IReadOnlyCache, UserInfo, Object)
    FormulaFunctionsWithContext.GetContextType(EntityDescriptor)
    FormulaFunctions.Data
    FormulaFunctions.Cache
    FormulaFunctions.User
    FormulaFunctions.GetContextItemType(Object)
    FormulaFunctions.GetItemPropertyValue(Object, String)
    FormulaFunctions.GetItemFromDataSourceID(String, String)
    FormulaFunctions.GetItemFromDataSourceID(String, String, String)
    FormulaFunctions.GetItem(String, Guid)
    FormulaFunctions.RunQuery(String, String, String[])
    FormulaFunctions.GetQueryItems(String, String, String, String)
    StandardFunctions.FormatAsString(Object)
    StandardFunctions.Null()
    StandardFunctions.IsNull(Object)
    StandardFunctions.Not(Boolean)
    StandardFunctions.Or(Boolean, Boolean)
    StandardFunctions.And(Boolean, Boolean)
    StandardFunctions.Sin(Double)
    StandardFunctions.Cos(Double)
    StandardFunctions.Now()
    StandardFunctions.Today()
    StandardFunctions.TodayString()
    StandardFunctions.EndOfMonth(DateTime)
    StandardFunctions.BeginningOfMonth(DateTime)
    StandardFunctions.BeginningOfWeek(DateTime)
    StandardFunctions.EndOfYear(DateTime)
    StandardFunctions.EndOfDay(DateTime)
    StandardFunctions.Floor(Decimal)
    StandardFunctions.Ceiling(Decimal)
    StandardFunctions.BeginningOfYear(DateTime)
    StandardFunctions.BeginningOfDay(DateTime)
    StandardFunctions.Random(Int32, Int32)
    StandardFunctions.Trim(String)
    StandardFunctions.TrimStart(String, Char[])
    StandardFunctions.TrimEnd(String, Char[])
    StandardFunctions.PadLeft(String, Int32, Char)
    StandardFunctions.PadRight(String, Int32, Char)
    StandardFunctions.Mod(Double, Double)
    StandardFunctions.If(Boolean, Object, Object)
    StandardFunctions.IsIn(Object, Object)
    StandardFunctions.IsIn(Object, Object, Object)
    StandardFunctions.IsIn(Object, Object, Object, Object)
    StandardFunctions.IsIn(Object, Object, Object, Object, Object)
    StandardFunctions.IsIn(Object, Object, Object, Object, Object, Object)
    StandardFunctions.IsIn(Object, Object, Object, Object, Object, Object, Object)
    StandardFunctions.IsIn(Object, Object, Object, Object, Object, Object, Object, Object)
    StandardFunctions.IsIn(Object, Object, Object, Object, Object, Object, Object, Object, Object)
    StandardFunctions.IsIn(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)
    StandardFunctions.IsIn(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)
    StandardFunctions.SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)
    StandardFunctions.SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)
    StandardFunctions.SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)
    StandardFunctions.SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)
    StandardFunctions.SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)
    StandardFunctions.SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)
    StandardFunctions.SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)
    StandardFunctions.SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)
    StandardFunctions.SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)
    StandardFunctions.SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)
    StandardFunctions.Format(Object, String)
    StandardFunctions.Lower(String)
    StandardFunctions.Upper(String)
    StandardFunctions.WCase(String)
    StandardFunctions.Date(Int32, Int32, Int32)
    StandardFunctions.Year(DateTime)
    StandardFunctions.Month(DateTime)
    StandardFunctions.Day(DateTime)
    StandardFunctions.WeekDay(DateTime)
    StandardFunctions.Replace(String, String, String)
    StandardFunctions.Substr(String, Int32, Int32)
    StandardFunctions.Len(String)
    StandardFunctions.Abs(Double)
    StandardFunctions.Int(Object)
    StandardFunctions.Trunc(Double, Int32)
    StandardFunctions.Dec(Object)
    StandardFunctions.Round(Object)
    StandardFunctions.IsBlank(String)
    StandardFunctions.Round(Object, Int32)
    StandardFunctions.Min(Double, Double, Double, Double, Double)
    StandardFunctions.Max(Double, Double, Double, Double, Double)
    StandardFunctions.Chr(Int32)
    StandardFunctions.ChCR()
    StandardFunctions.ChLF()
    StandardFunctions.ChCRLF()
    StandardFunctions.Money(Object)
    StandardFunctions.Contains(String, String)
    StandardFunctions.FormatDate(DateTime, String)
    StandardFunctions.Sqrt(Double)
    StandardFunctions.Power(Double, Double)
    StandardFunctions.ValString(Object)
    StandardFunctions.ValBool(Object)
    StandardFunctions.ValDate(Object)
    StandardFunctions.ValDecimal(Object)
    StandardFunctions.ValLong(Object)
    StandardFunctions.ValID(Object)
    StandardFunctions.DateAdd(DateTime, Decimal, Decimal, Decimal)
    StandardFunctions.DateAddWorkDays(DateTime, Decimal)
    StandardFunctions.DateAdd(DateTime, DateTime)
    StandardFunctions.DayDifference(DateTime, DateTime)
    StandardFunctions.DayDifferenceWorkDays(DateTime, DateTime)
    StandardFunctions.HourDifference(DateTime, DateTime)
    StandardFunctions.MinuteDifference(DateTime, DateTime)
    StandardFunctions.YearDifference(DateTime, DateTime)
    StandardFunctions.NullDate()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: LemonEdge.API.Tasks.Parameters.Triggers
    Assembly: API.dll
    Syntax
    public class TriggerContext : FormulaFunctionsWithContext, IFormulaFunctionsWithContextItem, IFormulaFunctions

    Constructors

    TriggerContext(IEntityRetriever, IReadOnlyCache, UserInfo, IBaseEntity)

    Creates a new trigger context holding the information for the items that triggered a IActionTriggerGate

    Declaration
    public TriggerContext(IEntityRetriever retriever, IReadOnlyCache cache, UserInfo user, IBaseEntity item)
    Parameters
    Type Name Description
    IEntityRetriever retriever

    A context for querying all the data in the syste,

    IReadOnlyCache cache

    A local cache

    UserInfo user

    The current logged in user

    IBaseEntity item

    The item in the system that this trigger is being activated by

    Properties

    IsActionMatch

    Holds the custom action string from the parameters

    Declaration
    public string IsActionMatch { get; }
    Property Value
    Type Description
    System.String

    IsDeleted

    Indicates the triggered item was deleted as it has no current item, and only has a previous item

    Declaration
    public bool IsDeleted { get; }
    Property Value
    Type Description
    System.Boolean

    IsNew

    Indicates the triggered item is new, as it has no older version

    Declaration
    public bool IsNew { get; }
    Property Value
    Type Description
    System.Boolean

    IsUpdated

    Indicates the triggered item is not new, as it has an older version

    Declaration
    public bool IsUpdated { get; }
    Property Value
    Type Description
    System.Boolean

    NotifyItem

    The main item (of type EntityTypeID) that notifies the action to be triggered.

    Linked to through a relationship of the gate via ActionItemProperty

    Declaration
    public object NotifyItem { get; }
    Property Value
    Type Description
    System.Object

    NotifyOldItem

    The previous version of the notification item. Will be null if the notification item is new

    Declaration
    public object NotifyOldItem { get; }
    Property Value
    Type Description
    System.Object

    OldItem

    The previous version of the triggered Item. Will be null if the item is new, indicated with IsNew

    Declaration
    public object OldItem { get; }
    Property Value
    Type Description
    System.Object

    Trigger

    The parent action trigger that would be triggered by this context

    Declaration
    public IActionTrigger Trigger { get; }
    Property Value
    Type Description
    IActionTrigger

    Methods

    GetNotifyOldValue(String)

    Returns the old value of the specified property of the NotifyItem. Returns the previous version if it exists, else returns the current value if the item is new

    Declaration
    public object GetNotifyOldValue(string propName)
    Parameters
    Type Name Description
    System.String propName

    The name of the property value to return from the item

    Returns
    Type Description
    System.Object

    The old value of the specified property of the NotifyItem. Returns the previous version if it exists, else returns the current value if the item is new

    GetNotifyOldValue<T>(String)

    Returns the old value of the specified property of the NotifyItem. Returns the previous version if it exists, else returns the current value if the item is new

    Declaration
    public T GetNotifyOldValue<T>(string propName)
    Parameters
    Type Name Description
    System.String propName

    The name of the property value to return from the item

    Returns
    Type Description
    T

    The old value of the specified property of the NotifyItem. Returns the previous version if it exists, else returns the current value if the item is new

    Type Parameters
    Name Description
    T

    The type of the specified property value

    GetNotifyValue(String)

    Returns the value of the specified property of the NotifyItem. Returns the latest version if it exists, else returns the previous value if the item was deleted

    Declaration
    public object GetNotifyValue(string propName)
    Parameters
    Type Name Description
    System.String propName

    The name of the property value to return from the item

    Returns
    Type Description
    System.Object

    The value of the specified property of the NotifyItem. Returns the latest version if it exists, else returns the previous value if the item was deleted

    GetNotifyValue<T>(String)

    Returns the value of the specified property of the NotifyItem. Returns the latest version if it exists, else returns the previous value if the item was deleted

    Declaration
    public T GetNotifyValue<T>(string propName)
    Parameters
    Type Name Description
    System.String propName

    The name of the property value to return from the item

    Returns
    Type Description
    T

    The value of the specified property of the NotifyItem. Returns the latest version if it exists, else returns the previous value if the item was deleted

    Type Parameters
    Name Description
    T

    The type of the specified property value

    GetOldValue(String)

    Returns the old value of the specified property of the Item. Returns the previous version if it exists, else returns the current value if the item is new

    Declaration
    public object GetOldValue(string propName)
    Parameters
    Type Name Description
    System.String propName

    The name of the property value to return from the item

    Returns
    Type Description
    System.Object

    The old value of the specified property of the Item. Returns the previous version if it exists, else returns the current value if the item is new

    GetOldValue<T>(String)

    Returns the old value of the specified property of the Item. Returns the previous version if it exists, else returns the current value if the item is new

    Declaration
    public T GetOldValue<T>(string propName)
    Parameters
    Type Name Description
    System.String propName

    The name of the property value to return from the item

    Returns
    Type Description
    T

    The old value of the specified property of the Item. Returns the previous version if it exists, else returns the current value if the item is new

    Type Parameters
    Name Description
    T

    The type of the specified property value

    GetValue(String)

    Returns the value of the specified property of the Item. Returns the latest version if it exists, else returns the previous value if the item was deleted

    Declaration
    public override object GetValue(string propName)
    Parameters
    Type Name Description
    System.String propName

    The name of the property value to return from the item

    Returns
    Type Description
    System.Object

    The value of the specified property of the Item. Returns the latest version if it exists, else returns the previous value if the item was deleted

    Overrides
    FormulaFunctionsWithContext.GetValue(String)

    HasNotifyValueChanged(String)

    Returns true if the value of the specified property has changed from the previous version to the current version of the NotifyItem and NotifyOldItem

    Declaration
    public bool HasNotifyValueChanged(string propName)
    Parameters
    Type Name Description
    System.String propName

    The name of the property value to see if it has changed between versions

    Returns
    Type Description
    System.Boolean

    True if the value of the specified property has changed from the previous version to the current version

    HasValueChanged(String)

    Returns true if the value of the specified property has changed from the previous version to the current version of the Item and OldItem

    Declaration
    public bool HasValueChanged(string propName)
    Parameters
    Type Name Description
    System.String propName

    The name of the property value to see if it has changed between versions

    Returns
    Type Description
    System.Boolean

    True if the value of the specified property has changed from the previous version to the current version

    NotifyItemAs<T>()

    The item that notifies the action to be triggered (NotifyItem) as the correct type

    Declaration
    public T NotifyItemAs<T>()
    Returns
    Type Description
    T

    The NotifyItem as the correct type

    Type Parameters
    Name Description
    T

    The type to cast the notification item as

    NotifyOldItemAs<T>()

    The previous version of the item that notifies the action to be triggered (NotifyItem) as the correct type

    Declaration
    public T NotifyOldItemAs<T>()
    Returns
    Type Description
    T

    The NotifyOldItem as the correct type

    Type Parameters
    Name Description
    T

    The type to cast the notification item as

    OldItemAs<T>()

    The previous version of the triggered Item. Will be null if the item is new, indicated with IsNew

    Declaration
    public T OldItemAs<T>()
    Returns
    Type Description
    T

    The previous version of the item as the correct type

    Type Parameters
    Name Description
    T

    The type the old version should be cast to

    Implements

    IFormulaFunctionsWithContextItem
    IFormulaFunctions

    Extension Methods

    MiscExtensions.SetIfNotEqual<T, P>(T, Expression<Func<T, P>>, P)
    ReflectionExtensions.ClearEventInvocations(Object, String)
    StringExtensions.ToCSVFormatString(Object, Type)
    SQLExtensions.ToSQLValue(Object, Boolean)
    In This Article
    Back to top © LemonEdge Technology. All rights reserved.