SBX - Search With Button

SBX - Forum Post Title

Transfer journal link

Microsoft Dynamics AX Forum

Zohan asked a question on 15 Sep 2018 11:05 PM

Question Status

Suggested Answer

Hi,

I've some work to do. I have a customized form which has some process, there is a field under the grid which contains the transfer journal number. when ever user select or clicked the transfer journal it will show the transfer journal screen with selected or clicked transfer journal. 

For Example:

if tranfer journal no: is A-10022 then it will only show the transfer journal screen with that specific transfer journal.

How can achieve this ?  kindly help with some verified solution.

Reply
Suggested Answer

Hi Zohan,

You need either define relations on the table in AOT or write jumpRef method for that field, here are blog posts with examples

ztirom.at/.../ax-2012-override-the-jumpref-method-to-modify-view-details

axvuongbao.blogspot.com/.../how-to-make-relation-in-extended-data_19.html

Reply
Rustem Galiamov responded on 16 Sep 2018 5:56 AM
My Badges
Suggested Answer

Hi Zohan!

Just to add to ievgen suggestion, here is example of jumpRef method for transfer journal:

public void jumpRef()
{
    Args            args;
    FormRun         formRun;

    args = new Args(formStr(InventJournalTable));
    args.record(this);
    args.caller(object);

    // Menu item info will be used by security framework, when setting access rights to form datasources
    args.menuItemType(MenuItemType::Display);
    args.menuItemName(menuitemDisplayStr(InventJournalTableTransfer));

    formRun = classfactory.formRunClass(args);
    formRun.init();
    formRun.run();
    formRun.detach();
}
Reply
Zohan responded on 16 Sep 2018 8:43 AM

Does this method will return the same transfer journal number on transfer journal screen ?

Reply
Zohan responded on 16 Sep 2018 8:48 AM

can't we use some hyper link on that field ? so when ever user clicked that transfer journal it'll show the transfer journal with that transfer journal number ? is it possible ?

Reply
Rustem Galiamov responded on 16 Sep 2018 8:52 AM
My Badges
Suggested Answer

If you have InventJournalTable as a DS of the form this code is enough. If you have only journal num, you should add InventJournalTable variable and get the cursor of the table and then put it to args.record() method.

Reply
Rustem Galiamov responded on 16 Sep 2018 8:59 AM
My Badges
Suggested Answer

Hyper link of the form’s field is the standard feature if the field use EDT with relations and form in the view mode, not edit mode. Btw, in your case, to open related form with selected value you need jumpRef() because journals has many types.

Reply
Zohan responded on 16 Sep 2018 9:42 AM

so basically i've to put the range in jumpRef method ? through args.record()

Reply
Rustem Galiamov responded on 16 Sep 2018 10:17 AM
My Badges

Can you explain how did you add journald to the form or provide some screenshots?

Reply
Zohan responded on 17 Sep 2018 12:57 AM

through some process , journal id is been created and display on my form.

Reply
Rustem Galiamov responded on 17 Sep 2018 2:32 AM
My Badges

JournalId field on your form is the field from InventJournalTable or is the new added field from another table?

Reply
Suggested Answer

Hi Zohan,

You need either define relations on the table in AOT or write jumpRef method for that field, here are blog posts with examples

ztirom.at/.../ax-2012-override-the-jumpref-method-to-modify-view-details

axvuongbao.blogspot.com/.../how-to-make-relation-in-extended-data_19.html

Reply
Rustem Galiamov responded on 16 Sep 2018 5:56 AM
My Badges
Suggested Answer

Hi Zohan!

Just to add to ievgen suggestion, here is example of jumpRef method for transfer journal:

public void jumpRef()
{
    Args            args;
    FormRun         formRun;

    args = new Args(formStr(InventJournalTable));
    args.record(this);
    args.caller(object);

    // Menu item info will be used by security framework, when setting access rights to form datasources
    args.menuItemType(MenuItemType::Display);
    args.menuItemName(menuitemDisplayStr(InventJournalTableTransfer));

    formRun = classfactory.formRunClass(args);
    formRun.init();
    formRun.run();
    formRun.detach();
}
Reply
Rustem Galiamov responded on 16 Sep 2018 8:52 AM
My Badges
Suggested Answer

If you have InventJournalTable as a DS of the form this code is enough. If you have only journal num, you should add InventJournalTable variable and get the cursor of the table and then put it to args.record() method.

Reply
Rustem Galiamov responded on 16 Sep 2018 8:59 AM
My Badges
Suggested Answer

Hyper link of the form’s field is the standard feature if the field use EDT with relations and form in the view mode, not edit mode. Btw, in your case, to open related form with selected value you need jumpRef() because journals has many types.

Reply

SBX - Two Col Forum

SBX - Migrated JS