我試圖檢索資源工作時間以執行我需要的某些邏輯。我知道CRM調度引擎在這些事情上有點笨拙,但我認爲我將能夠找出工作時間如何最終存儲在數據庫中......CRM 2011 - 以編程方式設置/檢索工作時間
因此,資源具有關聯的日曆和這些日曆具有關聯的日曆規則和內部日曆等。可以查看上述日曆規則的開始/結束和頻率並查詢它們的代碼以確定資源在給定時間段內是否「正在工作」。但是,我一直無法找到實際的工作時間,我們應該在DB中的任何字段中說出9-5。
我甚至在通過UI爲資源創建新計劃時嘗試了一些SQL分析,但結果並未顯示傳遞給SQL的任何工作時間。對於那些有耐心的攔截SQL語句如下: -
EXEC Sp_executesql
N'update [CalendarRuleBase] set [ModifiedBy][email protected], [EffectiveIntervalEnd][email protected], [Description][email protected], [ModifiedOn][email protected], [GroupDesignator][email protected], [IsSelected][email protected], [InnerCalendarId][email protected], [TimeZoneCode][email protected], [CalendarId][email protected], [IsVaried][email protected], [Rank][email protected], [ModifiedOnBehalfBy]=NULL, [Duration][email protected], [StartTime][email protected], [Pattern][email protected] where ([CalendarRuleId] = @CalendarRuleId0)',
N'@ModifiedBy0 uniqueidentifier,@EffectiveIntervalEnd0 datetime,@Description0 ntext,@ModifiedOn0 datetime,@GroupDesignator0 ntext,@IsSelected0 bit,@InnerCalendarId0 uniqueidentifier,@TimeZoneCode0 int,@CalendarId0 uniqueidentifier,@IsVaried0 bit,@Rank0 int,@Duration0 int,@StartTime0 datetime,@Pattern0 ntext,@CalendarRuleId0 uniqueidentifier',
@ModifiedBy0='EB04662A-5B38-E111-9889-00155D79A113',
@EffectiveIntervalEnd0='2012-01-13 00:00:00',
@Description0=N'Weekly Single Rule',
@ModifiedOn0='2012-03-12 16:02:08',
@GroupDesignator0=N'FC5769FC-4DE9-445d-8F4E-6E9869E60857',
@IsSelected0=1,
@InnerCalendarId0='3C806E79-7A49-4E8D-B97E-5ED26700EB14',
@TimeZoneCode0=85,
@CalendarId0='E48B1ABF-329F-425F-85DA-3FFCBB77F885',
@IsVaried0=0,
@Rank0=2,
@Duration0=1440,
@StartTime0='2000-01-01 00:00:00',
@Pattern0=N'FREQ=WEEKLY;INTERVAL=1;BYDAY=SU,MO,TU,WE,TH,FR,SA',
@CalendarRuleId0='0A00DFCF-7D0A-4EE3-91B3-DADFCC33781D'
在聲明中的關鍵部分是模式的設置: -
@Pattern0=N'FREQ=WEEKLY;INTERVAL=1;BYDAY=SU,MO,TU,WE,TH,FR,SA'
然而,如前所述,沒有任何的指示工作時間設置。
我是在錯誤地思考這個問題還是CRM在這些工作時間內做了一些有趣的事情?
任何想法非常感謝,謝謝。
謝謝@jasonlattimer明天我會看看,讓你知道我是怎麼回事。 – 2012-03-25 07:40:54