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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 20.10.2008, 11:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
palleagermark: Saving the reference to a unique record as a string
Источник: http://palleagermark.blogspot.com/20...record-as.html
==============

Sometimes you have have to store a unique reference to record as a string, for example if you want to include this reference in an XML file.

Merely converting the RecId to a string is not always a good idea. The best choice for identifying the record may be another unique key of the table, especially if the table doesn't have a RecId index.

On the Global class there is a method to analyze the unique keys of a table and give you the unique key as a string. This is the record2Dynakey method.

The key is encoded in the string like this:
[fieldid:strvalue][fieldid2:strvalue][fieldid3:strvalue]

Later when you want to convert the string, representing the key, to an actual record, just call the dynaKey2Record method.

You should not use this technique for long term storage of keys, since renaming primary keys or changing the datamodel might break the ability to restore the string into the right record or restoring it in the most sufficient way.

Источник: http://palleagermark.blogspot.com/20...record-as.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
palleagermark: EP 2009: Edit a record outside a grid Blog bot DAX Blogs 0 05.11.2008 11:05
casperkamal: Using record templates in code for Dynamics Ax 4.0. Blog bot DAX Blogs 0 10.05.2008 19:14
Dynamics AX Geek: Interesting fact about set(Types::Record) Blog bot DAX Blogs 0 28.10.2006 16:40
Fred Shen: Always use recId to know if a select statement returns a record Blog bot DAX Blogs 0 28.10.2006 16:40
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

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