You are on page 1of 79

Exportfile for AOT version 1.

0 or later
Formatversion: 1
***Element: UTE
; Microsoft Dynamics AX Enum: NVMPEventRuleMultipleRecipients unloaded
; ------------------------------------------------------------------------------USERTYPEVERSION 6
USERTYPE #NVMPEventRuleMultipleRecipients
ENUM
PROPERTIES
Name
#NVMPEventRuleMultipleRecipients
Label
#Use multiple recipients
HelpText
#Use to specify multiple recipients for the alert's em
ail
Extends
#NoYesId
EnumType
#NoYes
ENDPROPERTIES
TYPEELEMENTS
ENDTYPEELEMENTS
TYPEREFERENCES
ENDTYPEREFERENCES
ENDUSERTYPE
***Element: DBT
; Microsoft Dynamics AX Table : EventRule unloaded
; ------------------------------------------------------------------------------TABLEVERSION 1
TABLE #EventRule
PROPERTIES
Name
#EventRule
Label
#@SYS99125
FormRef
#EventRule
TitleField1
#RuleId
TitleField2
#Subject
TableContents
#Base data
ConfigurationKey
#Event
SecurityKey
#BasicTables
CacheLookup
#Found
CreateRecIdIndex
#Yes
TableGroup
#Main
PrimaryIndex
#RuleIdx
ClusterIndex
#RuleIdx
CreatedDateTime
#Yes
DeveloperDocumentation #@SYS125271
ENDPROPERTIES
FIELDS
FIELD #RuleId
STRING
PROPERTIES

Name
Mandatory
AllowEdit
Table
ExtendedDataType
ARRAY
#EventRuleId
#
ENDARRAY
StringSize
ENDPROPERTIES
FIELD #Subject
STRING
PROPERTIES
Name
Table
ExtendedDataType
ARRAY
#EventSubject
#
ENDARRAY
StringSize
ENDPROPERTIES
FIELD #Message
STRING
PROPERTIES
Name
Table
ExtendedDataType
ARRAY
#EventMessage
#
ENDARRAY
StringSize
ENDPROPERTIES
FIELD #UserId
STRING
PROPERTIES
Name
Mandatory
Table
ExtendedDataType
ARRAY
#userId
#
ENDARRAY
StringSize
ENDPROPERTIES
FIELD #TypeId
INT
PROPERTIES
Name
Mandatory
Table
ExtendedDataType
ARRAY

#RuleId
#Yes
#No
#EventRule

#20

#Subject
#EventRule

#128

#Message
#EventRule

#255

#UserId
#Yes
#EventRule

#5

#TypeId
#Yes
#EventRule

#EventTypeId
#
ENDARRAY
ENDPROPERTIES
FIELD #AlertTableId
INT
PROPERTIES
Name
Label
HelpText
Table
ExtendedDataType
ARRAY
#RefTableId
#
ENDARRAY
ENDPROPERTIES
FIELD #AlertFieldId
INT
PROPERTIES
Name
Label
HelpText
Table
ExtendedDataType
ARRAY
#fieldId
#
ENDARRAY
ENDPROPERTIES
FIELD #PrimTableId
INT
PROPERTIES
Name
Label
HelpText
Mandatory
Table
ExtendedDataType
ARRAY
#RefTableId
#
ENDARRAY
ENDPROPERTIES
FIELD #Until
ENUM
PROPERTIES
Name
Table
EnumType
ENDPROPERTIES
FIELD #Enabled
ENUM
PROPERTIES
Name

#AlertTableId
#@SYS87632
#@SYS87631
#EventRule

#AlertFieldId
#@SYS87629
#@SYS87630
#EventRule

#PrimTableId
#@SYS87627
#@SYS87628
#Yes
#EventRule

#Until
#EventRule
#EventUntil

#Enabled

Label
HelpText
Table
ExtendedDataType
ARRAY
#NoYesId
#
ENDARRAY
EnumType
ENDPROPERTIES

#@SYS58636
#@SYS87626
#EventRule

#NoYes

FIELD #AlertQbdsNo
INT
PROPERTIES
Name
#AlertQbdsNo
Table
#EventRule
ExtendedDataType
ARRAY
#EventDataSourceNo
#
ENDARRAY
ENDPROPERTIES
FIELD #FormName
STRING
PROPERTIES
Name
Mandatory
Table
ExtendedDataType
ARRAY
#FormName
#
ENDARRAY
StringSize
ENDPROPERTIES
FIELD #TypeTrigger
ENUM
PROPERTIES
Name
Table
EnumType
ENDPROPERTIES
FIELD #RuleCondition
ENUM
PROPERTIES
Name
Table
EnumType
ENDPROPERTIES
FIELD #UntilDate
DATE
PROPERTIES
Name
Table
ExtendedDataType
ARRAY

#FormName
#Yes
#EventRule

#40

#TypeTrigger
#EventRule
#EventTypeTrigger

#RuleCondition
#EventRule
#EventRuleCondition

#UntilDate
#EventRule

#EventUntilDate
#
ENDARRAY
ENDPROPERTIES
FIELD #AlertFieldLabel
STRING
PROPERTIES
Name
#AlertFieldLabel
AllowEdit
#No
Table
#EventRule
ExtendedDataType
ARRAY
#EventFieldLabel
#
ENDARRAY
StringSize
#250
ENDPROPERTIES
FIELD #ActionIds
QUEUE
PROPERTIES
Name
Label
HelpText
Table
ExtendedDataType
ARRAY
#Blobdata
#
ENDARRAY
ENDPROPERTIES
FIELD #DeleteRefRecId
INT64
PROPERTIES
Name
Label
HelpText
Table
ExtendedDataType
ARRAY
#EventRefRecId
#
ENDARRAY
ENDPROPERTIES
FIELD #ShowPopup
ENUM
PROPERTIES
Name
Label
HelpText
Table
EnumType
ENDPROPERTIES
FIELD #SendEmail
ENUM
PROPERTIES

#ActionIds
#@SYS94916
#@SYS94917
#EventRule

#DeleteRefRecId
#@SYS87910
#@SYS80146
#EventRule

#ShowPopup
#@SYS87695
#@SYS94033
#EventRule
#NoYes

Name
Label
HelpText
Table
EnumType
ENDPROPERTIES

#SendEmail
#@SYS94049
#@SYS94034
#EventRule
#NoYes

FIELD #IsAggregated
ENUM
PROPERTIES
Name
#IsAggregated
Table
#EventRule
ExtendedDataType
ARRAY
#EventIsAggregated
#
ENDARRAY
EnumType
#NoYes
ENDPROPERTIES
ENDFIELDS
GROUPS
GROUP #AutoReport
PROPERTIES
Name
ENDPROPERTIES
GROUPFIELDS
#RuleId
#Subject
#Message
#Enabled
#Until
#UntilDate
#UserId
ENDGROUPFIELDS
ENDGROUP
GROUP #AlertedBy
PROPERTIES
Name
Label
ENDPROPERTIES
GROUPFIELDS
#ShowPopup
#SendEmail
ENDGROUPFIELDS
ENDGROUP
GROUP #AlertOwner
PROPERTIES
Name
Label
ENDPROPERTIES
GROUPFIELDS
#UserId
ENDGROUPFIELDS
ENDGROUP
GROUP #AlertTexts
PROPERTIES

#AutoReport

#AlertedBy
#@SYS94032

#AlertOwner
#@SYS87992

Name
Label
ENDPROPERTIES
GROUPFIELDS
#Subject
#Message
ENDGROUPFIELDS
ENDGROUP
GROUP #Context
PROPERTIES
Name
Label
ENDPROPERTIES
GROUPFIELDS
#FormName
#RuleCondition
ENDGROUPFIELDS
ENDGROUP
GROUP #Identification
PROPERTIES
Name
Label
ENDPROPERTIES
GROUPFIELDS
#RuleId
#Subject
#UserId
ENDGROUPFIELDS
ENDGROUP
GROUP #Overview
PROPERTIES
Name
Label
ENDPROPERTIES
GROUPFIELDS
#Subject
#Enabled
#Until
#UntilDate
#UserId
ENDGROUPFIELDS
ENDGROUP
GROUP #Setup
PROPERTIES
Name
Label
ENDPROPERTIES
GROUPFIELDS
#Until
#UntilDate
#Message
ENDGROUPFIELDS
ENDGROUP
GROUP #Status
PROPERTIES

#AlertTexts
#@SYS87777

#Context
#@SYS76571

#Identification
#@SYS5711

#Overview
#@SYS9039

#Setup
#@SYS2186

Name
Label
ENDPROPERTIES
GROUPFIELDS
#Enabled
ENDGROUPFIELDS
ENDGROUP
GROUP #System
PROPERTIES
Name
Label
ENDPROPERTIES

#Status
#@SYS25587

#System
#@SYS4278

GROUPFIELDS
#AlertTableId
#AlertFieldId
#AlertFieldLabel
#PrimTableId
#TypeId
#TypeTrigger
#AlertQbdsNo
#DeleteRefRecId
#IsAggregated
ENDGROUPFIELDS
ENDGROUP
ENDGROUPS
INDICES
#RuleIdx
PROPERTIES
Name
AllowDuplicates
ENDPROPERTIES

#RuleIdx
#No

INDEXFIELDS
#RuleId
ENDINDEXFIELDS
#UserIdx
PROPERTIES
Name
ENDPROPERTIES

#UserIdx

INDEXFIELDS
#UserId
#RuleId
ENDINDEXFIELDS
#AlertTableIdIdx
PROPERTIES
Name
ENDPROPERTIES
INDEXFIELDS
#AlertTableId
ENDINDEXFIELDS
ENDINDICES
REFERENCES

#AlertTableIdIdx

REFERENCE #DeleteRefRecId
PROPERTIES
Name
#DeleteRefRecId
Table
#Common
EntityRelationshipRole #@SYS125272
ENDPROPERTIES
FIELDREFERENCES
REFERENCETYPE NORMAL
PROPERTIES
Field
#DeleteRefRecId
RelatedField
#RecId
ENDPROPERTIES
ENDFIELDREFERENCES
ENDREFERENCE
ENDREFERENCES
DELETEACTIONS
#NVMPEventRuleRecipients
PROPERTIES
Table
#NVMPEventRuleRecipients
DeleteAction
#Cascade
ENDPROPERTIES
#EventRuleIgnoreAggregation
PROPERTIES
Table
#EventRuleIgnoreAggregation
DeleteAction
#Cascade
ENDPROPERTIES
#EventRuleData
PROPERTIES
Table
DeleteAction
ENDPROPERTIES

#EventRuleData
#Cascade

#EventRuleRel
PROPERTIES
Table
DeleteAction
ENDPROPERTIES

#EventRuleRel
#Cascade

#EventRuleField
PROPERTIES
Table
DeleteAction
ENDPROPERTIES
#EventRuleIgnore
PROPERTIES
Table
DeleteAction
ENDPROPERTIES
ENDDELETEACTIONS
METHODS
Version: 3
SOURCE #alertField

#EventRuleField
#Cascade

#EventRuleIgnore
#Cascade

#container alertField(container _alertField = connull())


#{
#
if (prmisdefault(_alertField))
#
return EventRuleData::find(this.RuleId,EventRuleDataType::Alert
Field).Data;
#
else
#
{
#
this.ruleDataWrite(EventRuleDataType::AlertField,_alertField);
#
return _alertField;
#
}
#}
ENDSOURCE
SOURCE #alertTableLabel
#//BP Deviation documented
#display TableLabel alertTableLabel()
#{
#
return tableid2pname(this.AlertTableId);
#}
ENDSOURCE
SOURCE #buildSubject
#EventSubject buildSubject(
#
container _xContainer
#
)
#{
#
EventSubject
subject;
#
EventType
eventType;
#
anytype
xValue;
#
;
#
eventType = this.TypeId ? EventType::construct(this.TypeId,this.Typ
eTrigger) : null;
#
#
if (eventType)
#
{
#
if (eventType.isFieldRelated())
#
{
#
xValue
= _xContainer && conlen(_xContainer) == 1 ? conp
eek(_xContainer,1) : null;
#
subject = strfmt("@SYS87953",this.AlertFieldLabel,this.prim
TableLabel(),eventType.caption(),
#
eventType.isRequeringX() && xValue ? xValu
e : '');
#
}
#
else
#
{
#
subject = strfmt("@SYS87954",eventType.caption(),this.primT
ableLabel());
#
}
#
}
#
return subject;
#}
ENDSOURCE
SOURCE #checkFilterAccess
#boolean checkFilterAccess(container _packedQuery)
#{
#
if (!this.UserId)
#
return true;
#
#
if (!SysQuery::isPackedOk(_packedQuery))
#
return checkFailed(strfmt("@SYS68912",funcname()));
#

#
return EventSecurity::construct(this.UserId).isFilterAccessible(new
Query(_packedQuery)) ? true : checkFailed(strfmt("@SYS91449",this.UserId));
#}
ENDSOURCE
SOURCE #contextInfo
#EventContextInfo contextInfo(container _value = connull())
#{
#
if (prmisdefault(_value))
#
return EventRuleData::find(this.RuleId,EventRuleDataType::Conte
xt).Data;
#
else
#
{
#
this.ruleDataWrite(EventRuleDataType::Context,_value);
#
return _value;
#
}
#}
ENDSOURCE
SOURCE #createCompanyRuleEntry
#void createCompanyRuleEntry(CompanyId _companyId, userId _userId)
#{
#
EventCompanyRule companyRule;
#
;
#
#
if (EventCompanyRule::exist(_companyId,_userId))
#
return;
#
#
ttsbegin;
#
#
companyRule.selectForUpdate(true);
#
companyRule.CompanyId = _companyId;
#
companyRule.UserId = _userId;
#
companyRule.insert();
#
#
ttscommit;
#
#
#}
ENDSOURCE
SOURCE #createDbLogForRecordType
#// This method only creates databaseLog records for rules using EventTy
peRecord or childs.
#private void createDbLogForRecordType()
#{
#
boolean doFlush;
#
EventType eventType;
#
;
#
if (!this.TypeId)
#
return;
#
#
eventType = EventType::construct(this.TypeId,this.TypeTrigger);
#
#
if (eventType.mustLogRecordDeleted())
#
{
#
xDatabaseLog::eventTestCreate(DatabaseLogType::EventDelete,this
.AlertTableId);
#
doFlush = true;
#
}
#
if (eventType.mustLogRecordInserted())
#
{
#
xDatabaseLog::eventTestCreate(DatabaseLogType::EventInsert,this

.AlertTableId);
#
doFlush = true;
#
}
#
if (doFlush)
#
SysFlushDatabaseLogSetup::main();
#}
ENDSOURCE
SOURCE #delete
#public void delete()
#{
#;
#
ttsbegin;
#
#
this.deleteDbLogForRecordType();
#
#
super();
#
#
this.deleteCompanyRuleEntry(this.DataAreaId,this.UserId);
#
#
ttscommit;
#}
ENDSOURCE
SOURCE #deleteCompanyRuleEntry
#void deleteCompanyRuleEntry(CompanyId _companyId, userId _userId)
#{
#
EventRule tstRule;
#
EventCompanyRule companyRule;
#
#
;
#
#
if (!EventCompanyRule::exist(_companyId, _userId))
#
return;
#
#
// Check if there are any rules left for that company
#
select tstRule
#
where tstRule.DataAreaId == _companyId &&
#
tstRule.UserId == _userId;
#
#
if (tstRule)
#
return;
#
#
ttsbegin;
#
companyRule = EventCompanyRule::find(_companyId,_userId, true);
#
companyRule.delete();
#
ttscommit;
#
#}
ENDSOURCE
SOURCE #deleteDbLogForRecordType
#// This method only deletes databaseLog records for rules using EventTy
peRecord or childs.
#private void deleteDbLogForRecordType()
#{
#
EventRule
tstRule;
#
DatabaseLog
dbLog;
#
#
CompanyDomainList domainList;
#
DatabaseLogType logType;
#
#
if (this.TypeTrigger != EventTypeTrigger::RecordInsert &&

#
this.TypeTrigger != EventTypeTrigger::RecordDelete
#
)
#
{
#
return;
#
}
#
#
// Check if another rule is using the same table
#
select tstRule
#
where tstRule.TypeTrigger
== this.TypeTrigger
#
&& tstRule.AlertTableId == this.AlertTableId
#
&& tstRule.RecId
!= this.RecId;
#
if (tstRule)
#
return;
#
#
if (this.TypeTrigger == EventTypeTrigger::RecordInsert)
#
logType = DatabaseLogType::EventInsert;
#
else
#
logType = DatabaseLogType::EventDelete;
#
#
#
while select domainList where
#
domainList.CompanyId == curext()
#
{
#
ttsbegin;
#
dbLog = xDatabaseLog::find(domainList.DomainId,logType,this
.AlertTableId,0,true);
#
#
if (dbLog)
#
dbLog.delete();
#
ttscommit;
#
}
#
#
SysFlushDatabaseLogSetup::main();
#}
ENDSOURCE
SOURCE #disableIfExpired
#public boolean disableIfExpired(
#
TransDate _curTransDate
#
)
#{
#
#OCCRetryCount
#
#
if (!this.selectForUpdate())
#
throw error(strfmt("@SYS68912",funcname()));
#
#
try
#
{
#
#
if (this.Until == EventUntil::UntilDate && this.UntilDate < _cu
rTransDate)
#
{
#
this.Enabled = NoYes::No;
#
this.update();
#
return true;
#
}
#
}
#
catch(Exception::Deadlock)
#
{
#
this.reread();
#
if (this.Until == EventUntil::UntilDate && this.UntilDate < _cu

rTransDate &&
#
this.Enabled == NoYes::Yes)
#
retry;
#
else
#
return true;
#
}
#
catch (Exception::UpdateConflict)
#
{
#
if (appl.ttsLevel() == 0)
#
{
#
if (xSession::currentRetryCount() >= #RetryNum)
#
{
#
throw Exception::UpdateConflictNotRecovered;
#
}
#
else
#
{
#
if (this.Until == EventUntil::UntilDate && this.UntilDa
te < _curTransDate &&
#
this.Enabled == NoYes::Yes)
#
retry;
#
else
#
return true;
#
}
#
}
#
else
#
{
#
throw Exception::UpdateConflict;
#
}
#
}
#
#
return false;
#}
ENDSOURCE
SOURCE #eventType
#EventType eventType()
#{
#
if (! this.TypeId)
#
return null;
#
#
return EventType::construct(this.TypeId,this.TypeTrigger);
#}
ENDSOURCE
SOURCE #filter
#container filter(container _filter = connull())
#{
#
if (prmisdefault(_filter))
#
return EventRuleData::find(this.RuleId,EventRuleDataType::Filte
r).Data;
#
else
#
{
#
this.ruleDataWrite(EventRuleDataType::Filter,_filter);
#
return _filter;
#
}
#}
ENDSOURCE
SOURCE #filterQuery
#Query filterQuery(Query _query = null)
#{
#
if (prmisdefault(_query))
#
return new Query(this.filter());

#
else
#
{
#
this.filter(_query.pack(false));
#
return _query;
#
}
#}
#
ENDSOURCE
SOURCE #getDurationFieldText
#//BP Deviation documented
#display EPEventRuleDuration getDurationFieldText()
#{
#
SysDictField dictField = new SysDictField(tablenum(EventRule),field
num(EventRule,Until));
#
SysDictEnum dictEnum = new SysDictEnum(dictField.enumId());
#
return dictEnum.value2Label(this.Until);
#}
ENDSOURCE
SOURCE #getRuleStatus
#//BP Deviation documented
#display EPEventRuleStatus getRuleStatus()
#{
#
if (this.Enabled)
#
return "@SYS58636";
#
else
#
return "@SYS88623";
#}
ENDSOURCE
SOURCE #initFromTmpEventAlertField
#void initFromTmpEventAlertField(
#
TmpEventAlertField _tmpEventAlertField
#
)
#{
#
this.AlertFieldId
= _tmpEventAlertField.RefFieldId;
#
this.AlertTableId
= _tmpEventAlertField.RefTableId ? _tmpEventA
lertField.RefTableId : this.PrimTableId;
#
this.AlertFieldLabel = _tmpEventAlertField.Label;
#}
ENDSOURCE
SOURCE #initFromTmpEventType
#void initFromTmpEventType(
#
TmpEventType
_tmpEventType
#
)
#{
#
this.TypeId = _tmpEventType.TypeId;
#
this.TypeTrigger = _tmpEventType.TypeTrigger;
#}
ENDSOURCE
SOURCE #initValue
#public void initValue()
#{
#
super();
#
#
this.UserId = curuserid();
#
#}
ENDSOURCE
SOURCE #insert
##Event
#public void insert()

#{
#
#
EventParameters eventParameters;
#;
#
ttsbegin;
#
#
this.RuleId = this.RuleId ? this.RuleId : NumberSeq::newGetNum(Comp
anyInfo::numRefParmId()).num();
#
#
if (!EventParameters::find())
#
{
#
ttsbegin;
#
eventParameters = EventParameters::find(true);
#
eventParameters.update();
#
ttscommit;
#
}
#
#
this.createDbLogForRecordType();
#
#
if (!this.isTmp())
#
this.createCompanyRuleEntry(this.DataAreaId, this.UserId);
#
#
super();
#
#
ttscommit;
#}
ENDSOURCE
SOURCE #isDueDateRule
#boolean isDueDateRule()
#{
#
return SysDictClass::isEqualOrSuperclass(this.TypeId,classnum(Event
TypeDue));
#}
ENDSOURCE
SOURCE #isFilterInteractive
#boolean isFilterInteractive()
#{
#
return this.TypeId && !EventType::construct(this.TypeId,this.TypeTr
igger).isFilterInteractive() ? false : true;
#}
ENDSOURCE
SOURCE #primTableLabel
#//BP Deviation documented
#display EventTableLabel primTableLabel()
#{
#
return this.PrimTableId ? new SysDictTable(this.PrimTableId).label(
) : '';
#}
ENDSOURCE
SOURCE #ruleDataWrite
#private void ruleDataWrite(
#
EventRuleDataType _dataType,
#
container
_data
#
)
#{
#
EventRuleData eventRuleData;
#;
#
eventRuleData = EventRuleData::find(this.RuleId,_dataType,true);
#
eventRuleData.RuleId
= this.RuleId;
#
eventRuleData.DataType = _dataType;

#
eventRuleData.Data
= _data;
#
#
if (eventRuleData.RecId)
#
{
#
eventRuleData.update();
#
}
#
else
#
{
#
eventRuleData.insert();
#
}
#}
ENDSOURCE
SOURCE #setDeleteRefRecId
#void setDeleteRefRecId(
#
Common _callerRecord
#
)
#{
#
this.DeleteRefRecId = _callerRecord.RecId && this.RuleCondition ==
EventRuleCondition::Current ? _callerRecord.RecId : 0;
#}
ENDSOURCE
SOURCE #setSubject
#void setSubject(
#
container _xContainer
#
)
#{
#
this.Subject = this.buildSubject(_xContainer);
#}
ENDSOURCE
SOURCE #typeIdLabel
#//BP Deviation documented
#display ClassDescription typeIdLabel()
#{
#
return EventType::construct(this.TypeId,this.TypeTrigger).descripti
on();
#}
ENDSOURCE
SOURCE #typeValue
#EventTypeValue typeValue(container _value = connull())
#{
#
if (prmisdefault(_value))
#
return EventRuleData::find(this.RuleId,EventRuleDataType::TypeV
alue).Data;
#
else
#
{
#
this.ruleDataWrite(EventRuleDataType::TypeValue,_value);
#
return _value;
#
}
#}
ENDSOURCE
SOURCE #update
#public void update()
#{
#
boolean isOwnerChanged;
#
userId oldRuleOwner;
#
#;
#
ttsbegin;
#
#
// Note that an update may be part of a larger transaction, e.g. du

ring event processing.


#
#
this.createDbLogForRecordType();
#
#
isOwnerChanged = this.orig().UserId != this.UserId;
#
#
if (isOwnerChanged)
#
oldRuleOwner = this.orig().UserId;
#
#
super();
#
#
if (isOwnerChanged)
#
{
#
this.deleteCompanyRuleEntry(curext(),oldRuleOwner);
#
this.createCompanyRuleEntry(curext(),this.UserId);
#
}
#
#
ttscommit;
#}
ENDSOURCE
SOURCE #A4AInvalidTables
#// This method builds a set of tableId's that does not allow for Rule c
reation
#static client server container a4aInvalidTables()
#{
#
Set invalidTableSet = new Set(Types::Integer);
#
;
#
invalidTableSet.add(tablenum(EventInbox));
#
invalidTableSet.add(tablenum(EventInboxData));
#
invalidTableSet.add(tablenum(EventCUD));
#
invalidTableSet.add(tablenum(InventSum));
#
// Add further tables here
#
// ....
#
return invalidTableSet.pack();
#}
ENDSOURCE
SOURCE #canShowCreateRuleMenuItem
#static public client boolean canShowCreateRuleMenuItem(FormRun _caller)
#{
#
boolean ret;
#
;
#
ret = hasMenuItemAccess(menuitemactionstr(EventCreateRule),MenuItem
Type::Action);
#
ret = ret && EventCreateRule::newCheckFormRun(_caller);
#
#
return ret;
#}
ENDSOURCE
SOURCE #changeDomainLicenseKey
#static public server void changeDomainLicenseKey(
#
EnableDisable _enableDisable
#
)
#{
#
#OCCRetryCount
#
DictConfigurationKey
dictConfigurationKey = new DictConfiguratio
nKey(configurationkeynum(Event));
#
EventRule
eventRule;
#
EventRuleField
eventRuleField;
#
DataArea
dataArea;
#
boolean
updateRules;

#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#

SysDictField
df;
SysDictTable
dt;
Integer
arrIdx;
;
if (!dictConfigurationKey || !dictConfigurationKey.enabled())
return;
if (!isRunningMode())
return;
try
{
ttsbegin;
while select dataArea where
dataArea.IsVirtual == false
{
updateRules = false;
changecompany(dataArea.Id)
{
if (_enableDisable == EnableDisable::Enable)
{
while select forupdate eventRule
index RuleIdx
{
eventRule.update();
}
while select eventRuleField
{
arrIdx = fieldExt2Idx(eventRuleField.uFieldId)

;
#
df
= new SysDictField(eventRuleField.uTabl
eId,eventRuleField.uFieldId,arrIdx);
#
dt
= new SysDictTable(eventRuleField.uTabl
eId);
#
#
if (df && df.mandatory() && dt.primaryKeyField(
) == fieldExt2Id(df.id()))
#
xDatabaseLog::eventTestCreate(DatabaseLogTy
pe::EventRenameKey,eventRuleField.uTableId,eventRuleField.uFieldId);
#
else
#
xDatabaseLog::eventTestCreate(DatabaseLogTy
pe::EventUpdate,eventRuleField.uTableId,eventRuleField.uFieldId);
#
}
#
}
#
}
#
}
#
ttscommit;
#
}
#
catch (Exception::Deadlock)
#
{
#
retry;
#
}
#
catch (Exception::UpdateConflict)
#
{
#
if (appl.ttsLevel() == 0)
#
{
#
if (xSession::currentRetryCount() >= #RetryNum)

#
{
#
throw Exception::UpdateConflictNotRecovered;
#
}
#
else
#
{
#
retry;
#
}
#
}
#
else
#
{
#
throw Exception::UpdateConflict;
#
}
#
}
#}
ENDSOURCE
SOURCE #checkExist
#static boolean checkExist(EventRuleId _eventRuleId)
#{
#
if (_eventRuleId && !EventRule::exist(_eventRuleId))
#
return checkFailed(strfmt(EventRule::txtNotExist(),_eventRuleId
));
#
return true;
#}
#
ENDSOURCE
SOURCE #exist
#static boolean exist(EventRuleId _eventRuleId)
#{
#
return _eventRuleId && (select RecId from eventrule
#
index hint RuleIdx
#
where eventrule.RuleId == _eventRuleId
#
).RecId != 0;
#}
#
ENDSOURCE
SOURCE #find
#static EventRule find(EventRuleId _eventRuleId,
#
boolean _forupdate = false,
#
ConcurrencyModel _concurrencyModel = ConcurrencyM
odel::Auto)
#{
#
EventRule eventRule;
#
#
if (_eventRuleId)
#
{
#
if (_forupdate)
#
{
#
eventRule.selectForUpdate(_forupdate);
#
if (_concurrencyModel != ConcurrencyModel::Auto)
#
eventRule.concurrencyModel(_concurrencyModel);
#
}
#
#
select eventRule
#
where eventRule.RuleId == _eventRuleId;
#
}
#
return eventRule;
#}
#
ENDSOURCE
SOURCE #name

#static EventSubject name(EventRuleId _eventRuleId)


#{
#
return EventRule::find(_eventRuleId).Subject;
#}
#
ENDSOURCE
SOURCE #recordTemplatesExist
#static client boolean recordTemplatesExist(boolean _forceExtendedCheck)
#{
#
SysRecordTmpTemplate
sysRecordTmpTemplateLimit;
#
SysRecordTemplateTable
sysRecordTemplateTable = SysRecordTemp
lateTable::find(tablenum(EventRule));
#
#
#Define.maxTemplatesSimpleCheck(10)
#
;
#
if (!sysRecordTemplateTable.RecId || !sysRecordTemplateTable.Data |
| conlen(sysRecordTemplateTable.Data) <= 1)
#
return false;
#
#
if (!_forceExtendedCheck && conlen(sysRecordTemplateTable.Data)+1 >
#maxTemplatesSimpleCheck)
#
return true;
#
#
sysRecordTmpTemplateLimit.setTmpData(SysRecordTmpTemplate::sysRecor
dTmpTemplateLimit(tablenum(EventRule),sysRecordTemplateTable.Data));
#
#
select count(RecId) from sysRecordTmpTemplateLimit;
#
#
return conlen(sysRecordTemplateTable.Data) - sysRecordTmpTemplateLi
mit.RecId > 1 ? true : false;
#}
ENDSOURCE
SOURCE #txtNotExist
#static TxtNotExist txtNotExist()
#{
#
return "@SYS87622";
#}
#
ENDSOURCE
SOURCE #viewCreateRuleDialog
#static public client void viewCreateRuleDialog(FormRun _caller)
#{
#
Args args;
#
;
#
if (!hasMenuItemAccess(menuitemactionstr(EventCreateRule),MenuItemT
ype::Action))
#
return;
#
args = new Args();
#
args.caller(_caller);
#
args.parmObject(_caller);
#
new MenuFunction(menuitemdisplaystr(EventRule),MenuItemType::Displa
y).run(args);
#
#/*
#
Args args;
#
;
#
if (!hasMenuItemAccess(menuitemactionstr(EventCreateRule),MenuItemT
ype::Action))
#
return;
#
args = new Args();

#
args.caller(_caller);
#
new MenuFunction(menuitemactionstr(EventCreateRule),MenuItemType::A
ction).run(args);
#*/
#}
ENDSOURCE
ENDMETHODS
ENDTABLE
***Element: DBT
; Microsoft Dynamics AX Table : NVMPEventRuleRecipients unloaded
; ------------------------------------------------------------------------------TABLEVERSION 1
TABLE #NVMPEventRuleRecipients
PROPERTIES
Name
#NVMPEventRuleRecipients
Label
#Event rule recipients
FormRef
#NVMPEventRuleReceipients
TitleField1
#EventRuleId
TitleField2
#UserId
CacheLookup
#FoundAndEmpty
TableGroup
#WorksheetLine
PrimaryIndex
#EventRuleUserdIdx
ClusterIndex
#EventRuleUserdIdx
ENDPROPERTIES
FIELDS
FIELD #EventRuleId
STRING
PROPERTIES
Name
Mandatory
AllowEdit
Table
ExtendedDataType
ARRAY
#EventRuleId
#
ENDARRAY
StringSize
ENDPROPERTIES
FIELD #UserId
STRING
PROPERTIES
Name
Mandatory
AllowEdit
Table
ExtendedDataType
ARRAY
#userId
#
ENDARRAY
StringSize
ENDPROPERTIES

#EventRuleId
#Yes
#No
#NVMPEventRuleRecipients

#20

#UserId
#Yes
#No
#NVMPEventRuleRecipients

#5

ENDFIELDS
GROUPS
GROUP #AutoReport
PROPERTIES
Name
ENDPROPERTIES
GROUPFIELDS
#EventRuleId
#UserId
ENDGROUPFIELDS
ENDGROUP
GROUP #Identification
PROPERTIES
Name
Label
ENDPROPERTIES
GROUPFIELDS
#EventRuleId
#UserId
ENDGROUPFIELDS
ENDGROUP
GROUP #Overview
PROPERTIES
Name
Label
ENDPROPERTIES
GROUPFIELDS
#EventRuleId
#UserId
ENDGROUPFIELDS
ENDGROUP
GROUP #User
PROPERTIES
Name
Label
ENDPROPERTIES

#AutoReport

#Identification
#@SYS5711

#Overview
#@SYS9039

#User
#@SYS16181

GROUPFIELDS
#UserId
#userName
ENDGROUPFIELDS
ENDGROUP
ENDGROUPS
INDICES
#EventRuleUserdIdx
PROPERTIES
Name
AllowDuplicates
ENDPROPERTIES
INDEXFIELDS
#EventRuleId
#UserId
ENDINDEXFIELDS

#EventRuleUserdIdx
#No

ENDINDICES
REFERENCES
ENDREFERENCES
DELETEACTIONS
ENDDELETEACTIONS
METHODS
Version: 3
SOURCE #userName
#// BP Deviation Documented
#public display UserName userName()
#{
#
;
#
return (
select firstonly Id, Name
#
from
userInfo
#
where userInfo.id == this.UserId ).Name;
#
#}
ENDSOURCE
SOURCE #checkExist
#public static Boolean checkExist(EventRuleId _eventRuleId,
#
userId
_userId)
#{
#
Boolean ret = true;
#
;
#
#
if (!NVMPEventRuleRecipients::exist(_eventRuleId, _userId))
#
{
#
ret = checkFailed(strfmt(NVMPEventRuleRecipients::txtNotExist()
, _eventRuleId, _userId));
#
}
#
#
return ret;
#}
ENDSOURCE
SOURCE #exist
#public static Boolean exist(EventRuleId _eventRuleId,
#
userId
_userId)
#{
#
return (NVMPEventRuleRecipients::find(_eventRuleId, _userId).RecId
!= 0);
#}
ENDSOURCE
SOURCE #find
#public static NVMPEventRuleRecipients find(EventRuleId _eventRuleId,
#
userId
_userId,
#
Boolean
_forUpdate = fal
se)
#{
#
NVMPEventRuleRecipients
nvmpEventRuleRecipients;
#
;
#
#
if (_eventRuleId && _userId)
#
{
#
nvmpEventRuleRecipients.selectForUpdate(_forUpdate);
#
#
select firstonly nvmpEventRuleRecipients
#
index hint EventRuleUserdIdx
#
where nvmpEventRuleRecipients.EventRuleId == _eventRuleId &

&
#
nvmpEventRuleRecipients.UserId
== _userId;
#
}
#
#
return nvmpEventRuleRecipients;
#}
ENDSOURCE
SOURCE #sendMail
#static void sendMail( EventRuleId
_eventRuleId,
#
SysEmailId
_AlertTemplateId,
#
Map
_mappings
= null,
#
str
_xmlParamters = ''
#
)
#{
#
NVMPEventRuleRecipients recipients;
#
SysUserInfo
sysUserInfo;
#
UserInfo
userInfo;
#
;
#
#
while select
UserId
#
from
recipients
#
where
recipients.EventRuleId == _eventRuleId
#
{
#
// SysUserInfo has Alert and email info
#
sysUserInfo = SysUserInfo::find(recipients.UserId);
#
#
// UserInfo has the language info
#
userInfo = xUserInfo::find(false, recipients.UserId);
#
#
SysEmailTable::sendMail(_AlertTemplateId, userInfo.Language, sy
sUserInfo.Email, _mappings, '', _xmlParamters, true, recipients.UserId, true);
#
}
#}
ENDSOURCE
SOURCE #txtNotExist
#public static TxtNotExist txtNotExist()
#{
#
return "@LOQ137";
#}
ENDSOURCE
SOURCE #updateRuleIdLink
#public static void updateRuleIdLink(EventRuleId _oldRuleId
#
, EventRuleId _newRuleId)
#{
#
NVMPEventRuleRecipients
recipients;
#
;
#
#
ttsBegin;
#
#
update_recordset recipients
#
setting EventRuleId
= _newRuleId
#
where recipients.EventRuleId == _oldRuleId;
#
#
ttsCommit;
#}
ENDSOURCE
ENDMETHODS
ENDTABLE

***Element: CLS
; Microsoft Dynamics AX Class: EventActionEmail unloaded
; ------------------------------------------------------------------------------CLSVERSION 1
CLASS #EventActionEmail
PROPERTIES
Name
#EventActionEmail
Extends
#EventAction
RunOn
#Called from
ENDPROPERTIES
METHODS
Version: 3
SOURCE #classDeclaration
#// This is a framework class. Customizing this class may cause problems
with future upgrades to the software.
#class EventActionEmail extends EventAction
#{
#
#}
ENDSOURCE
SOURCE #createEmailParameterMap
#Map createEmailParameterMap(EventInbox _inbox, EventType _eventType, Ev
entRule _eventRule)
#{
#
Map parameterMap = new Map(Types::String,Types::String);
#
SqlSystem sqlSystem = new SqlSystem();
#
#
SysDictClass dictClass = new SysDictClass(_inbox.TypeId);
#
SysDictTable dictTable = new SysDictTable(_inbox.AlertTableId);
#
#
SysDictField dictField = new SysDictField(_inbox.AlertTableId,_inbo
x.AlertFieldId);
#
SysDictEnum dictEnum;
#
#
str event;
#
str table;
#
str data;
#
#
str previousValue;
#
str currentValue;
#
#
str drillDownGroup;
#
;
#
#
event = EventInbox::buildSubject(_inbox);
#
#
table = dictTable.label();
#
#
if(SysDictClass::isEqualOrSuperclass(_inbox.TypeId, classnum(EventT
ypeCUD))&& _inbox.TypeTrigger == EventTypeTrigger::FieldChanged)
#
{
#
if (dictField.enumId() == 0)
#
{
#
previousValue = strfmt('%1',_eventType.parmOriginalValue())
;
#
currentValue = strfmt('%1',_eventType.parmCurrentValue());

#
}
#
else
#
{
#
dictEnum = new SysDictEnum(dictField.enumId());
#
previousValue = dictEnum.value2Label(_eventType.parmOrigina
lValue());
#
currentValue = dictEnum.value2Label(_eventType.parmCurrentV
alue());
#
}
#
#
parameterMap.insert('beforevalue',previousvalue);
#
parameterMap.insert('aftervalue',currentValue);
#
#
data = strfmt('%1: %2; %3: %4', '@SYS69521',previousVAlue,'@SYS
91541',currentValue);
#
#
}
#
#
drillDownGroup = EventDrillDownPoller::currentDrillDownNavigationMa
rk();
#
#
parameterMap.insert('occurred',datetime2str(_inbox.AlertCreatedDate
Time, DateFlags::FormatAll));
#
parameterMap.insert('for',_inbox.AlertedFor);
#
parameterMap.insert('company',_inbox.CompanyId);
#
parameterMap.insert('data',data);
#
parameterMap.insert('subject',_inbox.Subject);
#
parameterMap.insert('message',_inbox.Message);
#
parameterMap.insert('LinkToBusinessData', drillDownGroup + '?DrillD
own_' + int642str(_inbox.InboxId));
#
parameterMap.insert('LinkToAlertRule', drillDownGroup + '?ViewAlert
Rule_' + int642str(_inbox.InboxId));
#
parameterMap.insert('LinkToAlert', drillDownGroup + '?ViewAlert_' +
int642str(_inbox.InboxId));
#
#
parameterMap.insert('event', event);
#
parameterMap.insert('alertid',_inbox.InboxId);
#
#
return parameterMap;
#}
ENDSOURCE
SOURCE #execute
#public void execute(
#
EventRule eventRule,
#
EventType eventType,
#
Common
buffer,
#
EventInbox alertInbox,
#
// note: for due date events, the time and date on which the alert
#
// is considered to be created is when the due date batch
#
// started to run
#
EventAlertCreatedDateTime alertCreatedDateTime = DateTimeUtil::newD
ateTime(systemdateget(),timenow(),DateTimeUtil::getUserPreferredTimeZone())
#
)
#{
#
#
SysUserInfo
sysUserInfo;
#
UserInfo
userInfo;
#
#
Map mappings;
#

#
str xmlParameters;
#
#
EventParameters eventParameters = EventParameters::find();
#
#
;
#
#
// SysUserInfo has Alert and email info
#
sysUserInfo = SysUserInfo::find(eventRule.UserId);
#
#
// UserInfo has the language info
#
userInfo = xUserInfo::find(false, eventRule.UserId);
#
#
if (alertInbox
#
&&
#
(eventRule.AlertTableId != tablenum(SysOutgoingEmailTable))
#
&&
#
(eventRule.AlertTableId != tablenum(SysOutgoingEmailData))
#
&&
#
SysEmailDistributor::validateEmail(sysUserInfo.Email)
#
&&
#
((sysUserInfo.EventEmailAlertsWhen == EventEmailSendDefineMode:
:AllRules) ||
#
((sysUserInfo.EventEmailAlertsWhen == EventEmailSendDefineMode
::DefinedOnRule) &&
#
(eventRule.SendEmail == true))
#
)
#
)
#
{
#
//NOTE: nothing is commited in SysOutgoingEmial table until the
successful
#
#
mappings = this.createEmailParameterMap(alertInbox,eventType,ev
entRule);
#
#
xmlParameters = EventActionEmail::createEmailParameterXml(mappi
ngs);
#
#
if (eventParameters.AlertTemplateId)
#
{
#
SysEmailTable::sendMail(eventParameters.AlertTemplateId,use
rInfo.Language,sysUserInfo.Email,mappings,'',xmlParameters,true,eventRule.UserId
,true);
#
#
// KeSae : 21/04/2010 : Alerting multiple mail recipients
#
NVMPEventRuleRecipients::sendMail(eventRule.RuleId, eventPa
rameters.AlertTemplateId, mappings, xmlParameters);
#
}
#
else
#
throw error("@SYS94918");
#
}
#
#}
ENDSOURCE
SOURCE #createEmailParameterXml
#static str createEmailParameterXml(Map parameterMap)
#{
#
MapEnumerator enum = parameterMap.getEnumerator();
#
#
XmlElement alert;
#
XmlElement node;

#
#
#
#
#
#
#
#
#
#

XmlCDataSection value;
XmlDocument doc = new XmlDocument();
;
alert = doc.createNode(XmlNodeType::Element,'alert','');
while (enum.moveNext())
{
node = doc.createNode(XmlNodeType::Element,enum.currentKey(),''

);
#
#
#

//closing tag for CDATA section is illegal


if (!strfind(enum.currentValue(),']]>',1,strlen(enum.currentVal

ue())))
#
value = doc.createCDataSection(enum.currentValue());
#
else
#
value = doc.createCDataSection('');
#
#
node.appendChild(value);
#
alert.appendChild(node);
#
#
}
#
#
#
doc.appendChild(alert);
#
#
//Axapta uses UTF-16 encoding
#
return '<?xml version="1.0" encoding="utf-16"?>' + doc.xml();
#}
ENDSOURCE
ENDMETHODS
ENDCLASS
***Element: CLS
; Microsoft Dynamics AX Class: EventCreateRule unloaded
; ------------------------------------------------------------------------------CLSVERSION 1
CLASS #EventCreateRule
PROPERTIES
Name
#EventCreateRule
Extends
#RunBase
RunOn
#Called from
ENDPROPERTIES
METHODS
Version: 3
SOURCE #alertFieldChange
#TmpEventAlertField alertFieldChange(
#
EventFieldLabelRich
_alertFieldLabel
#
)
#{
#
;
#
tmpEventAlertField = this.eventBuildValidAlertFields().label2TmpEve
ntAlertField(_alertFieldLabel);
#
return tmpEventAlertField;
#}

ENDSOURCE
SOURCE #canCreateRule
#/// <summary>
#///
Determines whether a rule can be created.
#/// </summary>
#/// <returns>
#///
true if a rule can be created; otherwise, false.
#/// </returns>
#/// <remarks>
#///
The evaluation is based on the EventCreateRule.setValidCallerDat
a method.
#/// </remarks>
#public boolean canCreateRule()
#{
#
;
#
checkMode = true;
#
return this.setValidCallerData();
#}
ENDSOURCE
SOURCE #checkAlertField
#/// <summary>
#///
Tests whether the text entered in the Alert Field control is val
id, by trying to find a corresponding record in the TmpEventAlertField temporary
table.
#/// </summary>
#/// <param name="_alertFieldLabel">
#///
Text in the <c>FormControl</c> that hosts the Alert Field.
#/// </param>
#/// <returns>
#///
true if the text entered in the Alert Field control is valid; ot
herwise, false.
#/// </returns>
#/// <remarks>
#///
Used by the EventCreateRule form to test the validity of the tex
t entered in the Alert Field control.
#/// </remarks>
#public boolean checkAlertField(
#
EventFieldLabelRich _alertFieldLabel
#
)
#{
#
TmpEventAlertField tmpEventAlertFieldCheck = this.eventBuildValidAl
ertFields().label2TmpEventAlertField(_alertFieldLabel);
#
;
#
return tmpEventAlertFieldCheck.RecId || !_alertFieldLabel ? true :
checkFailed(strfmt("@SYS87769",_alertFieldLabel));
#}
ENDSOURCE
SOURCE #checkForeignKey
#/// <summary>
#///
Tests whether the field specified in the rule is a foreign key.
Creates a click-once message to the user describing what to do if the user wants
to be alerted when the foreign key is changed.
#/// </summary>
#/// <returns>
#///
true if the field specified in the rule is a foreign key; otherw
ise, false.
#/// </returns>
#/// <remarks>
#///
Used by the EventCreateRule form.
#/// </remarks>

#public boolean checkForeignKey()


#{
#
xRefTableRelation xRefTableRelation;
#
str
fieldLabel;
#
#
select firstonly xRefTableRelation;
#
#
if (! xRefTableRelation)
#
new xRefTableRelationUpdate().run();
#
#
if (eventRuleTmp.AlertFieldId != 0)
#
{
#
while select xRefTableRelation
#
where xRefTableRelation.RelationName
== fieldid2name(ev
entRuleTmp.AlertTableId, eventRuleTmp.AlertFieldId)
#
&& xRefTableRelation.TableName
== tableid2name(ev
entRuleTmp.AlertTableId)
#
&& xRefTableRelation.RelatedTableName != tableid2name(ev
entRuleTmp.AlertTableId)
#
#
if (xRefTableRelation)
#
{
#
fieldLabel = new DictField(eventRuleTmp.AlertTableId, event
RuleTmp.AlertFieldId).label();
#
Box::infoOnce( "@SYS94862",
#
strfmt("@SYS94863", fieldLabel) + '\n\n' +
#
strfmt("@SYS94864", fieldLabel),
#
formstr(EventCreateRule));
#
return true;
#
}
#
}
#
#
return false;
#}
ENDSOURCE
SOURCE #classDeclaration
#/// <summary>
#///
The <c>EventCreateRule</c> class is a standard <c>RunBase</c> in
heritance that is used for creating rules.
#/// </summary>
#/// <remarks>
#///
The Prompt part holds the UI for creating the rule (Form: <c>Eve
ntCreateRule</c>) and the Run part inserts the rule into the database.
#///
The class must be called with a <c>FormRun</c>. Before
#///
launching the UI in the prompt method, this class will collect a
ll valid controls from the caller <c>FormRun</c>. This is done by utilizing the
class EventBuildValidAlertFields.
#/// </remarks>
#// This is a framework class. Customizing this class may cause problems
with future upgrades to the software.
#class EventCreateRule extends RunBase
#{
#
FormRun
callerFormRun;
// runtime instance of the caller form
#
Args
callerArgs;
// args
instance from the caller form (must be kept in separate variable for the sake t
hat the caller form is closed before the rule is being created)
#
tableId
callerTableId;
// Tabl
e id for the caller record
#
fieldId
callerFieldId;
// If f

or the selected field in the caller form


#
QueryRun
queryRun;
// Quer
yRun based on Query
#
Query
callerQuery;
// The
caller query
#
FormDataSource
callerFormDataSource;
// The
datasource hosting the selected field in the caller form
#
Dialog
dialog;
// hand
le to the the Create Rule Ui
#
EventRule
eventRuleTmp;
// temp
orary table hosting the record for the Create Rule Ui
#
EventBuildValidAlertFields eventBuildValidAlertFields;
// Hand
le to instance holding a temporary table with valid alert fields
#
List
formDataSourceList;
// List
of formDataSources in dataset
#
boolean
reBuildQuery;
// flag
to indicate that the query is dirty and needs to be rebuilt
#
Object
selectedControl;
// curr
ent selected control in the caller form
#
Map
fds2EventBuildValidAlertFields; // Map
holding valid alert field instances per formDataSource
#
boolean
checkMode;
// Mode
used for checking whether a rule can be created
#
Common
callerRecord;
// The
caller record. This has to be kept in separate variable, so that it will not cha
nge if cursor position changes in the caller form
#
Common
dynaLinkRecord;
// The
caller records dyna link record
#
TmpEventAlertField
tmpEventAlertField;
// Inst
ance representing selected field
#
container
packedEventType;
// Even
tType hierarchy
#
boolean
expandHowOftenControl;
// Must
collapsable FormGroupControls be shown collapsed or expanded
#
boolean
expandWithControl;
// Must
collapsable FormGroupControls be shown collapsed or expanded
#
boolean
expandWhoControl;
// Must
collapsable FormGroupControls be shown collapsed or expanded
#
boolean
expandByControl;
// Must
collapsable FormGroupControls be shown collapsed or expanded
#
EventRuleId
createdRuleId;
// Rule
Id for the created rule in Db
#
FormRun
eventRuleFormRun;
// Hand
le to the EventRule formRun
#
#
#define.CurrentVersion(1)
#
#localmacro.CurrentList
#
expandHowOftenControl,
#
expandWithControl,
#
expandWhoControl,
#
expandByControl
#
#endmacro
#
#}
#
ENDSOURCE
SOURCE #control2DsId
#// This method is used to find the dataSourceId for a formControl
#// The method is 'parent-recursive'. This means that it will traverse
#// parent containers if control does not have the datasource property s

et
#protected Integer control2DsId(
#
Object _formControl
#
)
#{
#
Integer findDsId(boolean _controlHasDaProperty = true)
#
{
#
if (_controlHasDaProperty && _formControl.dataSource())
#
return _formControl.dataSource();
#
else if (_formControl.containerId())
#
return this.control2DsId(callerFormRun.design().control(_fo
rmControl.containerId()));
#
return 0;
#
}
#
;
#
if (!_formControl)
#
return 0;
#
#
switch (_formControl.handle())
#
{
#
case (classnum(FormButtonGroupControl))
:
#
case (classnum(FormCheckBoxControl))
:
#
case (classnum(FormComboBoxControl))
:
#
case (classnum(FormDateControl))
:
#
case (classnum(FormFunctionButtonControl)) :
#
case (classnum(FormGridControl))
:
#
case (classnum(FormGroupControl))
:
#
case (classnum(FormIntControl))
:
#
case (classnum(FormInt64Control))
:
#
case (classnum(FormListBoxControl))
:
#
case (classnum(FormRadioControl))
:
#
case (classnum(FormRealControl))
:
#
case (classnum(FormStaticTextControl))
:
#
case (classnum(FormStringControl))
:
#
case (classnum(FormTabControl))
:
#
case (classnum(FormTabPageControl))
:
#
case (classnum(FormTimeControl))
:
#
case (classnum(FormWindowControl))
:
#
case (classnum(FormDateTimeControl))
:
#
return findDsId();
#
default
:
#
return findDsId(false);
#
}
#
return 0;
#}
ENDSOURCE
SOURCE #cursorHasRecord
#// Since the A4A system supports aggregated fields (pseudo cursors) it
is not enough to test for a recId in the caller record.
#// For pseudo cursors all records in the dataset (several in join scena
rios) must be compared anainst an empty record of the same type.
#// If just one of the records in the pseudo cursor is different from an
empty record, the cursor is passing this test.
#public boolean cursorHasRecord()
#{
#
Common
buffer,empty;
#
MapEnumerator me;
#
;
#
if (!this.isPseudoCursor())
#
return this.parmCallerRecord().RecId ? true : false;

#
#
me = this.eventBuildValidAlertFields(callerFormDataSource).formData
SourceMap().getEnumerator();
#
#
while (me.moveNext())
#
{
#
buffer = me.currentValue().cursor();
#
empty = new SysDictTable(buffer.TableId).makeRecord();
#
if (!bufCmp(buffer,empty))
#
return true;
#
}
#
return false;
#}
ENDSOURCE
SOURCE #dialog
#public Object dialog()
#{
#
;
#
if (!dialog)
#
dialog = super(Dialog::newFormnameRunbase(formstr(EventCreateRu
le),this));
#
return dialog;
#}
#
ENDSOURCE
SOURCE #eventBuildValidAlertFields
#/// <summary>
#///
Returns an instance of the <c>EventBuildValidAlertFields</c> cla
ss that corresponds to the specified <c>FormDataSource</c>. The instance of this
class for a specific <c>FormDataSource</c> is only
#///
instantiated one time and is afterward kept in a <c>Map</c>.
#/// </summary>
#/// <param name="_fds">
#///
The <c>FormDataSource</c> for which a corresponding <c>EventBuil
dValidAlertFields</c> instance is requested.
#/// </param>
#/// <returns>
#///
An instance of the <c>EventBuildValidAlertFields</c> class.
#/// </returns>
#/// <remarks>
#///
For performance reasons, the <c>fds2EventBuildValidAlertFields</
c> map is used.
#/// </remarks>
#public EventBuildValidAlertFields eventBuildValidAlertFields(
#
FormDataSource _fds = callerFormDataSource
#
)
#{
#
if (!fds2EventBuildValidAlertFields)
#
fds2EventBuildValidAlertFields = new Map(Types::Integer,Types::
Class);
#
#
if (!fds2EventBuildValidAlertFields.exists(_fds.id()))
#
fds2EventBuildValidAlertFields.insert(_fds.id(),EventBuildValid
AlertFields::newFormDataSource(callerFormRun,_fds,checkMode));
#
#
return fds2EventBuildValidAlertFields.lookup(_fds.id());
#}
ENDSOURCE
SOURCE #fdsId2qbdsNo
#/// <summary>

#///
Wraps the <c>SysFormDataSource::fds2qbdsNo</c> method. If the <p
aramref name="fdsId" /> parameter is zero, then the ID of the <c>callerFormDataS
ource</c> is used.
#/// </summary>
#/// <param name="_fdsId">
#///
A unique run-time generated ID of a <c>FormDataSource</c>.
#/// </param>
#/// <returns>
#///
The <c>QueryBuildDataSource</c> number in the query that hosts t
he <c>FormDataSource</c>.
#/// </returns>
#public DataSourceNumber fdsId2qbdsNo(
#
Integer _fdsId
#
)
#{
#
return SysFormDataSource::fds2qbdsNo(SysFormDataSource::fdsId2fds(c
allerFormRun,_fdsId ? _fdsId : callerFormDataSource.id()));
#}
ENDSOURCE
SOURCE #fieldsAreInUniqueIndex
#// This method will decide if fieldId's in the set are unique key field
s for the table
#boolean fieldsAreInUniqueIndex(
#
tableId
_tableId,
#
Set
_fields
#
)
#{
#
SysDictTable dictTable = new SysDictTable(_tableId);
#
DictIndex
dictIndex = dictTable.firstUniqueIndex();
#
Integer
i;
#
boolean
tryNext;
#
;
#
while (dictIndex)
#
{
#
tryNext = false;
#
for (i=1;i<=dictIndex.numberOfFields();i++)
#
{
#
if (!_fields.in(dictIndex.field(i)))
#
{
#
dictIndex = dictTable.firstUniqueIndex(dictIndex.id());
#
tryNext = true;
#
break;
#
}
#
}
#
if (!tryNext)
#
return true;
#
}
#
return false;
#}
ENDSOURCE
SOURCE #findValidCallerDS
#// This method will find a valid caller datasource based on priority:
#// 1: If the selected control is a valid alert field, then the associat
ed datasource will be returned
#// 2: If the control (or any of its parents) has a datasource in the da
tasource property, then this datasource will be returned
#// 3: First datasource containing valid alert fields will be returned
#protected FormDataSource findValidCallerDS()
#{
#
FormDataSource fds;

#
Integer
h;
#
container
invalidDSCon;
#
;
#
// Priority 1: if selected control is a field on a datasource with
valid alert fields, then this will be returned
#
if (EventBuildValidAlertFields::isControlTypeValid(selectedControl)
&& selectedControl.dataSource())
#
{
#
fds = SysFormDataSource::fdsId2fds(callerFormRun,selectedContro
l.dataSource());
#
if (fds && fds.queryRun() && this.eventBuildValidAlertFields(fd
s).parmTmpEventAlertField().RecId)
#
return fds;
#
else if (fds)
#
invalidDSCon += fds.id();
#
}
#
// Priority 2: if selected control (or parents to this) has an asso
ciated datasource
#
fds = SysFormDataSource::fdsId2fds(callerFormRun,this.control2DsId
(selectedControl));
#
if (fds && fds.queryRun() && !confind(invalidDSCon,fds.id()))
#
if (this.eventBuildValidAlertFields(fds).parmTmpEventAlertField
().RecId)
#
return fds;
#
else
#
invalidDSCon += fds.id();
#
#
// Priority 3: find first datasource holding valid alert fields
#
for (h=1;h<=callerFormRun.form().dataSourceCount();h++)
#
{
#
fds = callerFormRun.dataSource(h);
#
if (fds.queryRun() && !confind(invalidDSCon,fds.id()))
#
if (this.eventBuildValidAlertFields(fds).parmTmpEventAlertF
ield().RecId)
#
return fds;
#
}
#
return null;
#}
ENDSOURCE
SOURCE #formDataSourceList
#protected List formDataSourceList()
#{
#
FormDataSource joinChild,joinParent;
#
;
#
if (!formDataSourceList)
#
{
#
formDataSourceList = new List(Types::Class);
#
joinChild
= callerFormDataSource;
#
joinParent
= formGetParentDatasource(joinChild);
#
#
formDataSourceList.addStart(joinChild);
#
#
while (joinParent && SysFormDataSource::fdsIsJoined(joinChild))
#
{
#
formDataSourceList.addStart(joinParent);
#
joinChild
= joinParent;
#
joinParent
= formGetParentDatasource(joinChild);
#
}
#
}
#
return formDataSourceList;

#}
ENDSOURCE
SOURCE #getFromDialog
#public boolean getFromDialog()
#{
#
boolean ret;
#
Object object;
#
;
#
select firstonly eventRuleTmp;
#
#
ret
= super();
#
object
= dialog.formRun();
#
object
= object.eventRuleFormHandler();
#
packedEventType = object.packEventType(eventRuleTmp);
#
#
return ret;
#}
ENDSOURCE
SOURCE #initEventRule
#protected boolean initEventRule()
#{
#
#
List actions = new List(Types::Integer);
#
#
actions.addEnd(classnum(EventActionAlert));
#
actions.addEnd(classnum(EventActionEmail));
#
#
#
ttsbegin;
#
#
//BP Deviation Documented
#
eventRuleTmp.setTmp();
#
eventRuleTmp.checkRecord(false);
#
#
eventRuleTmp.Enabled
= NoYes::Yes;
#
eventRuleTmp.UserId
= curuserid();
#
eventRuleTmp.ActionIds
= actions.pack();
#
#
eventRuleTmp.PrimTableId
= this.parentDataSource().cursor().Tabl
eId;
#
eventRuleTmp.AlertFieldId = callerFieldId;
#
eventRuleTmp.AlertTableId = callerTableId ? callerTableId : event
RuleTmp.PrimTableId;
#
eventRuleTmp.AlertQbdsNo
= this.fdsId2qbdsNo(callerFormDataSourc
e.id());
#
eventRuleTmp.FormName
= callerFormRun.name();
#
eventRuleTmp.IsAggregated = this.isPseudoCursor();
#
#
eventRuleTmp.insert();
#
#
ttscommit;
#
#
return true;
#}
ENDSOURCE
SOURCE #initParameters
#protected boolean initParameters()
#{
#
;
#
if (!this.setValidCallerData())

#
return false;
#
#
if (!this.initEventRule())
#
return false;
#
#
reBuildQuery = true;
#
#
return true;
#}
ENDSOURCE
SOURCE #initParmDefault
#public void initParmDefault()
#{
#
super();
#
#
expandHowOftenControl = false;
#
expandWithControl
= true;
#}
ENDSOURCE
SOURCE #isPseudoCursor
#public boolean isPseudoCursor()
#{
#
return this.eventBuildValidAlertFields().isPseudoCursor();
#}
ENDSOURCE
SOURCE #lockUserIdRange
#void lockUserIdRange(Query _query)
#{
#
QueryBuildDataSource qbd;
#
Integer i;
#
Integer h;
#
;
#
for (i=1;i<=_query.dataSourceCount();i++)
#
{
#
qbd = _query.dataSourceNo(i);
#
#
if (qbd.table() ==tablenum(EventRule))
#
{
#
#
for (h=1;h<=qbd.rangeCount();h++)
#
{
#
if (qbd.range(h).name() == 'UserId')
#
{
#
qbd.range(h).status(RangeStatus::Locked);
#
}
#
}
#
#
}
#
}
#}
ENDSOURCE
SOURCE #nonFieldRelatedTmpEventAlertField
#TmpEventAlertField nonFieldRelatedTmpEventAlertField()
#{
#
;
#
tmpEventAlertField = this.eventBuildValidAlertFields().nonFieldRela
tedTmpEventAlertField();
#
return tmpEventAlertField;
#}
ENDSOURCE

SOURCE #pack
#public container pack()
#{
#
return [#CurrentVersion,#CurrentList];
#}
ENDSOURCE
SOURCE #packContextInfo
#protected container packContextInfo(
#
EventRule _eventRule
#
)
#{
#
FormDataSource
fds;
#
EventContextInformation eci = new EventContextInformation();
#
List
l = this.formDataSourceList();
#
ListEnumerator
le;
#
FormControl
fieldControl;
#
if (l && l.elements())
#
{
#
le = l.getEnumerator();
#
le.moveNext();
#
fds = le.current();
#
}
#
fieldControl = tmpEventAlertField.ControlId ? callerFormRun.control
(tmpEventAlertField.ControlId) : null;
#
#
eci.setEventRuleId(_eventRule.RuleId);
#
eci.parmFormRun(callerFormRun);
#
eci.parmPackedArgs(callerArgs);
#
eci.parmAlertFormDsName(fds ? fds.name() : '');
#
eci.parmFormControlName(fieldControl ? fieldControl.name() : '');
#
return eci.pack();
#}
ENDSOURCE
SOURCE #parentDataSource
#protected FormDataSource parentDataSource()
#{
#
ListEnumerator le = this.formDataSourceList().getEnumerator();
#
;
#
le.moveNext(); // parent datasource is first in list
#
return le.current();
#}
ENDSOURCE
SOURCE #parmCallerFormDataSource
#public FormDataSource parmCallerFormDataSource(
#
FormDataSource _callerFormDataSource = callerFormDataSource
#
)
#{
#
;
#
callerFormDataSource = _callerFormDataSource;
#
return callerFormDataSource;
#}
#
ENDSOURCE
SOURCE #parmCallerFormRun
#public FormRun parmCallerFormRun(
#
FormRun _callerFormRun = callerFormRun
#
)
#{
#
;
#
callerFormRun = _callerFormRun;

#
return callerFormRun;
#}
#
ENDSOURCE
SOURCE #parmCallerRecord
#public Common parmCallerRecord(
#
Common _callerRecord = callerRecord
#
)
#{
#
;
#
callerRecord = _callerRecord;
#
return callerRecord;
#}
#
ENDSOURCE
SOURCE #parmCreatedRuleId
#public EventRuleId parmCreatedRuleId(
#
EventRuleId _createdRuleId = createdRuleId
#
)
#{
#
;
#
createdRuleId = _createdRuleId;
#
return createdRuleId;
#}
#
ENDSOURCE
SOURCE #parmDynaLinkRecord
#public Common parmDynaLinkRecord(
#
Common _dynaLinkRecord = dynaLinkRecord
#
)
#{
#
;
#
dynaLinkRecord = _dynaLinkRecord;
#
return dynaLinkRecord;
#}
#
ENDSOURCE
SOURCE #parmEventRuleFormRun
#public FormRun parmEventRuleFormRun(
#
FormRun _eventRuleFormRun = eventRuleFormRun
#
)
#{
#
;
#
eventRuleFormRun = _eventRuleFormRun;
#
return eventRuleFormRun;
#}
#
ENDSOURCE
SOURCE #parmEventRuleTmp
#public EventRule parmEventRuleTmp(
#
EventRule _eventRuleTmp = eventRuleTmp
#
)
#{
#
;
#
eventRuleTmp = _eventRuleTmp;
#
return eventRuleTmp;
#}
#
ENDSOURCE
SOURCE #parmExpandByControl

#public boolean parmExpandByControl(


#
boolean _expandByControl = expandByControl
#
)
#{
#
;
#
expandByControl = _expandByControl;
#
return expandByControl;
#}
ENDSOURCE
SOURCE #parmExpandHowOftenControl
#public boolean parmExpandHowOftenControl(
#
boolean _expandHowOftenControl = expandHowOftenControl
#
)
#{
#
;
#
expandHowOftenControl = _expandHowOftenControl;
#
return expandHowOftenControl;
#}
#
ENDSOURCE
SOURCE #parmExpandWhoControl
#public boolean parmExpandWhoControl(
#
boolean _expandWhoControl = expandWhoControl
#
)
#{
#
;
#
expandWhoControl = _expandWhoControl;
#
return expandWhoControl;
#}
#
ENDSOURCE
SOURCE #parmExpandWithControl
#public boolean parmExpandWithControl(
#
boolean _expandWithControl = expandWithControl
#
)
#{
#
;
#
expandWithControl = _expandWithControl;
#
return expandWithControl;
#}
#
ENDSOURCE
SOURCE #parmRebuildQuery
#public boolean parmRebuildQuery(
#
boolean _rebuildQuery = rebuildQuery
#
)
#{
#
;
#
rebuildQuery = _rebuildQuery;
#
return rebuildQuery;
#}
#
ENDSOURCE
SOURCE #parmTmpEventAlertField
#public TmpEventAlertField parmTmpEventAlertField(
#
TmpEventAlertField _tmpEventAlertField = tmpEventAlertField
#
)
#{
#
;
#
tmpEventAlertField = _tmpEventAlertField;

#
return tmpEventAlertField;
#}
#
ENDSOURCE
SOURCE #prompt
#public boolean prompt()
#{
#
startLengthyOperation();
#
#
if (!this.initParameters())
#
return false;
#
return super();
#}
ENDSOURCE
SOURCE #queryAddDynaCursor
#/// <summary>
#///
Traverses the query of the <c>callerFormDataSource</c>, and for
each dynaLink appends the corresponding field and dyna value to the specified qu
ery.
#/// </summary>
#/// <param name="_query">
#///
Dyna fields and values are added ranges and values to this query
.
#/// </param>
#protected void queryAddDynaCursor(
#
Query _query
#
)
#{
#
QueryBuildDataSource
qbdCur;
#
QueryBuildDataSource
qbdDyna;
#
QueryBuildDynalink
qbDyna;
#
Counter
dynaLinkNo;
#
Integer
queryDsNO;
#
Query
queryDyna;
#
Set
dynaFields;
#
Common
dynaRecord;
#
Map
keyFields;
#
;
#
queryDyna
= callerFormDataSource.queryRun().query(); // query
having external links (=dyna links)
#
queryDsNO = SysFormDataSource::fds2qbdsNo(this.parentDataSource());
// queryBuildDataSource on _queryDyna having external links
#
#
if (!_query || !queryDyna || !queryDsNO || !queryDyna.dataSourceNo(
queryDsNO))
#
return;
#
#
dynaFields = new Set(Types::Integer);
#
#
// Build list of dyna-fields
#
for (dynaLinkNo=1;dynaLinkNo<=queryDyna.dataSourceNo(queryDsNO).dyn
alinkCount();dynaLinkNo++)
#
{
#
qbDyna = queryDyna.dataSourceNo(queryDsNO).dynalink(dynaLinkNo)
;
#
dynaFields.add(qbDyna.dynamicField());
#
}
#
if (dynaFields.elements() && this.fieldsAreInUniqueIndex(qbDyna.cur
sor().TableId,dynaFields))
#
{

#
// Add unique id fields from caller records dynalink record as
ranges+values
#
SysQuery::queryAddDynaCursorAsRangeAndValue(_query,callerFormDa
taSource.queryRun().query(),SysFormDataSource::fds2qbdsNo(this.parentDataSource(
)));
#
}
#
else if (dynaFields.elements())
#
{
#
// Dyna cursor is being inner-joined based on dyna-fields and r
anged down to the unique record
#
dynaRecord = queryDyna.dataSourceNo(queryDsNO).dynalink(1).cur
sor();
#
qbdCur
= _query.dataSourceName(queryDyna.dataSourceNo(quer
yDsNO).name());
#
if (qbdCur)
#
{
#
qbdDyna
= qbdCur.addDataSource(dynaRecord.TableId);
#
qbdDyna.joinMode(JoinMode::ExistsJoin);
#
qbdDyna.clearLinks();
#
keyFields = SysDictTable::mapFieldIds2Values(SysDictTable
::getUniqueIndexFields(dynaRecord.TableId),dynaRecord);
#
SysQuery::addRangesFromKeyData(qbdDyna,keyFields.pack());
#
}
#
}
#}
ENDSOURCE
SOURCE #queryAddUniqueRangeAndValue
#protected void queryAddUniqueRangeAndValue(Query _query)
#{
#
Integer
i,l;
#
QueryBuildDataSource
qbdS;
#
MapEnumerator
me;
#
FormDataSource
fds;
#
QueryBuildRange
qbr;
#
;
#
if (!this.isPseudoCursor())
#
{
#
SysQuery::queryAddUniqueRangeAndValue(_query,callerRecord);
#
return;
#
}
#
#
// For a pseudo cursor: add the value of each 'group by field' as r
ange in the query
#
for (i=1;i<=_query.dataSourceCount();i++)
#
{
#
qbdS = _query.dataSourceNo(i);
#
#
if (qbdS && qbdS.orderMode() == OrderMode::GroupBy)
#
{
#
fds = null;
#
me = this.eventBuildValidAlertFields().formDataSourceMap()
.getEnumerator();
#
#
// find the formDataSource that corresponds to the queryBui
ldDataSource
#
while (me.moveNext())
#
if (SysFormDataSource::fds2qbdsNo(me.currentValue()) ==
qbdS.id())
#
fds = me.currentValue();
#

#
if (fds)
#
{
#
for (l=1;l<=qbdS.sortFieldCount();l++)
#
{
#
if (fds.cursor().(qbdS.sortField(l))) // only 'gro
up by fields' holding a value will be added
#
{
#
qbr = SysQuery::findOrCreateRange(qbdS,qbdS.sor
tField(l));
#
qbr.value(queryValue(fds.cursor().(qbdS.sortFie
ld(l))));
#
}
#
}
#
}
#
}
#
}
#}
ENDSOURCE
SOURCE #queryrun
#// This method will return a QueryRun that is manipulated so that it re
flects current "Rule Condition"
#QueryRun queryrun()
#{
#
EventRule eventRuleTest;
#
Query
newQuery;
#
;
#
if (!rebuildQuery)
#
return queryRun;
#
#
//BP Deviation Documented
#
eventRuleTest.setTmp();
#
eventRuleTest.setTmpData(eventRuleTmp);
#
#
select firstonly eventRuleTest;
#
#
if (eventRuleTest.RuleCondition == EventRuleCondition::Current)
#
{
#
newQuery = new Query(callerFormDataSource.queryRun().query().pa
ck(false));
#
this.queryAddUniqueRangeAndValue(newQuery);
#
}
#
else
#
{
#
if (eventRuleTest.TypeId && !EventType::construct(eventRuleTest
.TypeId,eventRuleTest.TypeTrigger).isFilterInteractive())
#
{
#
newQuery = new Query();
#
newQuery.addDataSource(eventRuleTest.AlertTableId ? eventRu
leTest.AlertTableId : eventRuleTest.PrimTableId);
#
}
#
else
#
{
#
newQuery = new Query(callerFormDataSource.queryRun().query(
).pack(false));
#
this.queryAddDynaCursor(newQuery);
#
if (eventRuleTest.RuleCondition == EventRuleCondition::Cust
om)
#
this.setAllRanges2Open(newQuery);
#
}
#
}

#
#
this.lockUserIdRange(newQuery);
#
#
rebuildQuery = false;
#
queryRun = new QueryRun(newQuery);
#
return queryRun;
#}
ENDSOURCE
SOURCE #run
#/// <summary>
#///
Inserts a new rule into the database.
#/// </summary>
#/// <remarks>
#///
Records are inserted in the following tables:
#///
#///
<list type="bullet">
#///
<item>
#///
<description>EventRuleData
#///
</description>
#///
</item>
#///
<item>
#///
<description>EventRuleRel
#///
</description>
#///
</item>
#///
<item>
#///
<description>EventRuleRelData
#///
</description>
#///
</item>
#///
<item>
#///
<description>EventRuleField
#///
</description>
#///
</item>
#///
</list>
#/// </remarks>
#public void run()
#{
#
#OCCRetryCount
#
EventRule
eventRuleDB;
#
#
// KeSae : 21/04/2010 : Alerting multiple mail recipients
#
EventRuleId
oldRuleId;
#
;
#
#
try
#
{
#
ttsbegin;
#
#
select firstonly eventRuleTmp;
#
#
eventRuleDB.data(eventRuleTmp);
#
eventRuleDB.setDeleteRefRecId(callerRecord);
#
#
// KeSae : 21/04/2010 : Alerting multiple mail recipients
#
oldRuleId = eventRuleDB.RuleId;
#
#
eventRuleDB.RuleId = this.parmCreatedRuleId();
#
eventRuleDB.insert();
#
eventRuleDB.filterQuery(this.queryrun().query());
#
eventRuleDB.alertField([tmpEventAlertField]);
#
eventRuleDB.typeValue(packedEventType);

#
#
#
#
#
#

eventRuleDB.contextInfo(this.packContextInfo(eventRuleDB));
this.parmCreatedRuleId(eventRuleDB.RuleId);

// KeSae : 21/04/2010 : Alerting multiple mail recipients


// Since the RuleId changes during this process, update the lin
k in the recipient table
#
NVMPEventRuleRecipients::updateRuleIdLink(oldRuleId, eventRuleD
B.RuleId);
#
#
ttscommit;
#
#
this.checkForeignKey();
#
}
#
catch (Exception::Deadlock)
#
{
#
retry;
#
}
#
catch (Exception::UpdateConflict)
#
{
#
if (appl.ttsLevel() == 0)
#
{
#
if (xSession::currentRetryCount() >= #RetryNum)
#
{
#
throw Exception::UpdateConflictNotRecovered;
#
}
#
else
#
{
#
retry;
#
}
#
}
#
else
#
{
#
throw Exception::UpdateConflict;
#
}
#
}
#
#}
ENDSOURCE
SOURCE #setAllRanges2Open
#/// <summary>
#///
Traverses all ranges on the specified query. All ranges that hav
e the <c>RangeStatus</c> set to <c>Hidden</c> or <c>Locked</c> will be changed t
o have the <c>RangeStatus</c> set to <c>Open</c>.
#/// </summary>
#/// <param name="_query">
#///
A query with ranges.
#/// </param>
#void setAllRanges2Open(Query _query)
#{
#
QueryBuildDataSource qbd;
#
Integer i;
#
Integer h;
#
;
#
for (i=1;i<=_query.dataSourceCount();i++)
#
{
#
qbd = _query.dataSourceNo(i);
#
for (h=1;h<=qbd.rangeCount();h++)
#
if (qbd.range(h).status() == RangeStatus::Hidden || qbd.ran
ge(h).status() == RangeStatus::Locked)

#
qbd.range(h).status(RangeStatus::Open);
#
}
#}
ENDSOURCE
SOURCE #setValidCallerData
#// This method is used to set all initialization from caller
#// Everything must be stored in separate variables, i.e. it can not be
addressed via
#// references as the active caller record may change during Create Rule
scenario or the form may be closed!!
#protected boolean setValidCallerData()
#{
#
;
#
callerArgs
= callerFormRun.args();
#
selectedControl = callerFormRun.selectedControl();
#
#
if (!selectedControl)
#
return false;
#
#
if (!callerFormRun.form().dataSourceCount())
#
return false;
#
#
callerFormDataSource = this.findValidCallerDS();
#
#
if (!callerFormDataSource)
#
return false;
#
#
callerRecord = this.parentDataSource().cursor();
#
dynaLinkRecord = SysFormDataSource::fds2DynaLinkRecord(this.parentD
ataSource());
#
#
if (selectedControl)
#
{
#
// first attempt: find the tmpEventAlertField record that corre
sponds to the ID of the selected control
#
tmpEventAlertField = this.eventBuildValidAlertFields(callerFor
mDataSource).controlId2TmpEventAlertField(selectedControl.id());
#
// second attempt: find the tmpEventAlertField record that corr
esponds to the label of the selected control
#
tmpEventAlertField = tmpEventAlertField ? tmpEventAlertField :
this.eventBuildValidAlertFields(callerFormDataSource).label2TmpEventAlertField(
selectedControl.labelText());
#
}
#
// third attempt: find the tmpEventAlertField record that correspon
ds to the '<All fields>' entry
#
tmpEventAlertField = tmpEventAlertField ? tmpEventAlertField : thi
s.eventBuildValidAlertFields(callerFormDataSource).entireTable2TmpEventAlertFiel
d();
#
// foruth attempt: find the first tmpEventAlertField record in alph
abetical order
#
tmpEventAlertField = tmpEventAlertField ? tmpEventAlertField : thi
s.eventBuildValidAlertFields(callerFormDataSource).first2TmpEventAlertField();
#
#
if (!tmpEventAlertField)
#
return false;
#
#
callerQuery
= callerFormDataSource.queryRun().query();
#
callerFieldId
= fieldExt2Id(tmpEventAlertField.RefFieldId);
#
callerTableId
= callerFormDataSource.cursor().TableId;
#

#
return true;
#}
ENDSOURCE
SOURCE #showIndexFields
#public boolean showIndexFields(tableId id)
#{
#
return false;
#}
ENDSOURCE
SOURCE #showQueryValues
#public boolean showQueryValues()
#{
#
return true;
#}
ENDSOURCE
SOURCE #unpack
#public boolean unpack(container packedClass)
#{
#
Version version = RunBase::getVersion(packedClass);
#;
#
switch (version)
#
{
#
case #CurrentVersion:
#
[version,#CurrentList] = packedClass;
#
break;
#
default:
#
return false;
#
}
#
#
return true;
#}
ENDSOURCE
SOURCE #construct
#/// <summary>
#///
Constructs an instance of the class.
#/// </summary>
#/// <returns>
#///
An instance of the <c>EventCreateRule</c> class.
#/// </returns>
#/// <remarks>
#///
The instance is forced on the client tier in this method.
#/// </remarks>
#static client EventCreateRule construct()
#{
#
return new EventCreateRule();
#}
ENDSOURCE
SOURCE #Main
#static void main(
#
Args _args
#
)
#{
#
EventCreateRule eventCreateRule;
#
Object
eventRuleFormRun;
#
;
#
if (_args && _args.caller() && _args.caller().name() == formstr(Eve
ntRule) && _args.caller().parmCreateRuleFormRun())
#
{
#
eventRuleFormRun
= _args.caller();
#
eventCreateRule
= EventCreateRule::construct();

#
eventCreateRule.parmEventRuleFormRun(eventRuleFormRun);
#
eventCreateRule.parmCallerFormRun(eventRuleFormRun.parmCreateRu
leFormRun());
#
if (eventCreateRule.prompt())
#
{
#
eventCreateRule.run();
#
eventRuleFormRun.doReselectFind(eventCreateRule.parmCreated
RuleId());
#
}
#
else
#
{
#
eventRuleFormRun.close();
#
}
#
}
#}
ENDSOURCE
SOURCE #newCheckFormRun
#/// <summary>
#///
Determines whether a specified <c>FormRun</c> is valid for creat
ing rules.
#/// </summary>
#/// <param name="_formRun">
#///
The <c>FormRun</c> instance that is to be checked.
#/// </param>
#/// <returns>
#///
true if the specified <c>FormRun</c> is valid for creating rules
; otherwise, false.
#/// </returns>
#/// <remarks>
#///
This method instantiates the class without calling the standard
<c>Prompt</c> method or <c>Run</c> method.
#///
This method is typically used for UI purposes; for example, to d
ecide whether to display
#///
the Create Alert Rule menu item in the right-click menu.
#/// </remarks>
#public static boolean newCheckFormRun(
#
FormRun _formRun
#
)
#{
#
EventCreateRule eventCreateRule = EventCreateRule::construct();
#
;
#
eventCreateRule.parmCallerFormRun(_formRun);
#
return eventCreateRule.canCreateRule();
#}
ENDSOURCE
SOURCE #newFindMainTableLabelFormRun
#public static client TableLabel newFindMainTableLabelFormRun(
#
FormRun _formRun
#
)
#{
#
TableLabel
mainTableLabel;
#
EventCreateRule eventCreateRule = EventCreateRule::construct();
#
;
#
eventCreateRule.parmCallerFormRun(_formRun);
#
if (eventCreateRule.canCreateRule() && eventCreateRule.parentDataSo
urce())
#
mainTableLabel = new SysDictTable(eventCreateRule.parentDataSou
rce().table()).label();
#
return mainTableLabel;
#}

ENDSOURCE
ENDMETHODS
ENDCLASS
***Element: FRM
; Microsoft Dynamics AX Forms unloaded
; ------------------------------------------------------------------------------FRMVERSION 5
FORM #EventCreateRule
PROPERTIES
Name
ENDPROPERTIES

#EventCreateRule

METHODS
Version: 3
SOURCE #classDeclaration
#public class FormRun extends ObjectRun
#{
#
EventCreateRule
eventCreateRule;
#
EventRuleFormHandler
eventRuleFormHandler;
#
NoYes
adminMode;
#
#
SysUserInfo userInfo;
#
#
EventPopupShowDefineMode showPopUp;
#
EventEmailSendDefineMode sendEmail;
#
#
#
#Define.maxAlertMeForStr(100)
#
#Define.numberOfDotsOnTruncate(4)
#}
ENDSOURCE
SOURCE #canClose
#public boolean canClose()
#{
#
boolean ret;
#
;
#
if (!element.closedOk())
#
return true;
#
#
ret = super();
#
#
ret = ret && eventRule.checkFilterAccess(element.runBase().queryrun()
.query().pack());
#
#
return ret;
#}
ENDSOURCE
SOURCE #close
#public void close()
#{
#
element.runBase().parmExpandHowOftenControl(alertMeHowOften.expand())
;
#
element.runBase().parmExpandWithControl(alertMeWith.expand());
#
element.runBase().parmExpandWhoControl(alertWho.expand());
#
element.runBase().parmExpandByControl(alertBy.expand());
#

#
super();
#}
ENDSOURCE
SOURCE #initFormControls
#void initFormControls()
#{
#
#
boolean canShowEmailCheckBox = (userInfo.EventEmailAlertsWhen == Even
tEmailSendDefineMode::DefinedOnRule) &&
#
userInfo.Email &&
#
SysEmailDistributor::validateEmail(us
erInfo.Email) &&
#
(element.eventRuleFormHandler().parmPr
imTableId() != tablenum(SysOutgoingEmailTable)) &&
#
(element.eventRuleFormHandler().parmPr
imTableId() != tablenum(SysOutgoingEmailData));
#
#
boolean canShowPopUpCheckBox = userInfo.EventPopUpDisplayWhen == Eve
ntPopupShowDefineMode::DefinedOnRule;
#
#
;
#
#
alertMeHowOften.expand(element.runBase().parmExpandHowOftenControl())
;
#
if (!alertMeHowOften.expand())
#
alertMeHowOften.clicked();
#
#
alertMeWith.expand(element.runBase().parmExpandWithControl());
#
if (!alertMeWith.expand())
#
alertMeWith.clicked();
#
#
alertWho.expand(element.runBase().parmExpandWhoControl());
#
if (!alertWho.expand())
#
alertWho.clicked();
#
#
alertBy.expand(element.runBase().parmExpandByControl());
#
if (!alertBy.expand())
#
alertBy.clicked();
#
#
if (!canShowPopUpCheckBox && !canShowEmailCheckBox)
#
alertBy.visible(false);
//make invisible the entire group
#
else if (!canShowPopUpCheckBox)
#
eventRule_ShowPopUp.visible(false);
#
else if (!canShowEmailCheckBox)
#
{
#
eventRule_SendEmail.visible(false);
#
eventRule_SendEmailAddress.visible(false);
#
}
#
else
#
eventRule_SendEmailAddress.text(userInfo.Email);
#
#}
ENDSOURCE
SOURCE #truncateAlertMeForStr
#str 200 truncateAlertMeForStr(str 200 _inputStr)
#{
#
str 200 outputStr;
#
int
i;
#
;
#
if (strlen(_inputStr) < #maxAlertMeForStr)

#
#
#

return _inputStr;
outputStr = substr(_inputStr,1,#maxAlertMeForStr-#numberOfDotsOnTrunc

ate);
#
#
for (i=1;i<=#numberOfDotsOnTruncate;i++)
#
outputStr += '.';
#
return outputStr;
#}
ENDSOURCE
SOURCE #closeOk
#public void closeOk()
#{
#
if (this.runBase().checkCloseDialog())
#
super();
#}
#
ENDSOURCE
SOURCE #eventRuleFormHandler
#EventRuleFormHandler eventRuleFormHandler()
#{
#
return eventRuleFormHandler;
#}
ENDSOURCE
SOURCE #initFromCaller
#void initFromCaller()
#{
#
TmpEventAlertField tmpEventAlertField;
#
;
#
if (!eventRule.RecId)
#
return;
#
#
tmpEventAlertField = element.runBase().parmTmpEventAlertField();
#
#
eventRule.initFromTmpEventAlertField(tmpEventAlertField);
#
eventRuleFormHandler.setEventType(eventRule,tmpEventAlertField);
#
#
element.design().caption(strfmt("%1 - %2",element.design().caption(),
eventRule.primTableLabel()));
#
#//
eventRule_ds.setInfoTxt(eventRule);
#//
eventRule_ds.setFilterButton(eventRule);
#
eventRule_ds.initRuleCondition(eventRule);
#}
ENDSOURCE
SOURCE #run
#public void run()
#{
#
element.lock();
#
super();
#
this.initFromCaller();
#
element.initFormControls();
#
element.unLock();
#
element.arrange();
#}
ENDSOURCE
SOURCE #init
#public void init()
#{
#

#
SysDictMenu sysDictMenu = SysDictMenu::newMenuItem(menuitemdisplaystr
(EventRuleAdmin), MenuItemType::Display);
#
;
#
#
adminMode
= EventSecurity::construct(curuserid()).isUserAd
min() ? NoYes::Yes : NoYes::No;
#
eventCreateRule
= element.args().caller().runbase();
#
super();
#
eventRuleFormHandler = EventRuleFormHandler::newFormRun(element,x_str
ing,x_integer,x_combo,x_date,x_real,x_time,x_int64,x_dateTime);
#
eventRuleFormHandler.parmPrimTableId(element.runBase().parmEventRuleT
mp().PrimTableId);
#
#
userInfo = SysUserInfo::find(curuserid());
#
#
showPopUp = userInfo.EventPopUpDisplayWhen;
#
sendEmail = userInfo.EventEmailAlertsWhen;
#
#
eventRule_ds.object(fieldnum(EventRule,UserId)).visible(adminMode &&
(sysDictMenu.rights() > AccessType::View));
#
alertWho.visible(adminMode && (sysDictMenu.rights() > AccessType::Vie
w));
#
#
eventRuleFormHandler.parmIsPseudoCursor(element.runBase().isPseudoCur
sor());
#}
ENDSOURCE
SOURCE #runBase
#EventCreateRule runBase()
#{
#
return eventCreateRule;
#}
ENDSOURCE
ENDMETHODS
OBJECTBANK
PROPERTIES
ENDPROPERTIES
DATASOURCE
OBJECTPOOL
PROPERTIES
Name
Table
AllowCreate
AllowDelete
LinkType
InsertAtEnd
InsertIfEmpty
ENDPROPERTIES

#EventRule
#EventRule
#No
#No
#Passive
#No
#No

FIELDLIST
DATAFIELD RuleCondition
PROPERTIES
ENDPROPERTIES
METHODS
Version: 3
SOURCE #validate
#public boolean validate()
#{

#
boolean ret;
#
#
ret = super();
#
#
if (eventRule.RuleCondition == EventRuleCondition::Current
&& !element.runBase().parmCallerRecord().RecId)
#
ret = false;
#
#
if (ret && eventRule.RuleCondition == EventRuleCondition::C
ustom && !eventRule.isFilterInteractive())
#
ret = false;
#
#
if (ret && eventRule.RuleCondition == EventRuleCondition::C
urrent && element.eventRuleFormHandler().parmTmpEventType().TypeId == classnum(E
ventTypeCUD) &&
#
element.eventRuleFormHandler().parmTmpEventType().TypeT
rigger == EventTypeTrigger::RecordInsert)
#
ret = false;
#
#
return ret;
#}
ENDSOURCE
SOURCE #modified
#public void modified()
#{
#
super();
#
eventRule_ds.write();
#
element.runBase().parmRebuildQuery(true);
#
eventRule_ds.setUntil(eventRule);
#}
ENDSOURCE
ENDMETHODS
ENDDATAFIELD
DATAFIELD Subject
PROPERTIES
ENDPROPERTIES
METHODS
Version: 3
SOURCE #modified
#public void modified()
#{
#
super();
#
eventRuleFormHandler.parmSubjectAutoUpdate(eventRule.Subjec
t ? false : true);
#}
ENDSOURCE
ENDMETHODS
ENDDATAFIELD
DATAFIELD Until
PROPERTIES
ENDPROPERTIES
METHODS
Version: 3
SOURCE #validate
#public boolean validate()
#{

#
#
#
#
#

boolean ret;
ret = super();
if (eventRule.RuleCondition == EventRuleCondition::Current

&&
#
element.eventRuleFormHandler().parmTmpEventType().TypeI
d == classnum(EventTypeCUD) &&
#
element.eventRuleFormHandler().parmTmpEventType().TypeT
rigger == EventTypeTrigger::RecordDelete &&
#
eventRule.Until == EventUntil::Always
#
)
#
{
#
ret = false;
#
}
#
return ret;
#}
ENDSOURCE
SOURCE #modified
#public void modified()
#{
#
super();
#
eventRule.UntilDate = eventRule.Until == EventUntil::UntilD
ate ? today() : dateNull();
#
eventRule_ds.object(fieldnum(EventRule,UntilDate)).allowEdi
t(eventRule.Until == EventUntil::UntilDate ? true : false);
#
eventRule_ds.refresh();
#}
#
#
ENDSOURCE
ENDMETHODS
ENDDATAFIELD
DATAFIELD UntilDate
PROPERTIES
AllowEdit
ENDPROPERTIES

#No

METHODS
Version: 3
SOURCE #validate
#public boolean validate()
#{
#
boolean ret;
#
#
ret = super();
#
#
if (ret && eventRule.Until == EventUntil::UntilDate)
#
ret = eventRule.UntilDate < today() || !eventRule.Until
Date ? checkFailed(strfmt("@SYS70843","@SYS22882")) : true;
#
#
return ret;
#}
ENDSOURCE
ENDMETHODS
ENDDATAFIELD
DATAFIELD UserId
PROPERTIES

ENDPROPERTIES
METHODS
Version: 3
SOURCE #validate
#public boolean validate()
#{
#
boolean ret;
#
#
ret = super();
#
#
startLengthyOperation();
#
#
ret = ret && eventRule.checkFilterAccess(element.runBase().
queryrun().query().pack());
#
#
return ret;
#}
ENDSOURCE
ENDMETHODS
ENDDATAFIELD
ENDFIELDLIST
ENDOBJECTPOOL
METHODS
Version: 3
SOURCE #write
#public void write()
#{
#
;
#
#
eventRule.ShowPopup = eventRule_ShowPopUp.checked();
#
eventRule.SendEmail = eventRule_SendEmail.checked();
#
#
super();
#}
ENDSOURCE
SOURCE #active
#public int active()
#{
#
int ret;
#
;
#
#
eventRule_ds.object(fieldnum(EventRule,UntilDate)).allowEdit(even
tRule.Until == EventUntil::UntilDate ? true : false);
#
#
ret = super();
#
#
return ret;
#}
ENDSOURCE
SOURCE #initRuleCondition
#void initRuleCondition(
#
EventRule _eventRule
#
)
#{
#
str 200
strAll;
#
str 200
strCurrent;
#
str 200
strCustom;
#
SysDictTable
curDictTable;

#
#
#
#
#

SysDictTable
TableLabel
TableLabel
TableLabel
Common

callerDictTable;
curTableLabel;
curTitleFields;
callerTitleFields;
dynaRecord
= element.runBase().parmDynaLinkR

Common

callerRecord

ecord();
= element.runBase().parmCallerRec

ord();
#
Query
aggregatedQuery;
#
Map
qBds2GroupByFields;
#
MapEnumerator me,me2;
#
QueryBuildDataSource qBds;
#
List
fieldList;
#
ListEnumerator le;
#
FormDataSource fds;
#
;
#
if (_eventRule.PrimTableId)
#
{
#
curDictTable
= new SysDictTable(_eventRule.PrimTableId);
#
curTableLabel = curDictTable.label() ? curDictTable.label()
: '<' + curDictTable.name() + '>';
#
#
// Build the 'All' entry
#
if (dynaRecord.RecId && _eventRule.isFilterInteractive())
#
{
#
callerDictTable
= new SysDictTable(dynaRecord.TableId)
;
#
#
callerTitleFields = callerDictTable.titleField1() && dyn
aRecord.(callerDictTable.titleField1())
#
? '(' + strfmt("%1: %2",new SysDictF
ield(callerDictTable.id(),callerDictTable.titleField1()).label(),dynaRecord.(cal
lerDictTable.titleField1()))
#
: '';
#
callerTitleFields += callerDictTable.titleField2() && dyn
aRecord.(callerDictTable.titleField2())
#
? callerTitleFields
#
? ', ' + strfmt("%1: %2",new Sys
DictField(callerDictTable.id(),callerDictTable.titleField2()).label(),dynaRecord
.(callerDictTable.titleField2())) + ')'
#
: '(' + strfmt("%1: %2",new SysD
ictField(callerDictTable.id(),callerDictTable.titleField2()).label(),dynaRecord.
(callerDictTable.titleField2())) + ')'
#
: (callerTitleFields ? ')' : '');
#
#
strAll = strfmt("@SYS90569",curTableLabel,callerTitleFiel
ds);
#
}
#
else
#
strAll = strfmt("@SYS90557",curTableLabel);
#
#
alertMeForRadio.add(element.truncateAlertMeForStr(strAll));
#
#
// Build the 'Current' entry
#
curTitleFields = curDictTable.titleField1() && callerRecord.
(curDictTable.titleField1())
#
? ' (' + strfmt("%1: %2",new SysDictField(c
urDictTable.id(),curDictTable.titleField1()).label(),callerRecord.(curDictTable.
titleField1()))
#
: '';

#
#
if (_eventRule.IsAggregated)
#
{
#
aggregatedQuery = element.runBase().parmCallerFormDataSou
rce().queryRun().query();
#
qBds2GroupByFields = Map::create(EventRuleData::query2gro
upByMap(aggregatedQuery));
#
me = qBds2GroupByFields.getEnumerator();
#
while (me.moveNext())
#
{
#
qBds = aggregatedQuery.dataSourceNo(me.currentKey());
#
fieldList = List::create(me.currentValue());
#
le = fieldList.getEnumerator();
#
while (le.moveNext())
#
{
#
if (qBds.table() == callerRecord.TableId && curDi
ctTable.titleField1() && callerRecord.(curDictTable.titleField1()) && le.current
() == curDictTable.titleField1())
#
continue; // avoid dublicating the title fiel
d if also used as group by field
#
#
fds = null;
#
me2 = element.runBase().eventBuildValidAlertFiel
ds().formDataSourceMap().getEnumerator();
#
#
while (me2.moveNext())
#
if (SysFormDataSource::fds2qbdsNo(me2.current
Value()) == qBds.id())
#
fds = me2.currentValue();
#
#
if (fds && fds.cursor().(le.current()))
#
{
#
curTitleFields += curTitleFields ? ', ' : ' (
';
#
curTitleFields += strfmt("%1: %2",new SysDict
Field(fds.cursor().TableId,le.current()).label(),fds.cursor().(le.current()));
#
}
#
}
#
}
#
curTitleFields += curTitleFields ? ')' : '';
#
}
#
else
#
{
#
#
curTitleFields += curDictTable.titleField2() && callerRecord.
(curDictTable.titleField2())
#
? curTitleFields
#
? ', ' + strfmt("%1: %2",new SysDictFie
ld(curDictTable.id(),curDictTable.titleField2()).label(),callerRecord.(curDictTa
ble.titleField2())) + ')'
#
: ' (' + strfmt("%1: %2",new SysDictFie
ld(curDictTable.id(),curDictTable.titleField2()).label(),callerRecord.(curDictTa
ble.titleField2())) + ')'
#
: (curTitleFields ? ')' : '');
#
}
#
#
#
strCurrent = strfmt("@SYS90558",curTableLabel,curTitleFields)
;
#
alertMeForRadio.add(element.truncateAlertMeForStr(strCurrent)

);
#
#
#
#
#

// Build the 'Custom' entry


strCustom = strfmt("@SYS90559",curTableLabel);
alertMeForRadio.add(element.truncateAlertMeForStr(strCustom))

;
#
}
#
alertMeForRadio.selection(0);
#}
#
ENDSOURCE
SOURCE #setUntil
#void setUntil(
#
EventRule _eventRule
#
)
#{
#
if (_eventRule.RuleCondition == EventRuleCondition::Current &&
#
element.eventRuleFormHandler().parmTmpEventType().TypeId == c
lassnum(EventTypeCUD) &&
#
element.eventRuleFormHandler().parmTmpEventType().TypeTrigger
== EventTypeTrigger::RecordDelete
#
)
#
{
#
_eventRule.Until = EventUntil::Always;
#
eventRule_ds.object(fieldnum(EventRule,UntilDate)).allowEdit(
eventRule.Until == EventUntil::UntilDate ? true : false);
#
eventRule_ds.refresh();
#
}
#}
ENDSOURCE
SOURCE #setRuleCondition
#void setRuleCondition(
#
EventRule _eventRule
#
)
#{
#
if ((_eventRule.RuleCondition == EventRuleCondition::Current && !
element.runBase().parmCallerRecord().RecId) ||
#
(_eventRule.RuleCondition == EventRuleCondition::Custom && !
_eventRule.isFilterInteractive())
||
#
(_eventRule.RuleCondition == EventRuleCondition::Current && e
lement.eventRuleFormHandler().parmTmpEventType().TypeId == classnum(EventTypeCUD
)&&
#
element.eventRuleFormHandler().parmTmpEventType().TypeTrigg
er == EventTypeTrigger::RecordInsert)
#
)
#
{
#
alertMeForRadio.selection(EventRuleCondition::All);
#
alertMeForRadio.selectionChange();
#
}
#
eventRule_ds.refresh();
#}
ENDSOURCE
SOURCE #init
#public void init()
#{
#
super();
#
#
//BP Deviation Documented
#
eventRule.setTmp();

#
eventRule.setTmpData(element.runBase().parmEventRuleTmp());
#
eventRule.checkRecord(false);
#
#}
ENDSOURCE
SOURCE #eventType
#//BP Deviation documented
#edit EventTypeDescriptionRich eventType(
#
boolean
_set,
#
EventRule
_eventRule,
#
EventTypeDescriptionRich
_curEventTypeDescription
#
)
#{
#
EventTypeDescriptionRich
curEventTypeDescription;
#
#
if (_set)
#
element.runBase().parmRebuildQuery(true);
#
#
curEventTypeDescription = eventRuleFormHandler.eventType(_set,_ev
entRule,element.runBase(),_curEventTypeDescription);
#
#
if (_set)
#
{
#
eventRule_ds.setRuleCondition(_eventRule);
#
eventRule_ds.setUntil(_eventRule);
#
}
#
return curEventTypeDescription;
#}
#
ENDSOURCE
SOURCE #alertField
#//BP Deviation documented
#edit EventFieldLabelRich alertField(
#
boolean
_set,
#
EventRule
_eventRule,
#
EventFieldLabelRich
_alertFieldLabel
#
)
#{
#
TmpEventAlertField tmpEventAlertField;
#
;
#
if (_set)
#
{
#
tmpEventAlertField = element.runBase().alertFieldChange(_aler
tFieldLabel);
#
_eventRule.initFromTmpEventAlertField(tmpEventAlertField);
#
_eventRule.AlertQbdsNo = element.runBase().fdsId2qbdsNo(tmpEv
entAlertField.DataSourceId);
#
eventRuleFormHandler.setEventType(_eventRule,tmpEventAlertFie
ld);
#
eventRuleFormHandler.setSubject(_eventRule);
#
eventRule_ds.setRuleCondition(_eventRule);
#
return tmpEventAlertField.Label;
#
}
#
return element.runBase().parmTmpEventAlertField().Label;
#}
ENDSOURCE
ENDMETHODS
ENDDATASOURCE
ENDOBJECTBANK

JOINS
ENDJOINS
DESIGN
PROPERTIES
Caption
HideToolbar
HTMLHelpFile
HTMLHelpTopic
c2c.htm
StatusBarStyle
ENDPROPERTIES

#@SYS87774
#Yes
#HTMLHelpFileIWorker
#AxShared.chm::/html/257e6efa-0176-4acf-a61b-427dd68f4
#Simple

CONTAINER
CONTROL GROUP
PROPERTIES
Name
HTMLHelpFile
HTMLHelpTopic
FrameType
ENDPROPERTIES

#OuterFrame
#HTMLHelpFileAxShared
#html/5C9B176F-1D84-465D-A590-78657FBF4784.htm
#None

CONTAINER
CONTROL GROUP
PROPERTIES
Name
Width
HTMLHelpFile
HTMLHelpTopic

#AlertMeWhen
#Column width
#HTMLHelpFileAxShared
#html/961D46BC-8066-4464-90AC-C77126872821.h

tm
Caption
#@SYS87775
Columns
#2
ArrangeGuide
ARRAY INDEX Columns
#0
#0
ENDARRAY
ENDPROPERTIES
CONTAINER
CONTROL GROUP
PROPERTIES
Name
HTMLHelpFile
HTMLHelpTopic

#AlertMeWhen_Left
#HTMLHelpFileAxShared
#html/66E4019F-38B8-4A28-9461-E190CBE1

BD81.htm
FrameType
DataSource
ENDPROPERTIES
CONTAINER
CONTROL STRINGEDIT
PROPERTIES
Name
DataSource
Mandatory
DataMethod
ENDPROPERTIES

#None
#EventRule

METHODS

#alertField
#EventRule
#Yes
#alertField

Version: 3
SOURCE #validate
#public boolean validate()
#{
#
boolean ret;
#
#
ret = super();
#
#
ret = ret && element.runBase().checkAlertFiel
d(this.text());
#
#
return ret;
#}
ENDSOURCE
SOURCE #performFormLookup
#public void performFormLookup(FormRun _formRun)
#{
#
FormDataSource
formDataSource = _for
mRun.objectSet();
#
QueryBuildDataSource
qbd
= SysF
ormDataSource::fds2Qbds(formDataSource);
#
;
#
qbd.addSortField(fieldnum(TmpEventAlertField,
EntireTableEntry));
#
qbd.addSortField(fieldnum(TmpEventAlertField,
Label));
#
formDataSource.cursor().setTmpData(element.ru
nBase().eventBuildValidAlertFields().parmTmpEventAlertField());
#
formDataSource.removeFilter();
#
super(_formRun);
#}
ENDSOURCE
ENDMETHODS
ENDCONTROL
CONTROL STRINGEDIT
PROPERTIES
Name
DataSource
DataMethod
ENDPROPERTIES

#eventType
#EventRule
#eventType

METHODS
Version: 3
SOURCE #validate
#public boolean validate()
#{
#
boolean ret;
#
#
ret = super();
#
#
ret = ret && eventRuleFormHandler.checkEventT
ype(eventRule,element.runBase().parmTmpEventAlertField(),this.text());
#
#
return ret;
#}
ENDSOURCE
SOURCE #performFormLookup
#public void performFormLookup(FormRun _formRun)
#{

FormDataSource

formDataSource = _for

mRun.objectSet();
#
QueryBuildDataSource
qbd
= SysF
ormDataSource::fds2Qbds(formDataSource);
#
;
#
qbd.addSortField(fieldnum(TmpEventType,Descri
ption));
#
formDataSource.cursor().setTmpData(eventRuleF
ormHandler.eventBuildValidEventTypeList(element.runBase().parmTmpEventAlertField
().RefTableId,element.runBase().parmTmpEventAlertField().RefFieldId).parmTmpEven
tType());
#
formDataSource.removeFilter();
#
super(_formRun);
#}
ENDSOURCE
ENDMETHODS
ENDCONTROL
ENDCONTAINER
ENDCONTROL
CONTROL GROUP
PROPERTIES
Name
Width
HTMLHelpFile
HTMLHelpTopic

#AlertMeWhen_Right
#Column width
#HTMLHelpFileAxShared
#html/6470FA7E-11EE-497C-9731-0E44263F

90B6.htm
FrameType
DataSource
ENDPROPERTIES

#None
#EventRule

CONTAINER
CONTROL STRINGEDIT
PROPERTIES
Name
AllowEdit
Width
Skip
LookupButton
ShowLabel
DataSource
DataMethod
ENDPROPERTIES

#primTable
#No
#Column width
#Yes
#Hidden (but reserve space)
#No
#EventRule
#primTableLabel

ENDCONTROL
CONTROL STRINGEDIT
PROPERTIES
Name
AutoDeclaration
Width
LookupButton
ShowLabel
ENDPROPERTIES
METHODS
Version: 3
SOURCE #modified

#X_string
#Yes
#Column width
#Always
#No

#public boolean modified()


#{
#
boolean ret;
#
#
ret = super();
#
#
eventRuleFormHandler.setSubject(eventRule);
#
#
return ret;
#}
ENDSOURCE
ENDMETHODS
ENDCONTROL
CONTROL INTEDIT
PROPERTIES
Name
AutoDeclaration
Visible
Width
LookupButton
ShowLabel
ENDPROPERTIES

#X_Integer
#Yes
#No
#Column width
#Hidden (but reserve space)
#No

METHODS
Version: 3
SOURCE #modified
#public boolean modified()
#{
#
boolean ret;
#
#
ret = super();
#
#
eventRuleFormHandler.setSubject(eventRule);
#
#
return ret;
#}
ENDSOURCE
ENDMETHODS
ENDCONTROL
CONTROL COMBOBOX
PROPERTIES
Name
AutoDeclaration
Visible
Width
ShowLabel
ENDPROPERTIES

#X_Combo
#Yes
#No
#Column width
#No

METHODS
Version: 3
SOURCE #modified
#public boolean modified()
#{
#
boolean ret;
#
#
ret = super();
#
#
eventRuleFormHandler.setSubject(eventRule);

#
#
return ret;
#}
ENDSOURCE
ENDMETHODS
ENDCONTROL
CONTROL DATEEDIT
PROPERTIES
Name
AutoDeclaration
Visible
Width
ShowLabel
ExtendedDataType
ARRAY
#TransDate
#
ENDARRAY
ENDPROPERTIES

#X_Date
#Yes
#No
#Column width
#No

METHODS
Version: 3
SOURCE #modified
#public boolean modified()
#{
#
boolean ret;
#
#
ret = super();
#
#
eventRuleFormHandler.setSubject(eventRule);
#
#
return ret;
#}
ENDSOURCE
ENDMETHODS
ENDCONTROL
CONTROL REALEDIT
PROPERTIES
Name
AutoDeclaration
Visible
Width
LookupButton
ShowLabel
ENDPROPERTIES

#X_Real
#Yes
#No
#Column width
#Hidden (but reserve space)
#No

METHODS
Version: 3
SOURCE #modified
#public boolean modified()
#{
#
boolean ret;
#
#
ret = super();
#
#
eventRuleFormHandler.setSubject(eventRule);
#
#
return ret;

#}
ENDSOURCE
ENDMETHODS
ENDCONTROL
CONTROL TIMEEDIT
PROPERTIES
Name
AutoDeclaration
Visible
Width
LookupButton
ShowLabel
Mandatory
ENDPROPERTIES

#X_Time
#Yes
#No
#Column width
#Hidden (but reserve space)
#No
#Yes

METHODS
Version: 3
SOURCE #modified
#public boolean modified()
#{
#
boolean ret;
#
#
ret = super();
#
#
eventRuleFormHandler.setSubject(eventRule);
#
#
return ret;
#}
ENDSOURCE
ENDMETHODS
ENDCONTROL
CONTROL INT64EDIT
PROPERTIES
Name
AutoDeclaration
Visible
Width
LookupButton
DisplaceNegative
ShowLabel
ENDPROPERTIES

#X_Int64
#Yes
#No
#Column width
#Hidden (but reserve space)
#Auto
#No

METHODS
Version: 3
SOURCE #modified
#public boolean modified()
#{
#
boolean ret;
#
#
ret = super();
#
#
eventRuleFormHandler.setSubject(eventRule);
#
#
return ret;
#}
ENDSOURCE
ENDMETHODS
ENDCONTROL

CONTROL UTCDATETIMEEDIT
PROPERTIES
Name
AutoDeclaration
Visible
Width
ShowLabel
ExtendedDataType
ARRAY
#TransDateTime
#
ENDARRAY
ENDPROPERTIES

#X_DateTime
#Yes
#No
#Column width
#No

ENDCONTROL
ENDCONTAINER
ENDCONTROL
ENDCONTAINER
ENDCONTROL
CONTROL GROUP
PROPERTIES
Name
Width
Height
HTMLHelpFile
HTMLHelpTopic

#AlertMeFor
#Column width
#Column height
#HTMLHelpFileAxShared
#html/B2A39AA4-2518-4BAE-B391-10549DDC2D22.h

tm
Caption
#@SYS87760
Columns
#3
ArrangeGuide
ARRAY INDEX Columns
#0
#0
#0
ENDARRAY
HideIfEmpty
#No
ENDPROPERTIES
CONTAINER
CONTROL GROUP
PROPERTIES
Name
HTMLHelpFile
HTMLHelpTopic

#AlertMeForRadioGrp
#HTMLHelpFileAxShared
#html/47576A86-F6E5-4C79-ADA3-4D583ECA

7820.htm
FrameType
ENDPROPERTIES

#None

CONTAINER
CONTROL RADIOBUTTON
PROPERTIES
Name
AutoDeclaration
FrameType

#AlertMeForRadio
#Yes
#None

ENDPROPERTIES
METHODS
Version: 3
SOURCE #selectionChange
#public int selectionChange()
#{
#
EventRuleCondition curSelection;
#
int ret;
#
#
ret = super();
#
#
curSelection = this.selection();
#
eventRule.RuleCondition = curSelection;
#
eventRule_ds.write();
#
element.runBase().parmRebuildQuery(true);
#
eventRule_ds.setUntil(eventRule);
#
return ret;
#}
ENDSOURCE
SOURCE #validate
#public boolean validate()
#{
#
EventRuleCondition curSelection = this.selec
tion();
#
boolean
ret;
#
#
ret = super();
#
#
if (curSelection == EventRuleCondition::Curre
nt && !element.runBase().cursorHasRecord())
#
ret = false;
#
#
if (ret && curSelection == EventRuleCondition
::Custom && !eventRule.isFilterInteractive())
#
ret = false;
#
#
if (ret && curSelection == EventRuleCondition
::Current && element.eventRuleFormHandler().parmTmpEventType().TypeId == classnu
m(EventTypeCUD) &&
#
element.eventRuleFormHandler().parmTmpEve
ntType().TypeTrigger == EventTypeTrigger::RecordInsert)
#
ret = false;
#
#
return ret;
#}
ENDSOURCE
ENDMETHODS
ENDCONTROL
ENDCONTAINER
ENDCONTROL
CONTROL GROUP
PROPERTIES
Name
Visible
HTMLHelpFile
HTMLHelpTopic

#DialogStartGrp
#No
#HTMLHelpFileAxShared
#html/C0332332-2942-4352-873E-0E2C650B

3CC2.htm
ENDPROPERTIES
CONTAINER
ENDCONTAINER
ENDCONTROL
CONTROL GROUP
PROPERTIES
Name
Visible
Left
HTMLHelpFile
HTMLHelpTopic

#InvisibleGroup
#No
#Right edge
#HTMLHelpFileAxShared
#html/5E58A71C-10B7-4CDA-8246-685B6FFA

7862.htm
FrameType
ENDPROPERTIES

#None

CONTAINER
CONTROL BUTTONGROUP
PROPERTIES
Name
AutoDeclaration
Left
Top
ENDPROPERTIES

#RightButtonGrp
#Yes
#Auto (right)
#Bottom edge

CONTAINER
ENDCONTAINER
ENDCONTROL
ENDCONTAINER
ENDCONTROL
CONTROL GROUP
PROPERTIES
Name
Left
HTMLHelpFile
HTMLHelpTopic

#SelectButtonGroup
#Right edge
#HTMLHelpFileAxShared
#html/D1DC7633-0DD2-4243-A32B-B16E05A6

B716.htm
FrameType
ENDPROPERTIES

#None

CONTAINER
CONTROL BUTTONGROUP
PROPERTIES
Name
AutoDeclaration
Left
Top
ENDPROPERTIES

#ManualRightButtonGrp
#Yes
#Auto (right)
#Bottom edge

CONTAINER
CONTROL MENUITEMBUTTON
PROPERTIES
Name
#RunBaseQueryDialog

MenuItemName
ENDPROPERTIES

#RunBaseQueryDialog

METHODS
Version: 3
SOURCE #clicked
#void clicked()
#{
#
if (alertMeForRadio.selection() != 2)
#
{
#
alertMeForRadio.selection(2);
#
alertMeForRadio.selectionChange();
#
}
#
super();
#}
ENDSOURCE
ENDMETHODS
ENDCONTROL
ENDCONTAINER
ENDCONTROL
ENDCONTAINER
ENDCONTROL
ENDCONTAINER
ENDCONTROL
CONTROL GROUP
PROPERTIES
Name
AutoDeclaration
Width
HTMLHelpFile
HTMLHelpTopic

#AlertMeHowOften
#Yes
#Column width
#HTMLHelpFileAxShared
#html/CA485A32-12B7-493C-BB21-B781D5872BBA.h

tm
Caption
#@SYS87762
FrameOptionButton #Hide
Columns
#2
ArrangeGuide
ARRAY INDEX Columns
#0
#0
ENDARRAY
ENDPROPERTIES
CONTAINER
CONTROL RADIOBUTTON
PROPERTIES
Name
DataSource
DataField
Columns
FrameType
ENDPROPERTIES
ENDCONTROL

#RadioButton1
#EventRule
#Until
#2
#None

CONTROL GROUP
PROPERTIES
Name
Height
HTMLHelpFile
HTMLHelpTopic

#AlertMeUntilDate
#Column height
#HTMLHelpFileAxShared
#html/954B716D-5CE9-4C9E-86F5-C9DEF8C4

7A0A.htm
FrameType
BottomMargin
ENDPROPERTIES

#None
#0

CONTAINER
CONTROL DATEEDIT
PROPERTIES
Name
VerticalSpacing
ShowLabel
DataSource
DataField
ENDPROPERTIES

#EventRule_UntilDate
#0
#No
#EventRule
#UntilDate

ENDCONTROL
ENDCONTAINER
ENDCONTROL
ENDCONTAINER
ENDCONTROL
CONTROL GROUP
PROPERTIES
Name
AutoDeclaration
Width
HTMLHelpFile
HTMLHelpTopic

#AlertMeWith
#Yes
#Column width
#HTMLHelpFileAxShared
#html/E7E45517-8B52-466C-8EC9-4D4D475BB7F3.h

tm
Caption
FrameOptionButton
ENDPROPERTIES
CONTAINER
CONTROL STRINGEDIT
PROPERTIES
Name
Width
DataSource
DataField
ENDPROPERTIES

#@SYS87777
#Hide

#EventRule_Subject
#Column width
#EventRule
#Subject

ENDCONTROL
CONTROL STRINGEDIT
PROPERTIES
Name
Width
MultiLine

#EventRule_Message
#Column width
#Yes

DataSource
DataField
ENDPROPERTIES

#EventRule
#Message

ENDCONTROL
ENDCONTAINER
ENDCONTROL
CONTROL GROUP
PROPERTIES
Name
AutoDeclaration
Width
Height
HTMLHelpFile
HTMLHelpTopic

#AlertWho
#Yes
#Column width
#Column height
#HTMLHelpFileAxShared
#html/B5E962D9-A63B-4E81-944B-B1422C0BCB71.h

tm
Caption
FrameOptionButton
ENDPROPERTIES

#@SYS91445
#Hide

CONTAINER
CONTROL STRINGEDIT
PROPERTIES
Name
DataSource
DataField
ENDPROPERTIES

#EventRule_UserId
#EventRule
#UserId

ENDCONTROL
CONTROL GROUP
PROPERTIES
Name
Left
FrameType
ENDPROPERTIES

#RecipientSelectButtonGroup
#Right edge
#None

CONTAINER
CONTROL BUTTONGROUP
PROPERTIES
Name
AutoDeclaration
Left
ENDPROPERTIES

#RecipientManualRightButtonGrp
#Yes
#Auto (right)

CONTAINER
CONTROL MENUITEMBUTTON
PROPERTIES
Name
#NVMPEventRuleRecipients
MenuItemName
#NVMPEventRuleRecipients
ENDPROPERTIES
ENDCONTROL
ENDCONTAINER
ENDCONTROL

ENDCONTAINER
ENDCONTROL
ENDCONTAINER
ENDCONTROL
CONTROL GROUP
PROPERTIES
Name
AutoDeclaration
Width
HTMLHelpFile
HTMLHelpTopic

#AlertBy
#Yes
#Column width
#HTMLHelpFileAxShared
#html/23844CE7-CDC0-4ED4-BBDA-AA8CD6312382.h

tm
Caption
FrameOptionButton
ENDPROPERTIES

#@SYS94032
#Hide

CONTAINER
CONTROL CHECKBOX
PROPERTIES
Name
AutoDeclaration
HelpText
Value
Label
ENDPROPERTIES

#EventRule_ShowPopup
#Yes
#@SYS94033
#1
#@SYS87695

METHODS
Version: 3
SOURCE #toolTip
#public str toolTip()
#{
#
return '@SYS94258';
#}
ENDSOURCE
ENDMETHODS
ENDCONTROL
CONTROL GROUP
PROPERTIES
Name
HTMLHelpFile
HTMLHelpTopic

#AlertMeByBottom
#HTMLHelpFileAxShared
#html/65495EBB-D7C4-47A2-9BF0-0CF15BCB

7FA1.htm
FrameType
#None
Columns
#2
ArrangeGuide
ARRAY INDEX Columns
#0
#0
ENDARRAY
ENDPROPERTIES
CONTAINER
CONTROL CHECKBOX
PROPERTIES

Name
AutoDeclaration
HelpText
Label
ENDPROPERTIES

#EventRule_SendEmail
#Yes
#@SYS94034
#@SYS94049

METHODS
Version: 3
SOURCE #toolTip
#public str toolTip()
#{
#
return '@SYS94259';
#}
ENDSOURCE
ENDMETHODS
ENDCONTROL
CONTROL STRINGEDIT
PROPERTIES
Name
AutoDeclaration
AllowEdit
ENDPROPERTIES

#EventRule_SendEmailAddress
#Yes
#No

ENDCONTROL
ENDCONTAINER
ENDCONTROL
ENDCONTAINER
ENDCONTROL
ENDCONTAINER
ENDCONTROL
CONTROL BUTTONGROUP
PROPERTIES
Name
Left
Top
ArrangeMethod
ENDPROPERTIES

#ButtonGroup
#Auto (right)
#Bottom edge
#Horizontal, flush right

CONTAINER
CONTROL COMMANDBUTTON
PROPERTIES
Name
HelpText
Text
Command
ENDPROPERTIES

#CommandButtonOK
#@SYS74139
#@SYS5469
#263

ENDCONTROL
CONTROL COMMANDBUTTON
PROPERTIES
Name

#CommandButtonCancel

HelpText
Text
Command
ENDPROPERTIES

#@SYS16581
#@SYS57717
#264

ENDCONTROL
ENDCONTAINER
ENDCONTROL
ENDCONTAINER
ENDDESIGN
ENDFORM
***Element: FRM
; Microsoft Dynamics AX Forms unloaded
; ------------------------------------------------------------------------------FRMVERSION 5
FORM #NVMPEventRuleRecipients
PROPERTIES
Name
#NVMPEventRuleRecipients
ENDPROPERTIES
METHODS
Version: 3
SOURCE #classDeclaration
#public class FormRun extends ObjectRun
#{
#}
ENDSOURCE
SOURCE #init
#public void init()
#{
#
;
#
if(!element.args().record() || (element.args().record().TableId != Ta
bleNum(EventRule)))
#
{
#
throw error("This form must be called from the event rule creatio
n form");
#
}
#
#
super();
#}
ENDSOURCE
ENDMETHODS
OBJECTBANK
PROPERTIES
ENDPROPERTIES
DATASOURCE
OBJECTPOOL
PROPERTIES
Name

#HELEventRuleReceipients

Table
InsertIfEmpty
ENDPROPERTIES

#NVMPEventRuleRecipients
#No

FIELDLIST
DATAFIELD EventRuleId
PROPERTIES
Skip
ENDPROPERTIES

#Yes

ENDDATAFIELD
ENDFIELDLIST
ENDOBJECTPOOL
ENDDATASOURCE
ENDOBJECTBANK
JOINS
ENDJOINS
DESIGN
PROPERTIES
Caption
TitleDatasource
ENDPROPERTIES

#Event rule recipients


#HELEventRuleReceipients

CONTAINER
CONTROL TAB
PROPERTIES
Name
Width
Height
ENDPROPERTIES

#Tab
#Column width
#Column height

CONTAINER
CONTROL TABPAGE
PROPERTIES
Name
Caption
ENDPROPERTIES
CONTAINER
CONTROL GRID
PROPERTIES
Name
Width
Height
DataSource
DataGroup
AutoDataGroup
ENDPROPERTIES
CONTAINER
ENDCONTAINER
ENDCONTROL
ENDCONTAINER
ENDCONTROL

#Overview
#@SYS9039

#Grid
#Column width
#Column height
#HELEventRuleReceipients
#Overview
#Yes

CONTROL TABPAGE
PROPERTIES
Name
Caption
ENDPROPERTIES
CONTAINER
CONTROL GROUP
PROPERTIES
Name
DataSource
DataGroup
AutoDataGroup
ENDPROPERTIES

#General
#@SYS19924

#Identification
#HELEventRuleReceipients
#Identification
#Yes

CONTAINER
ENDCONTAINER
ENDCONTROL
CONTROL GROUP
PROPERTIES
Name
DataSource
DataGroup
AutoDataGroup
ENDPROPERTIES

#User
#HELEventRuleReceipients
#User
#Yes

CONTAINER
ENDCONTAINER
ENDCONTROL
ENDCONTAINER
ENDCONTROL
ENDCONTAINER
ENDCONTROL
ENDCONTAINER
ENDDESIGN
ENDFORM
***Element: FTM
; Microsoft Dynamics AX MENUITEM : NVMPEventRuleRecipients unloaded
; ------------------------------------------------------------------------------VERSION 1
MENUITEM #NVMPEventRuleRecipients
Type: 1
PROPERTIES
Name
#NVMPEventRuleRecipients

Label
HelpText

#@SYS39575
#Use to specify multiple recipients for the alert's em

ail
Object
ENDPROPERTIES

#nvmpeventRuleRecipients

ENDMENUITEM
***Element: PRN
; Microsoft Dynamics AX Project : KeSae_AlertMultipleUsers unloaded
; ------------------------------------------------------------------------------PROJECTVERSION 2
PROJECT #KeSae_AlertMultipleUsers
SHARED
PROPERTIES
Name
#KeSae_AlertMultipleUsers
ENDPROPERTIES
PROJECTCLASS ProjectNode
BEGINNODE
FILETYPE 0
UTILTYPE 41
UTILOBJECTID 50080
NODETYPE 228
NAME #NVMPEventRuleMultipleRecipients
ENDNODE
BEGINNODE
FILETYPE 0
UTILTYPE 44
UTILOBJECTID 292
NODETYPE 204
NAME #EventRule
ENDNODE
BEGINNODE
FILETYPE 0
UTILTYPE 44
UTILOBJECTID 50026
NODETYPE 204
NAME #NVMPEventRuleRecipients
ENDNODE
BEGINNODE
FILETYPE 0
UTILTYPE 45
UTILOBJECTID 3695
NODETYPE 329
NAME #EventActionEmail
ENDNODE
BEGINNODE
FILETYPE 0
UTILTYPE 45
UTILOBJECTID 2513
NODETYPE 329
NAME #EventCreateRule
ENDNODE
BEGINNODE
FILETYPE 0

UTILTYPE 11
UTILOBJECTID 0
NODETYPE 201
NAME #EventCreateRule
ENDNODE
BEGINNODE
FILETYPE 0
UTILTYPE 11
UTILOBJECTID 0
NODETYPE 201
NAME #NVMPEventRuleRecipients
ENDNODE
BEGINNODE
FILETYPE 0
UTILTYPE 1
UTILOBJECTID 0
NODETYPE 296
NAME #NVMPEventRuleRecipients
ENDNODE
ENDPROJECT
***Element: END

You might also like