Posts

Showing posts from March, 2017

Simple Custom Lookup Ax 2012 R3

Image
In this post we'll see how easily we can create a custom lookup. Suppose I have two fields  1. Country/Region 2. StateId Now I want to create a lookup so that If I will select any country then state lookup must show states which belongs to my selected country for example If I have selected India in country field then it must show only indian state in state field Lets see how can we achieve it. Step 1: Create a table and then create two fields            1. CountryRegionId            2. StateId Step 2: Create a form Step 3: For custom lookup we will use State master table i.e. LogisticsAddressState here we can see there is a method lookupStateId public client static void lookupStateId(     FormStringControl               _ctrl,     LogisticsAddressCountryRegionId _countryRegionId) {     SysTableLookup ...

Get Current Record for different data source x++

By this we can use same MenuItem at different place and for different data source. --------------------------------------------------------------------------- Public static void main(Args _args) {     RetailStatementTable    retailStatementTable;     RetailStatementLine     retailStatementLine;     RetailStatementId         StatementID;     RetailCountedAmountUpdate  RetailCountedAmountUpdate = new RetailCountedAmountUpdate();     ;      switch (_args.dataset())     {             case tablenum(RetailStatementTable) :             retailStatementTable =  _args.record();             StatementID = retailStatementTable.statementId;             break;                        ...