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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 13.11.2018, 03:30   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
powerobjects: Using Form Save with Custom Web Resources
Источник: https://www.powerobjects.com/2018/11...web-resources/
==============


Microsoft has provided plenty of tools for use when out-of-the-box customizations fall short. Using custom web resources on forms can be a powerful tool, but it should integrate seamlessly with the form. To accomplish this, the web resource can hook onto the save of the form. This provides an easy way for users to interact across the different parts of the form without having to worry about multiple toolbars. In today’s blog, we’ll show you how it’s done!

Let’s say we have a web resource that surfaces information from a different entity, or a different source all together, and allows user input. In just a few simple steps, we can save any data we need from the web resource at the same time as the form.

1. Retrieve initial modifiedon information:

var modifiedon = parent.Xrm.Page.getAttribute(“modifiedon”).getValue();

2. Set up callbacks:

parent.Xrm.Page.data.entity.addOnSave(function(context){

    //Trigger any necessary calls here

});

parent.Xrm.Page.getAttribute(“modifiedon”).addOnChange(function(context){

    modifiedOn = context.getFormContext().getAttribute(“modifiedon”).getValue();

});

3. Set modifiedon based on user interaction in the web resource:

If(WebResource Needs To Save){

    Xrm.Page.getAttribute(“modifiedon”).setValue(new Date());

}

else{

    Xrm.Page.getAttribute(“modifiedon”).setValue(modifiedOn);

}

While the user interacts with the web resource, it is setting the modifiedon field to either the saved date or a new date. This will make the form appear dirty whenever the web resource requires a save, or other function call, to happen. Users will no longer know they are interacting with a separate web resource.

We hope this comes in handy for you. For more tips and tricks – be sure to check out our blog!

Happy D365’ing!



Источник: https://www.powerobjects.com/2018/11...web-resources/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
powerobjects: Opening Web Resources in Dynamics 365 v8.2 versus v9.0 Blog bot Dynamics CRM: Blogs 0 20.09.2018 23:12
dynamicsaxtraining: Vendor returns Blog bot DAX Blogs 0 11.10.2012 00:11
dynamicsaxtraining: Purchase Blog bot DAX Blogs 0 11.03.2012 05:25
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
Inside Dynamics AX 4.0: The Web Framework Blog bot DAX Blogs 0 25.10.2007 03:04
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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