x++

Update records that can be retrieved by multiple joins in x++

时间秒杀一切 提交于 2020-01-11 14:28:29
问题 So I have a complete x++ script that aims to update records based on the retrieved result set made with select query with multiple joins and using crosscompany As I have been told, it is not a good idea to update records when there is crosscompany. Can you give expert advice on how to do it the best practice way considering my current script. here is the script static void UpdateSample(Args _args) { InventTable a; InventTableModule b; EcoResProduct c; EcoResProductCategory d; EcoResCategory e

Dynamics Ax 2009, Email Templates

大憨熊 提交于 2020-01-11 13:05:53
问题 I have created an email template in Ax, using the %varname% as a placeholder for items added to the map when you send the email with this: emailParameterMap.insert("modifiedBy", userFullName); emailParameterMap.insert("vendorName", vendorName); SysEmailTable::sendMail("VendChanges", "en-us", "user@domain.com", emailParameterMap); But, I want to have a list of an unknown number of items in the email result that is sent. How can I do that? 回答1: You can define your e-mail template with XSLT

Dynamics Ax 2009, Email Templates

醉酒当歌 提交于 2020-01-11 13:05:10
问题 I have created an email template in Ax, using the %varname% as a placeholder for items added to the map when you send the email with this: emailParameterMap.insert("modifiedBy", userFullName); emailParameterMap.insert("vendorName", vendorName); SysEmailTable::sendMail("VendChanges", "en-us", "user@domain.com", emailParameterMap); But, I want to have a list of an unknown number of items in the email result that is sent. How can I do that? 回答1: You can define your e-mail template with XSLT

How to make invisible the lookup field?

耗尽温柔 提交于 2020-01-07 03:08:20
问题 I want to take a value from lookup field. But I neet to make invisible this field. My code is this: public void lookup() { Query query = new Query(); QueryBuildDataSource queryBuildDataSource; QueryBuildRange queryBuildRange; SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(MYTable), this); sysTableLookup.addLookupField(fieldNum(MYTable, FieldTableA)); sysTableLookup.addLookupField(fieldNum(MYTable, FieldTableB)); sysTableLookup.addLookupField(fieldNum(MYTable, RecId),

x++ script that do not return correct count

霸气de小男生 提交于 2020-01-06 06:36:52
问题 I have a x++ script which aims to count records from a select query and later on be updated. This is the original question for reference: convert SQL Query with Join to X++ Dynamics AX scripting Initially, I have a SQL Query counterpart of it and it is resulting to 50 rows / records, when I convert it to X++ , it is not counting or extracting the same number of records, Here is is the x++ script static void Job(Args _args) { Table1 table1; Table2 table2; Table3 table3; Table4 table4; Table5

Enum as a Parameter in Dynamics AX

左心房为你撑大大i 提交于 2020-01-05 06:52:46
问题 My report has a parameter which uses a base enum. The enum has 4 different options to choose when running the report. How do I insert an option which uses all 4 at once? For example, I have an enum named Phone and it has 4 types: 1 = None, 2 = Home, 3 = Mobile, 4 = Work. In a drop down, how do I add option 5 = None+Home+Mobile+Work? Thank you! 回答1: Add anoher enum with value All (see NoYes and NoYesAll enums as example) 回答2: Some ways to solve your problem: You can alter your Enum and add a

setTimeOut and local function

和自甴很熟 提交于 2020-01-05 02:52:16
问题 I'm working on Ax 4.0 I'm trying to use the Object.setTimeOut method in a job with a local function, as stated in the msdn documentation : static void setTimeOutJob() { Object o = new Object(); void printText() { ; info( "2 seconds has elapsed since the user did anything" ); } ; // Set a Time Out with the idle flag set to false o.setTimeOut(identifierstr(printText), 2000, false); } But this simple job doesn't produce anything, so it seems I'm missing something here. Has someone worked with

Dynamics AX FTP

荒凉一梦 提交于 2020-01-04 14:22:07
问题 I have problems to send csv file on ftp, I use the following code found on AxaptaPedia: object ftpo; object ftpResponse; System.Net.FtpWebRequest request; System.IO.StreamReader reader; System.IO.Stream requestStream; System.Byte[] bytes; System.Net.NetworkCredential credential; System.String xmlContent; System.Text.Encoding utf8; System.Net.FtpWebResponse response; ; reader = new System.IO.StreamReader(strfmt("%1%2","\\\\Server\\directory\\","Export.csv")); utf8 = System.Text.Encoding::get

How to rename dialog box buttons or create new in Ax 2012?

谁说我不能喝 提交于 2020-01-04 12:49:10
问题 Is it possible to rename dialog box buttons? For example on "okCancel" can I rename the "ok" button as "continue" ? If not please guide me how can I create my own dialog box? Thanks ahead. 回答1: A button has a "Text" property. You can set that property or do so by code: okButton.text("Continue"); The Box::okCancel uses the DialogBox class which is a kernel class and cannot be changed. The yesNoAxaptaForm method on the other hand uses an AX form, so you can roll on your own. That said it seems

How to count report pages in pre-rendered MorphX report?

谁都会走 提交于 2020-01-04 04:33:28
问题 We are trying to force a morphX report to be an even number of pages in length (so our auto-folding machine can handle the workload properly) and have been unsuccessful in using element.pagesTotal() to do so. How have others gotten a page count for per-entity reports at the element level? (this is dynamics ax 2009) 回答1: Sorry, but pagesTotal is a "magic" function that delivers the result after the report has finished, which is too late for you to emit a newPage . You will have to count