简体   繁体   English

CRM 2011自定义工作流程 - 获取当前会计年度

[英]CRM 2011 Custom Workflow - Get the current fiscal year

I have a custom CRM 2011 workflow which needs to know the current fiscal year. 我有一个自定义CRM 2011工作流程,需要知道当前的会计年度。 Currently I am just passing in an integer value (2012) for the condition operator, see below: 目前我只是为条件运算符传递一个整数值(2012),见下文:

complianceRecordCondition.AttributeName = "new_complianceStartDate";
complianceRecordCondition.Operator = ConditionOperator.InFiscalPeriod;
complianceRecordCondition.Values.Add(2012);

What I need to do is, instead of adding 2012 in the values, I need to calculate/get the current fiscal year somehow and place that in the values. 我需要做的是,不是在值中添加2012,而是以某种方式计算/获取当前会计年度并将其放在值中。

Can anyone explain how I go about doing this? 任何人都可以解释我是怎么做的吗?

Jack 插口

I havn't used the fiscal parts myself so I'm a little unfamiliar, but have you seen these other conditional operators? 我自己没有使用财政部分,所以我有点陌生,但你见过其他有条件的算子吗?

public enum ConditionOperator
{        
    ...
    ThisFiscalYear = 58,        
    ThisFiscalPeriod = 59,        
    NextFiscalYear = 60,        
    NextFiscalPeriod = 61,        
    LastFiscalYear = 62,        
    LastFiscalPeriod = 63,        
    LastXFiscalYears = 64,        
    LastXFiscalPeriods = 65,        
    NextXFiscalYears = 66,        
    NextXFiscalPeriods = 67,        
    InFiscalYear = 68,        
    InFiscalPeriod = 69,        
    InFiscalPeriodAndYear = 70,        
    InOrBeforeFiscalPeriodAndYear = 71,        
    InOrAfterFiscalPeriodAndYear = 72,
    ...
}

They look closer to what you are trying to achieve, in particular ThisFiscalYear . 它们看起来更接近你想要实现的目标,特别是ThisFiscalYear

I would expect the filter to look a little more like this: 我希望过滤器看起来更像这样:

complianceRecordCondition.AttributeName = "intellic_complianceStartDate";   
complianceRecordCondition.Operator = ConditionOperator.ThisFiscalYear;

for getting fiscal year in according to crm fiscal year setting you have to fallow these steps. 根据crm财政年度设置获得财政年度,您必须休会这些步骤。

  1. Retrieve fiscal year start date from the organization entity. 从组织实体检索会计年度开始日期。
  2. Then calculate the current fiscal year. 然后计算当前会计年度。 You can get code in this link 您可以在此链接中获取代码

    Get Current fiscal year in crm 以crm获取当前会计年度

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM