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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 30.07.2013, 14:32   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
Have a look at these code samples and tell me where a compound statement, i.e. BEGIN-END, should be constructed to get the code work right.

Just dare without going into NAV and verify.


Sample 1
1. SalesCommentLine.SETRANGE("Document Type",SalesQHeader."Document Type");
2. SalesCommentLine.SETRANGE("No.",SalesQHeader."No.");
3. WHILE SalesCommentLine.FIND('-') DO
4. SalesCommentLine.DELETE;
5. SalesCommentLine."Document Type" := SalesOrderHeader."Document Type";
6. SalesCommentLine."No." := SalesOrderHeader."No.";
7. SalesCommentLine.INSERT;

Sample 2
1. IF AccountingPer2.FIND('>') THEN
2. FiscalYearEndDate := CALCDATE('<-1D>',AccountingPer2."Starting Date");
3. AccountingPer3 := AccountingPer2;
4. AccountingPer2.SETRANGE("New Fiscal Year");
5. AccountingPer2.FIND('<')
6. ELSE
7. ERROR(Text001);

Sample 3
1. CASE "Action Taken" OF
2. "Action Taken"::Won:
3. IF Opp.GET("Opportunity No.") THEN
4. SalesQuoteEnable := Opp."Sales Document No." <> '';
5. "Action Taken"::Lost:
6. CalcdCurrentValueLCYEnable := FALSE;
7. SalesQuoteEnable := FALSE;
8. END;

Sample 4
1. CASE LOWERCASE("XBRL Item Type") OF
2. 'stringitemtype','string':
3. "Source Type" := "Source Type":escription;
4. 'monetaryitemtype':
5. "Source Type" := "Source Type"::"General Ledger";
6. 'decimalitemtype':
7. "Source Type" := "Source Type"::Constant;
8. 'sharesitemtype' :
9. "Source Type" := "Source Type"::Constant;
10. 'uriitemtype':
11. "Source Type" := "Source Type":escription;
12. 'tupletype':
13. "Source Type" := "Source Type"::Tuple;
14. ELSE
15. "Source Type" := "Source Type"::"Not Applicable";
16. IF "XBRL Item Type" <> '' THEN
17. Description := STRSUBSTNO(Text007,"XBRL Item Type");
18. END;

Sample 5
1. WITH ResJnlLine2 DO
2. IF "Resource No." <> '' THEN
3. IF ResJnlTemplate.Recurring THEN BEGIN
4. TESTFIELD("Recurring Method");
5. TESTFIELD("Recurring Frequency");
6. IF "Recurring Method" = "Recurring Method"::Variable THEN
7. TESTFIELD(Quantity);
8. END ELSE BEGIN
9. TESTFIELD("Recurring Method",0);
10. TESTFIELD("Recurring Frequency","0DF");
11. END;
For reference I have added numbers to each code line. Please use it as follows: if in case in Sample 2 the BEGIN should be added to line 2 and it's balancing END to line 4, you could suffice with writing Sample 2 - line2/line4.



Читать дальше
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 03:25.