Search Results for

    Show / Hide Table of Contents

    Class TransactionContext

    The custom context for evaluating formulas that are configured in the TransactionCode settings ( ITransactionCode)

    See https://help.lemonedge.com/transactions/ for more information

    Inheritance
    object
    StandardFunctions
    FormulaFunctions
    FormulaFunctionsWithUpdater
    FormulaFunctionsWithContext<ITransaction>
    TransactionContext
    Implements
    IFormulaFunctionsWithContext<ITransaction>
    IFormulaFunctionsWithContext
    IFormulaFunctions
    Inherited Members
    FormulaFunctionsWithContext<ITransaction>.TestEvents()
    FormulaFunctionsWithContext<ITransaction>.ItemAs<T1>()
    FormulaFunctionsWithContext<ITransaction>.SetExtendedPropertyValue(IBaseEntity, string, string, object)
    FormulaFunctionsWithContext<ITransaction>.SetBusy(string)
    FormulaFunctionsWithContext<ITransaction>.StopBusy()
    FormulaFunctionsWithContext<ITransaction>.CreateFormulaContext(Type)
    FormulaFunctionsWithContext<ITransaction>.GetValue(string)
    FormulaFunctionsWithContext<ITransaction>.GetValue<T2>(string)
    FormulaFunctionsWithContext<ITransaction>.GetAnswerTotal(string)
    FormulaFunctionsWithContext<ITransaction>.GetContextType(EntityDescriptor)
    FormulaFunctionsWithContext<ITransaction>.MyItem
    FormulaFunctionsWithContext<ITransaction>.Item
    FormulaFunctionsWithContext<ITransaction>.PropertyChangedItem
    FormulaFunctionsWithContext<ITransaction>.PropertyChangedName
    FormulaFunctionsWithContext<ITransaction>.PropertyChangedAlias
    FormulaFunctionsWithContext<ITransaction>.ChangedItemType
    FormulaFunctionsWithUpdater.SetCustomParameters(Dictionary<string, object>)
    FormulaFunctionsWithUpdater.CreateNewData()
    FormulaFunctionsWithUpdater.CreateNewItem(string)
    FormulaFunctionsWithUpdater.CreateNewItem<T>()
    FormulaFunctionsWithUpdater.GetCustomParamValue(string)
    FormulaFunctionsWithUpdater.HasCustomParamValue(string)
    FormulaFunctionsWithUpdater.HasCustomParamValueEqualTo(string, object)
    FormulaFunctionsWithUpdater.RunCodeSnippet(string, params string[])
    FormulaFunctionsWithUpdater.MyData
    FormulaFunctions.ShareThisQueryCacheWithTarget(IFormulaFunctions)
    FormulaFunctions.SetQueryRunnerHelper(Func<IEntityUpdater, ISQLWrapperInterpretor, Dictionary<string, string>, QueryableExecuter<ISQLWrapperResult>, Task<DataRow[]>>)
    FormulaFunctions.GetItemPropertyValue(object, string)
    FormulaFunctions.GetTaskID(string)
    FormulaFunctions.GetTaskParameter(string)
    FormulaFunctions.SetObjectValue(object, string, object)
    FormulaFunctions.GetObjectValue(object, string)
    FormulaFunctions.GetExtendedPropertyValue(IBaseEntity, string, string)
    FormulaFunctions.GetExtendedPropertyItem(IBaseEntity, string)
    FormulaFunctions.GetExtendedObject(IBaseEntity, string, bool)
    FormulaFunctions.GetEntityTypeID(string)
    FormulaFunctions.Evaluate<T>(string, bool)
    FormulaFunctions.IsValid<T>(string)
    FormulaFunctions.IsValid<T>(string, Type)
    FormulaFunctions.GetContextItemType(object)
    FormulaFunctions.GetItemFromDataSourceID(string, string)
    FormulaFunctions.GetItemFromDataSourceID(string, string, string)
    FormulaFunctions.GetItem(string, Guid)
    FormulaFunctions.GetItemAs<T>(Guid)
    FormulaFunctions.GetItems(string, QueryableFilter)
    FormulaFunctions.GetFirstOrDefaultItem(string, QueryableFilter)
    FormulaFunctions.GetItems(string, string, SQLOperator, object)
    FormulaFunctions.GetFirstOrDefaultItem(string, string, SQLOperator, object)
    FormulaFunctions.GetItems<T>(QueryableFilter)
    FormulaFunctions.GetFirstOrDefaultItem<T>(QueryableFilter)
    FormulaFunctions.GetItems<T>(string, SQLOperator, object)
    FormulaFunctions.GetFirstOrDefaultItem<T>(string, SQLOperator, object)
    FormulaFunctions.GetEnumValue(object)
    FormulaFunctions.GetEnumCode(object)
    FormulaFunctions.XIRR(string, string, string, params string[])
    FormulaFunctions.XIRR(string, string, string, (string, object)[], params string[])
    FormulaFunctions.TWR(string, string, string, string, params string[])
    FormulaFunctions.TWRRow(string, string, string, string, params string[])
    FormulaFunctions.RunQuery(string, string, params string[])
    FormulaFunctions.HasQueryResult(string, params string[])
    FormulaFunctions.GetQueryResult(ISQLWrapperResult, string)
    FormulaFunctions.GetQueryResult(DataRow, string)
    FormulaFunctions.GetQueryResult(string, string, ISQLWrapperResult)
    FormulaFunctions.GetQueryResult(string, string, DataRow)
    FormulaFunctions.GetQueryResult(string, string, ISQLWrapperResult[], string, object)
    FormulaFunctions.RunQueryResult(string, params string[])
    FormulaFunctions.RunDRQueryResult(string, params string[])
    FormulaFunctions.LogInfo(string, params object[])
    FormulaFunctions.LogError(Exception, string, params object[])
    FormulaFunctions.GetQueryCount(string, string, string)
    FormulaFunctions.GetQueryItems(string, string, string, string)
    FormulaFunctions.GetDRQueryItems(string, string, string, string)
    FormulaFunctions.Data
    FormulaFunctions.Cache
    FormulaFunctions.Services
    FormulaFunctions.User
    StandardFunctions.FormatAsString(object)
    StandardFunctions.Null()
    StandardFunctions.IsNull(object)
    StandardFunctions.Not(bool)
    StandardFunctions.Or(bool, bool)
    StandardFunctions.And(bool, bool)
    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(int, int)
    StandardFunctions.Trim(string)
    StandardFunctions.TrimStart(string, char[])
    StandardFunctions.TrimEnd(string, char[])
    StandardFunctions.PadLeft(string, int, char)
    StandardFunctions.PadRight(string, int, char)
    StandardFunctions.Mod(double, double)
    StandardFunctions.If(bool, 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(int, int, int)
    StandardFunctions.Year(DateTime)
    StandardFunctions.Month(DateTime)
    StandardFunctions.Day(DateTime)
    StandardFunctions.WeekDay(DateTime)
    StandardFunctions.Replace(string, string, string)
    StandardFunctions.Substr(string, int, int)
    StandardFunctions.Len(string)
    StandardFunctions.Abs(double)
    StandardFunctions.Int(object)
    StandardFunctions.Trunc(double, int)
    StandardFunctions.Dec(object)
    StandardFunctions.Round(object)
    StandardFunctions.IsBlank(string)
    StandardFunctions.Round(object, int)
    StandardFunctions.Min(double, double, double, double, double)
    StandardFunctions.Max(double, double, double, double, double)
    StandardFunctions.Chr(int)
    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.ValDateTimeOffset(object)
    StandardFunctions.ValDecimal(object)
    StandardFunctions.ValLong(object)
    StandardFunctions.ValID(object)
    StandardFunctions.DateAdd(DateTime, decimal, decimal, decimal)
    StandardFunctions.DateAdd(DateTimeOffset, 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()
    StandardFunctions.NullDateTimeOffset()
    StandardFunctions.TempValue1
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.API.Core.FinancialServices.Processors.Transactional
    Assembly: LemonEdge.API.Entities.FinancialServices.dll
    Syntax
    public class TransactionContext : FormulaFunctionsWithContext<ITransaction>, IFormulaFunctionsWithContext<ITransaction>, IFormulaFunctionsWithContext, IFormulaFunctions

    Constructors

    TransactionContext(IEntityRetriever, IReadOnlyCache, UserInfo, ITransaction, ITransactionProcessor, ITransactionAllocated, IFormulaFunctionsServiceContext)

    Creates a new transaction context for evaluating formulas against transaction code configuration

    Declaration
    public TransactionContext(IEntityRetriever retriever, IReadOnlyCache cache, UserInfo user, ITransaction transaction, ITransactionProcessor processor, ITransactionAllocated allocated, IFormulaFunctionsServiceContext services)
    Parameters
    Type Name Description
    IEntityRetriever retriever
    IReadOnlyCache cache
    UserInfo user
    ITransaction transaction

    The transaction to create the context from. ITransaction

    ITransactionProcessor processor

    The transaction processor to create the context from. ITransactionProcessor

    ITransactionAllocated allocated

    The root transaction this allocated is a part of. ITransactionAllocated

    IFormulaFunctionsServiceContext services

    Properties

    Allocated

    Declaration
    protected ITransactionAllocated Allocated { get; set; }
    Property Value
    Type Description
    ITransactionAllocated

    OriginalContext

    Used when post processing an offset transaction. This holds the original context, with the original transaction/allocation that was being offset

    Declaration
    public TransactionContext OriginalContext { get; set; }
    Property Value
    Type Description
    TransactionContext

    Posting

    Declaration
    protected IGLPosting Posting { get; set; }
    Property Value
    Type Description
    IGLPosting

    Processor

    Declaration
    public ITransactionProcessor Processor { get; }
    Property Value
    Type Description
    ITransactionProcessor

    TempFuncValue1

    Declaration
    public decimal TempFuncValue1 { get; set; }
    Property Value
    Type Description
    decimal

    TempFuncValue2

    Declaration
    public decimal TempFuncValue2 { get; set; }
    Property Value
    Type Description
    decimal

    TempLocalValue1

    Declaration
    public decimal TempLocalValue1 { get; set; }
    Property Value
    Type Description
    decimal

    TempLocalValue2

    Declaration
    public decimal TempLocalValue2 { get; set; }
    Property Value
    Type Description
    decimal

    TempReportingValue1

    Declaration
    public decimal TempReportingValue1 { get; set; }
    Property Value
    Type Description
    decimal

    TempReportingValue2

    Declaration
    public decimal TempReportingValue2 { get; set; }
    Property Value
    Type Description
    decimal

    Methods

    GetAllocatedEntity()

    Declaration
    [FormulaFunction(Name = "GetAllocatedEntity", Type = "Transactions", Description = "Returns the current allocated entity being processed.", Params = "", ParamCount = 1)]
    public ITransactionAllocated GetAllocatedEntity()
    Returns
    Type Description
    ITransactionAllocated

    GetFuncTransactionValue(string)

    Declaration
    [FormulaFunction(Name = "GetFuncTransactionValue", Type = "Transactions", Description = "Returns the func value for the specified transaction type value for this transaction.", Params = "1. The code of the transaction value to return", ParamCount = 1)]
    public decimal GetFuncTransactionValue(string typeCode)
    Parameters
    Type Name Description
    string typeCode
    Returns
    Type Description
    decimal

    GetFuncTransactionValue(string, ITransactionAllocated)

    Declaration
    [FormulaFunction(Name = "GetFuncTransactionValue", Type = "Transactions", Description = "Returns the func value for the specified transaction type value for this transaction.", Params = "1. The code of the transaction allocation value to return.\r\n2. Optionally the allocation to return the value from. If null GetAllocatedEntity() is used instead.", ParamCount = 2)]
    public decimal GetFuncTransactionValue(string typeCode, ITransactionAllocated allocation)
    Parameters
    Type Name Description
    string typeCode
    ITransactionAllocated allocation
    Returns
    Type Description
    decimal

    GetLocalTransactionValue(string)

    Declaration
    [FormulaFunction(Name = "GetLocalTransactionValue", Type = "Transactions", Description = "Returns the local value for the specified transaction type value for this transaction.", Params = "1. The code of the transaction value to return", ParamCount = 1)]
    public decimal GetLocalTransactionValue(string typeCode)
    Parameters
    Type Name Description
    string typeCode
    Returns
    Type Description
    decimal

    GetLocalTransactionValue(string, ITransactionAllocated)

    Declaration
    [FormulaFunction(Name = "GetLocalTransactionValue", Type = "Transactions", Description = "Returns the local value for the specified transaction type value for this transaction allocated amount.", Params = "1. The code of the transaction allocation value to return.\r\n2. Optionally the allocation to return the value from. If null GetAllocatedEntity() is used instead.", ParamCount = 2)]
    public decimal GetLocalTransactionValue(string typeCode, ITransactionAllocated allocation)
    Parameters
    Type Name Description
    string typeCode
    ITransactionAllocated allocation
    Returns
    Type Description
    decimal

    GetPosting()

    Declaration
    [FormulaFunction(Name = "GetPosting", Type = "Transactions", Description = "Returns the current posting being processed for formulas such as those evaluating a sub account.", Params = "", ParamCount = 1)]
    public IGLPosting GetPosting()
    Returns
    Type Description
    IGLPosting

    GetReportingTransactionValue(string)

    Declaration
    [FormulaFunction(Name = "GetReportingTransactionValue", Type = "Transactions", Description = "Returns the reporting value for the specified transaction type value for this transaction.", Params = "1. The code of the transaction value to return", ParamCount = 1)]
    public decimal GetReportingTransactionValue(string typeCode)
    Parameters
    Type Name Description
    string typeCode
    Returns
    Type Description
    decimal

    GetReportingTransactionValue(string, ITransactionAllocated)

    Declaration
    [FormulaFunction(Name = "GetReportingTransactionValue", Type = "Transactions", Description = "Returns the reporting value for the specified transaction type value for this transaction.", Params = "1. The code of the transaction allocation value to return.\r\n2. Optionally the allocation to return the value from. If null GetAllocatedEntity() is used instead.", ParamCount = 2)]
    public decimal GetReportingTransactionValue(string typeCode, ITransactionAllocated allocation)
    Parameters
    Type Name Description
    string typeCode
    ITransactionAllocated allocation
    Returns
    Type Description
    decimal

    GetSharedProperty(string)

    Declaration
    [FormulaFunction(Name = "GetSharedProperty", Type = "Transactions", Description = "Gets an object stored under the shared property name otherwise null.", Params = "1. The property name.", ParamCount = 1)]
    public object GetSharedProperty(string propertyName)
    Parameters
    Type Name Description
    string propertyName
    Returns
    Type Description
    object

    SetAllocatedEntity(ITransactionAllocated)

    Declaration
    public void SetAllocatedEntity(ITransactionAllocated allocated)
    Parameters
    Type Name Description
    ITransactionAllocated allocated

    SetPosting(IGLPosting)

    Declaration
    public void SetPosting(IGLPosting posting)
    Parameters
    Type Name Description
    IGLPosting posting

    SetSharedProperty(string, object)

    Declaration
    [FormulaFunction(Name = "SetSharedProperty", Type = "Transactions", Description = "Sets a property that can be shared across transaction type values.", Params = "1. The property name.\r\n2. The property object", ParamCount = 2)]
    public void SetSharedProperty(string propertyName, object value)
    Parameters
    Type Name Description
    string propertyName
    object value

    Implements

    IFormulaFunctionsWithContext<T>
    IFormulaFunctionsWithContext
    IFormulaFunctions

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.