Hi wolfgang,

I don't think this is the right answer, but actually the solution below works well on me. :)

This is a little bit dangerous, because you have to change the sys classes.

Step 1. Add code in SysSetupFormRun

Step 1.a. Add new boolean value (example: m_blnA) in classdeclaration of SysSetupFormRun 

{
    boolean m_blnA;
#if.never

Step 1.b. Add new method to pass parameter the boolean value above (example: A)

boolean a(boolean p_blnA = m_blnA)
{
    m_blnA = p_blnA;
    return m_blnA;
}

Step 1.c. Add a code in method task in SysSetupFormRun 

    int ret;
    ; //starts from here
    if (_p1 == 293) // goto main table code
    {
        this.a(true);
    } // ends here

    if (_p1 == #taskFilter)

Step 2. Add codes in method run of the form you want to check whether it is called from 'Go to the main table' context menu or not.

void  run()
{
    object o;
    ;
    super();

    try
    {
        o = element.args().caller();
        if (o != null)
        {
            if (strscan(o.toString(),' FormRun(',1,9999) > 0)
            {
                //info(o.toString());
                if (o.a())
                {
                    info('from goto main table');   // You can change the code here......
                    o.a(false); //set it to false again
                }
            }
        }
    } catch (Exception::Error)
    {
    }

    //...
}

Hope this sample of solution is helpful.If it is very urgent, you can use the code above. :)

Be cautious:

I still don't try if the form was run without the use of SysSetupFormRun, because it is inherited from FormRun itself and FormRun is a sys-layered class. If the form doesn't inherited from SysSetupFormRun, it will not have method a() and an error will be raised.

Regards,

Sonny Wibawa Adi

-----Original Message-----
Put this code in the init method of your form and call it from different places and see what you get, it should help you get moving with this.

 

Note: If the form object is being called from a class like salesEdit lines, then this will always point to a class, and you actually have to attack the class to find where it is being called from.

 

-Preston

 

//-----code

if(! element.args().caller())

        info('No Caller');

else

        info(element.args().caller().toString());

 

//----Code

 

 

-----Original Message-----
From: Gro� [mailto:[EMAIL PROTECTED]
Sent:
Thursday, April 08, 2004 7:28 AM
To: [EMAIL PROTECTED]
Subject: AW: [development-axapta] The never ending "go to maintable" thing...

 

hi sonny,

 

thank's for replay, good idea - but:

the mentioned form (in my case: smmQuotationTable) will be called from other places in the application by the same menuitem. so I can't distinguish if the form was called by the "go to maintable" function or not....

 

anybody else a hint...?

 

regards

wolfgang

-----Urspr�ngliche Nachricht-----
Von: Sonny Wibawa Adi [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 8. April 2004 07:34
An: [EMAIL PROTECTED]
Betreff: Re: [development-axapta] The never ending "go to maintable" thing...

Hi wolfgang,

 

 

For default, axapta will call a menu item that having the same name with the table name. For example, you can check the menutemname caller using args object.

 

void init()

{

    if (element.args.menuItemName() != null && element.args.menuItemName() ==  menustr(InventTable))

    {

        // here is your code..

    }

}

PS: you may want to check too that the menuitemtype is a menu item display.

 

 

Regards,

 

Sonny Wibawa Adi



wohegro <[EMAIL PROTECTED]> wrote:

hi there,

does anybody know if it's possible to indicate in an opened form, if
the form was called by an "go to maintable" jump ?

thank's in advance
regards to all
wolfgang


Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today



Yahoo! Groups Links


Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today

Yahoo! Groups Links

Reply via email to