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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 07.01.2013, 15:02   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Before you think I give you the Oracle with this article … this is actually nothing but showing you a new feature in NAV2013.

New?

Not really .. but that's how Microsoft tells it :-). It wasn't there in NAV2009 RTC .. so it must be new, right? Well, not really .. because we already had this in the classic for years .. but it wasn't "ported" to the RTC in NAV2009.

OnAfterGetCurrRecord is BACK!

I hear you thinkin' .. Oh yeah!

A few weeks ago, I actually needed this in a NAV2013 project. I needed a "programmable" linked factbox, which contained records with a generic link, using RecordID. Let's say something like the table "Record Links". Suppose you've got a table like that, and want a factbox on any page to show the linked records of your table.

In a nutshell: I want a programmable linked factbox.

And that's fairly easy. It's just a matter of creating a function in your factbox that is going to take care of the filtering. Call this function "OnAfterGetCurrRecord" and that's about it:

Step 1: Create a factbox with a function to update your records

Like you see below, I created a new factbox on the "Record Link" table with two fields and the function which is going to take care of the filtering, based on the record ID. Not the "CurrPage.UPDATE", which is going to be necessary to refresh your factbox after filtering..



Step 2: Use your factbox, and call the function OnAfterGetCurrRecord:



To be able to call a function on your factbox, you'll have to name your factbox in (in my case) the Customer List page.. As you can see, I named it "RecLinkFactbox".

The code for your filtering can be as complex as you want it to be .. but of course .. keep "performance" in the back of your mind.

Speaking of which

One of the things we (as developers) always have to manage when doing these kind of things, are things like: "what if I don't show my factbox .. is it still going to call that function and do the filtering in the background?". Of course it does! And you SHOULD manage that .. and we actually can do that quite easily.

But that's for the next blogpost … :-)

If you want to read up on the OnAfterGetCurrRecord trigger .. here is a good place to start: http://msdn.microsoft.com/en-us/libr...v=nav.70).aspx

  

  

  

  

  



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


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

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

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