Hi Ievgen,
I really have no idea how can I add the code here to retrieve the the fields for particular record. for example Currency as per the requirement said.
Map createEmailParameterMap(EventInbox _inbox, EventType _eventType, EventRule _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,_inbox.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(EventTypeCUD))&& _inbox.TypeTrigger == EventTypeTrigger::FieldChanged)
{
if (dictField.enumId() == 0)
{
if (dictField.isSurrogateForeignKey())
{
previousValue = EventType::surrogateValue(dictField.tableName(), dictField.name(), _eventType.parmOriginalValue());
currentValue = EventType::surrogateValue(dictField.tableName(), dictField.name(), _eventType.parmCurrentValue());
}
else
{
previousValue = strfmt('%1',_eventType.parmOriginalValue());
currentValue = strfmt('%1',_eventType.parmCurrentValue());
}
}
else
{
dictEnum = new SysDictEnum(dictField.enumId());
previousValue = dictEnum.value2Label(_eventType.parmOriginalValue());
currentValue = dictEnum.value2Label(_eventType.parmCurrentValue());
}
parameterMap.insert('beforevalue',previousvalue);
parameterMap.insert('aftervalue',currentValue);
data = strfmt('%1: %2; %3: %4', "@SYS69521",previousVAlue,"@SYS91541",currentValue);
}
drillDownGroup = EventDrillDownPoller::currentDrillDownNavigationMark();
parameterMap.insert('occurred',datetime2str(DateTimeUtil::applyTimeZoneOffset(_inbox.AlertCreatedDateTime, DateTimeUtil::getUserPreferredTimeZone()), DateFlags::FormatAll));
parameterMap.insert('for',_inbox.AlertedFor);
if (_inbox.GlobalRule == NoYes::No)
parameterMap.insert('company',_inbox.CompanyId);
else
parameterMap.insert('company',"@SYS314900");
parameterMap.insert('data',data);
parameterMap.insert('subject',_inbox.Subject);
parameterMap.insert('message',_inbox.Message);
parameterMap.insert('LinkToBusinessData', drillDownGroup + '?DrillDown_' + int642str(_inbox.InboxId));
parameterMap.insert('LinkToAlertRule', drillDownGroup + '?ViewAlertRule_' + int642str(_inbox.InboxId));
parameterMap.insert('LinkToAlert', drillDownGroup + '?ViewAlert_' + int642str(_inbox.InboxId));
parameterMap.insert('event', event);
parameterMap.insert('alertid',int642str(_inbox.InboxId));
return parameterMap;
}