Langsung ke konten utama

How to make Relation in Extended Data Type and add 'View Details' for field on a form in AX 2012

Because AX 2012 is not support  for add relation to Extended Data Type like in AX 2009.
This is my solution how to do it in 2012:
- Duplicate an EDT have relation in AX 2012: ex SalesId and change name. relation table, reference table to yours -> you have an EDT with relation

**** If your project have been customized already and have a lot tables with field extend from your EDT, you don't need to change  EDT property in each table (because it takes lot of time). Follow these steps:
- Export your Proj xpo (with old EDT too)
- Delete old EDT, rename duplicated EDT to your EDT ( now tables with fields extended by your EDT lost all EDT property)

- Import project without old EDT ( auto fill property for all extend field)

The filed with EDT have relation auto add 'View Details function on form (Right-click a field in a form, and then click View details)

***1 more way to add 'View Details' with field not extend from EDT
Open the form in the AOT, expand its data sources, and override jumpRef() of the field on the your datasource with the following code: 

public void jumpRef()
{
YourTable name;
Args args;
MenuFunction mf;
name = YourTable ::find(YourTable.fieldId);
if (!name)
{
return;
}
args = new Args();
args.caller(element);
args.record(name);
mf = new MenuFunction(menuitemDisplayStr(YourForm),MenuItemType::Display);
mf.run(args);
}

Komentar

Postingan populer dari blog ini

Use X++ wildcard (LIKE and NOT LIKE) in X++ select statement

For x++ select statements:  select firstOnly batchHistory      where batchHistory.Caption  LIKE  "*Test*"  For x++ queries:  queryBuildRange.value(*Test*); Note the LIKE instead of a '==' and the wildcards inside of the quotations. All other combinations of wildcard usage will work here. This is the same functionality as what the users would put in the grid filtering(eg. '*TEST*' in the caption field filter on the batch tasks form).  However, if you want to find all Captions that do not have the word Test in them (NOT LIKE, !LIKE), you will have to modify the above example slightly.  For x++ select statements:  select firstOnly batchHistory      where  !( batchHistory.Caption LIKE "*TEST*" ) ;  For x++ queries:  queryBuildRange.value(!*Test*);

Format Label Tom Jerry (MS Word)

Setelah beberapa lama aku tidak membuat label undangan, tiba-tiba kemarin aku diminta untuk membuat label undangan Wisuda dengan menggunakan label merek Tom & Jerry (TJ). Harusnya sih menjadi tugas sekretaris panitia tapi karena yang bersangkutan ada tugas di luar kantor maka aku yang membereskannya. Mula-mula aku membuat format labelnya dengan cara manual, tapi untung ada pak Mulyadi (staf tata usaha) yang menyarankan aku untuk mengunduh format label yang telah ada di Internet. Mulailah aku browsing di google dan menemukan format label berbagai ukuran dari website Tom & Jerry di alamat berikut  http://tjlabels.com/en/download.html  (yang link ini agak rempong krn pake masukin nomor captcha-captcha-an). Sedangkan kalau yang link ini langsung pilih file ga pake nomor captcha-captcha-an ( http://tjlabels.com/assets/download/ ). Ternyata juga ada banyak berbagai blog yang menyediakan  link download seperti ini, tapi aku mem- posting  artikel ini ...

Solved : Update on a valid time state table is not allowed without specifying a ValidTimeStateUpdateMode

How To Solve Error :  Cannot edit a record in Position hierarchies (xyz). Update on a valid time state table is not allowed without specifying a ValidTimeStateUpdateMode. select forUpdate * from xyz where xyz.recid== _RecId ; try { ttsBegin; _Value= “Abcd”; xyz.Name = _Value; xyz.validTimeStateUpdateMode(ValidTimeStateUpdate::Correction); xyz.ValidFrom =today(); xyz.ValidTo=dateMax(); xyz.update(); ttsCommit; } catch { ttsAbort; }