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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 11.12.2009, 17:10   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006

Summary
If you have a page field that has a calculation as its SourceExpression and part of the calculation depends on another field, then the calculated field is not automatically recalculated when the other field is updated. The calculated field will first recalculate when the updated field's OnValidate trigger is run, which only runs if it contains code. So to enable the calculated field to recalculate automatically, you must put some code on the OnValidate trigger of the field that gets updated - even if it is only a comment line with no functionality.

Note: A page will only update a field if it detects that there is some code on the OnValidate trigger. This is done for performance reasons to avoid unnecessary updates.


Example
Let's say you have the following two fields on a page:

Field1:
Name=Txt1;
SourceExpr=Txt1;


Field2:
Name=NewTxt1;
SourceExpr=Txt1 + 'XYZ'

Field2 is supposed to add the text 'XYZ' to the value is entered in Field1. But when you enter a value in Field1, Field2 does NOT get automatically updated. To change this behaviour, add some C/AL code to the OnValidate trigger of Field1. For example, just add a simple comment like "//" or:

//This comment is used to update Field1 - do not delete

This will tell Field1 to run the OnValidation trigger, which in turn updates the other fields on the page.



Источник: http://feedproxy.google.com/~r/Micro...r-is-used.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


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

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

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