AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 15.07.2010, 20:08   #1  
Blog bot is offline
Blog bot
Участник
 
25,486 / 846 (79) +++++++
Регистрация: 28.10.2006
kamalblogs: Exists methods don’t need table declaration in Dynamics Ax
Источник: http://kamalblogs.wordpress.com/2010...d-declaration/
==============

Do you know when we use select statement for conditional checks, we don’t need to declare a variable if we use the same name as the table. Look at the example below to understand better.

X++:
static boolean SelectStatementInBooleanConditions() 
{
    //no declaration for table object has been made.     
    boolean test;     ;      

    //testing a variable     
    test =  (select firstonly salesTable).salesId ? true : false;      

    //if condition     
    if ((select firstonly salesTable).recid)     
    {         
        return true;     
    }
      
    //switch statement     
    switch ((select firstonly salesTable).recid)     
    {  
        case 0:             
            return true;         
        case 1:             
            return false;         
    default:             
            return false;     
    }      

    //return statement     
    return ((select firstonly salesTable).recid); 
}
In standard you can find similar usage extensively in exists methods. This can make your code smarter and simpler
Run the job and see that you dont get any errors……
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
Старый 15.07.2010, 20:57   #2  
Vadik is offline
Vadik
Модератор
Аватар для Vadik
Лучший по профессии 2017
Лучший по профессии 2015
 
3,631 / 1849 (69) ++++++++
Регистрация: 18.11.2002
Адрес: гражданин Москвы
Цитата:
Run the job and see that you dont get any errors……
Интересно, сколько времени потребуется highly skilled technical consultant-у с 5 (согласно профайлу в Linkedin) годами стажа в AX чтобы обнаружить, что это распространяется не только на exists методы?
__________________
-ТСЯ или -ТЬСЯ ?
Старый 15.07.2010, 21:13   #3  
casperkamal is offline
casperkamal
Участник
 
10 / 22 (1) +++
Регистрация: 16.03.2007
Адрес: Hyderabad, India
Sharing it today doesn't meant that i got to know it today vadik
Старый 16.07.2010, 10:28   #4  
coolibin is offline
coolibin
Участник
 
264 / 68 (3) ++++
Регистрация: 07.04.2005
casperkamal, great to see you on this site! How about joining other topics here?
Старый 16.07.2010, 13:52   #5  
casperkamal is offline
casperkamal
Участник
 
10 / 22 (1) +++
Регистрация: 16.03.2007
Адрес: Hyderabad, India
Thanks for your welcome coolibin... I'll definitely join other threads too
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
kamalblogs: Virtual Convergence Dynamics Ax — Don’t Miss it !!! Blog bot DAX Blogs 0 03.06.2010 13:05
emeadaxsupport: List of fixes that improve performance of certain features in Dynamics AX 2009 Blog bot DAX Blogs 0 13.10.2009 19:06
CRM DE LA CREME! Configuring Microsoft Dynamics CRM 4.0 for Internet-facing deployment Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05
Developer for Microsoft Dynamics AX Certification Roadmap Blog bot DAX Blogs 1 13.05.2009 16:17
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 20:14.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.