axapta

Axapta.ExecuteStmt - Is it safe? [duplicate]

我与影子孤独终老i 提交于 2019-12-11 16:24:16
问题 This question already has answers here : Injection safe call to IAxaptaRecord.ExecuteStmt() (3 answers) Closed 6 years ago . I have some code, which uses the ExecuteStmt method on the Axapta Object when using the Business Connector, like so: AxaptaRecord record = (AxaptaRecord)ax.CreateAxaptaRecord("SalesTable"); record.ExecuteStmt("select * from %1 where %1.SalesId == '" + id + "'"); while (record.Found) { // do stuff } This works fine, but it's going to be on a public facing website, so is

how to create two number sequences

与世无争的帅哥 提交于 2019-12-11 16:23:06
问题 Can we create Purchase order Number Sequence with the division capture for Local and Foreign purchases? Can we create two number sequence at a time in AX 2012 ? 回答1: Yes you can. Not knowing anything about your version or what you have done or tried, I will try guessing you are using AX 2012. Then go looking in \Classes\CustPostInvoice\run on how they set the invoiceId variable. if (countryRegion_LTLV) { [invoiceId, voucher] = this.getNumAndVoucher_W(numberSeq); } else { [invoiceId, voucher]

D365 FO Simple Query for expiring contract

微笑、不失礼 提交于 2019-12-11 15:51:25
问题 I need to create simple query which will show all contracts which will expire in next 3 months. I know how to do that with SQL, but how to do that in Visual Studio when I create query. I added data source Contract table. Added range. Column where is date about expiring is VALIDTO. So, something to write up in value, or how to do that ? 回答1: Solved with two ranges on VALIDTO column. Used (MonthRange(0,3)) with (Day(0)) formulas. 来源: https://stackoverflow.com/questions/56889905/d365-fo-passing

Automatic field values changed according to master table field modified In Axapta

情到浓时终转凉″ 提交于 2019-12-11 15:42:38
问题 I have two table WI_MachineDrawing and BOM. There is two common filed call RevNo and WI_MachineDrawngNumber. Now I want to do something when i alter Wi_MachineDrwawng filed RevNo then BOM RevNo should be modified according to WI_MachineDrawing RevNo field. 回答1: Override the modifiedField method on the table WI_MachineDrawing to update the field in BOM when RevNo changes: public void modifiedField(fieldId _fieldId) { BOM BOM; ; super(_fieldId); switch(_fieldId) { case fieldnum(WI

What is the right way to access buttons in list page form?

时光总嘲笑我的痴心妄想 提交于 2019-12-11 13:34:38
问题 In ax 2012 in form with template " list page " you normally cannot access the clicked method on the button. You are just not allowed to overwrite method `clicked You can change this behavior by setting the button property "DisplayTarget" to the value " Client ". Than you can change the code of clicked method. But it does not feel right. Is there any way how to access clicked method better way? For example by using *FormName*ListPageInteraction which is linked in form properties? P.S.: I know

Mark mandatory fields on form, if not filled with valid value

雨燕双飞 提交于 2019-12-11 13:26:47
问题 if you create a new dataset, mandatory fields which are not set yet are marked with a wiggly red line. it seems, that only string-values ( or several fields, but at least no integers ) are marked this way. if integer-references are used ( 1-based ), the regarding fields are filled with 0 per default which causes the red line to disappear. is there any way to leave those fields empty per default? thanks for hints! 回答1: For integer and real fields you could set the ShowZero property to No (on

Get customer or prospects in Dynamics AX 2012

谁说我不能喝 提交于 2019-12-11 13:25:03
问题 I am trying to get customer or prospect using X++ and use it on a lookup. There is a method in the DirPartyTable that returns what I want. DirPartyTable::isCustomerOrRelation while select * from dirPartyTable { if(DirPartyTable::isCustomerOrRelation(dirPartyTable.RecId)) { //Get the Name //info(dirPartyTable.Name); } } But when I build a query to the lookup I am trying to pass the DirPartyTable::isCustomerOrRelation(dirPartyTable.RecId) on the addRange of the query somehow. Is there a way to

Dynamics AX 2009 X++ Selecting A Date Range

拥有回忆 提交于 2019-12-11 13:19:17
问题 I am creating an X++ report, and the requirement is that the user can multi-select on a form and when they click the report menu button the values are pulled in based on the selection. So far this is easy enough, and I can pull in Str ranges i.e. order numbers, item id's etc, but I want to be able to pull in a date range based on selection. I have used a method which several MorphX reports use, with use of 3 key methods in X++ reporting; setQuerySortOrder setQueryEnableDS and the main key one

How to connect Visual Studio to a specific dynamics ax environment

天涯浪子 提交于 2019-12-11 13:01:53
问题 I would like to connect my Visual Studio against different dynamics ax environments. In particular the following two: Development Environment Production Environment The purpose is to develope SSRS reports. In the production environments there are some reports which are not available in development and it would be complicated to create them. Not meaning that I'm going to develop against production (who would do such a thing?! ;-) ). I found a tutorial which shows how to connect to a specific

Selecting a record in Dropdown should throw error based on value in the record

痴心易碎 提交于 2019-12-11 12:14:27
问题 HI I have a dropdown for a field in a form which shows records with each record having values (Name, Status). Ex:: A1 Active A2 Active A3 Inactive A4 Active A5 Inactive If i select A3 or A5 which are inactive i should get a warning/error saying you are selecting inactive value. How can i acheive this? What is best way to acheive this? Thanks in advance. 回答1: What about using validation? Using validateField or validateWrite on the table or datasource you can test whether the chosen value is