Показать сообщение отдельно
Старый 20.05.2010, 00:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,646 / 848 (80) +++++++
Регистрация: 28.10.2006
axaptapedia: Call-back methods
Источник: http://www.axaptapedia.com/Call-back_methods
==============

Summary: New page: ==Call-back methods== Sometimes it is useful to call methods on the parent/caller of your class. If you are using the runbase framework you can call accessors methods from the form that c...

==Call-back methods==
Sometimes it is useful to call methods on the parent/caller of your class.

If you are using the runbase framework you can call accessors methods from the form that called your run method to initialize a new object.

X++:
public static void main(Args _args)
{
    str callerName;
    ;
    if(_args.caller() != null)
    {
        callerName = _args.caller().name();

        if(_args.dataset() == tableNum(BankAccountTrans) &&
            formHasMethod(_args.caller(), identifierStr(bankAccountStatement)))//check the form for an accessor method for the statement
        {
            statement = _args.caller().bankAccountStatement();//get the bankStatment from the accessor method 
            engine = new BankRecEngine(_args,_args.record(), statement.AccountId);//create a new runbase, fill params from the form calling this runbase

            if(engine.prompt())//ask the user for information
            {
                engine.run();
            }
       }

    }
}


Источник: http://www.axaptapedia.com/Call-back_methods
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.