Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Exportfile for AOT version 1.0 or later
- Formatversion: 1
- ***Element: CLS
- ; Microsoft Dynamics AX Class: EventDrillDownPoller unloaded
- ; --------------------------------------------------------------------------------
- CLSVERSION 1
- CLASS #EventDrillDownPoller
- PROPERTIES
- Name #EventDrillDownPoller
- LegacyId #2677
- ENDPROPERTIES
- METHODS
- SOURCE #main
- #static void main(Args args)
- #{
- # info(#externalDrillDownNamedPipeNamePrefix + EventDrillDownPoller::currentDrillDownNavigationMark());
- #}
- ENDSOURCE
- SOURCE #parseDrillDownNavigationMark
- #static str parseDrillDownNavigationMark(str parm)
- #{
- # str navigationMark;
- # int delimiter = strFind(parm, '?', 1, strlen(parm)); // 00968 - Start AX with command : 09 Jan 2014 by janb
- # int del2 = strFind(parm, '?', delimiter+1, strlen(parm)); // 00968 - Start AX with command : 09 Jan 2014 by janb
- #
- #;
- # if (delimiter)
- # {
- # navigationMark = substr(parm, delimiter + 1, del2 ? del2-delimiter-1 : strlen(parm)); // 00968 - Start AX with command : 09 Jan 2014 by janb
- # }
- #
- # return navigationMark;
- #}
- ENDSOURCE
- ENDMETHODS
- ENDCLASS
- ***Element: CLS
- ; Microsoft Dynamics AX Class: SysStartUpCmdDrillDown unloaded
- ; --------------------------------------------------------------------------------
- CLSVERSION 1
- CLASS #SysStartUpCmdDrillDown
- PROPERTIES
- Name #SysStartUpCmdDrillDown
- Extends #SysStartupCmd
- RunOn #Client
- LegacyId #6027
- ENDPROPERTIES
- METHODS
- SOURCE #canRun
- #// 00968 - Start AX with command : 09 Jan 2014 by janb
- #protected boolean canRun()
- #{
- # return true; //hasMenuItemAccess(menuitemactionstr(EventContextDrilldown), MenuItemType::Action);
- #}
- ENDSOURCE
- SOURCE #infoRun
- #void infoRun()
- #{
- # #WinApi
- # Args args = new Args();
- # MenuFunction inboxFunction;
- # EventInbox alertRecord;
- # // A record may have been soft-deleted - which is quite OK for drill-down.
- # str navigationMark = EventDrillDownPoller::parseDrillDownNavigationMark(parm);
- # str alertId = EventDrillDownPoller::parseAlertId(parm);
- #;
- # WinAPI::flashWindowEx(infolog.hWnd(), #FLASHW_ALL | #FLASHW_TIMERNOFG, 3, 0);
- #
- # // 00968 - Start AX with command : 09 Jan 2014 by janb -->
- # if (alertId == '0')
- # {
- # new SysStartupCmdRecordForm('',navigationMark).infoRun();
- # return;
- # }
- # // 00968 - Start AX with command : 09 Jan 2014 by janb <--
- # if (!EventDrillDownPoller::checkDrillDownNavigationMark(navigationMark))
- # return;
- #
- # alertRecord = EventInbox::find(str2int64(alertId));
- # if (!alertRecord)
- # {
- # checkFailed(strfmt("@SYS94927", alertId));
- # return;
- # }
- #
- # if (hasMenuItemAccess(menuitemactionstr(EventContextDrilldown), MenuItemType::Action)) // 00968 - Start AX with command : 09 Jan 2014 by janb
- # {
- # inboxFunction = new MenuFunction(menuitemactionstr(EventContextDrilldown), MenuItemType::Action);
- # args.record(alertRecord);
- # inboxFunction.run(args);
- # }
- #}
- #
- ENDSOURCE
- ENDMETHODS
- ENDCLASS
- ***Element: CLS
- ; Microsoft Dynamics AX Class: SysStartupCmdRecordForm unloaded
- ; --------------------------------------------------------------------------------
- CLSVERSION 1
- CLASS #SysStartupCmdRecordForm
- PROPERTIES
- Name #SysStartupCmdRecordForm
- Extends #SysStartupCmd
- ENDPROPERTIES
- METHODS
- SOURCE #canRun
- #protected boolean canRun()
- #{
- # return true;
- #}
- ENDSOURCE
- SOURCE #classDeclaration
- #// This is a framework class. Customizing this class may cause problems with future upgrades to the software.
- #class SysStartupCmdRecordForm extends SysStartupCmd
- #{
- #}
- ENDSOURCE
- SOURCE #infoRun
- #void infoRun()
- #{
- # Map q = SysStartupCmdRecordForm::parm2map(parm);
- # CompanyId compId = q.exists('company') ? any2str(q.lookup('company')) : curext();
- # TableId tableId = q.exists('table') ? tableName2Id(q.lookup('table')) : 0;
- # FieldId fieldId = q.exists('field') ? fieldName2Id(tableId, q.lookup('field')) : new DictTable(tableId).primaryKeyField();
- # Range value = q.exists('value') ? any2str(q.lookup('value')) : '';
- # Common record;
- # changeCompany (compId)
- # {
- # if (tableId)
- # {
- # record = SysDictTable::newTableId(tableId).makeRecord();
- # }
- # if (fieldId && value)
- # {
- # switch (new DictField(tableId,fieldId).type())
- # {
- # case Types::Integer:
- # select record where record.(fieldId) == str2int(value);
- # break;
- # case Types::Int64:
- # select record where record.(fieldId) == str2int64(value);
- # break;
- # case Types::Date:
- # select record where record.(fieldId) == str2date(value, 321);
- # break;
- # default:
- # select record where record.(fieldId) == value;
- # }
- # }
- # if (fieldId)
- # {
- # SysInfoAction_TableField::newBufferField(record, fieldId).run();
- # }
- # }
- #}
- ENDSOURCE
- SOURCE #parm2map
- #static Map parm2map(str parm)
- #{
- # Map map = new Map(Types::String, Types::String);
- # container con = str2con(parm,'&',false);
- # int n = conLen(con);
- # int i, c;
- # str subp;
- #
- # for (c = 1; c <= n; c++)
- # {
- # subp = conPeek(con,c);
- # i = strFind(subp,'=',1,9999);
- # if (i > 1)
- # map.insert(subStr(subp,1,i-1), subStr(subp,i+1,9999));
- # }
- # return map;
- #}
- ENDSOURCE
- ENDMETHODS
- ENDCLASS
- ***Element: END
Advertisement
Add Comment
Please, Sign In to add comment