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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 23.04.2020, 00:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
New Image in FormGroupControl with BusinessCard Extended style
Источник: http://alexvoy.blogspot.com/2020/04/...trol-with.html
==============

Developing and customizing forms in D365 are limited by predefined patterns and styles.


We can however overcome these limitations to some extent by placing new form controls and changing properties of existing ones and, of course, a bit of coding.


As an example, let's add a new Workflow image similar to Expense category to be shown in BusinessCard form group control, once an expense is assigned to the current user.






There are multiple ways to achieve the required change. To mention a few, playing with Style and ExtendedStyle properies in design, changing form controls placement with Top, Bottom, Left, Right properties, playing with DisplayOptions at run time, combining both images into one, replacing the standard images to customized ones: one for Assigned-to-me Category and standard Category, and so one.






Here we consider adding a new image of Workflow icon next to the standard Category one.We have a display method returning the required image. The key point here is to set its ExtendedStyle property to card_imageSquare, so that it would be shown properly.






Now it looks almost perfect, but the new form control pushed a bit the currency amount out of the card frame.






Let's fix it by hiding the standard form control and placing its duplicate with ExtendedStyle = None.






The last thing is to make the text bold in order to emphasize it.



[ExtensionOf(tableStr(TrvExpTrans))]
final class TrvExpTrans_Extension
{
boolean isCurrentUserWorkflow()
{
...
}

display container currentUserWorkflowIndicator()
{
ImageReference imgRef;
if (this.ApprovalStatus == TrvAppStatus::Pending && this.isCurrentUserWorkflow())
{
imgRef = ImageReference::constructForSymbol(ImageReferenceSymbol::Workflow);
return imgRef.pack();
}

return conNull();
}

[FormDataSourceEventHandler(formDataSourceStr(TrvExpenses, TrvExpTrans), FormDataSourceEventType::DisplayOptionInitialize)]
public static void ds_OnDisplayOptionInitialize(FormDataSource sender, FormDataSourceEventArgs e)
{
FormDataSourceDisplayOptionInitializeEventArgs eventArgs = e as FormDataSourceDisplayOptionInitializeEventArgs;

FormDesign fd = sender.formRun().design(0);
FormRowDisplayOption fo = eventArgs.displayOption();
FormControl fc = fd.controlName("newAmountCurrWithCurrencyCode");
// if we can find our new form control for the expense amount
if(fo && fc)
{
// let's make it bold to emphasize
fo.affectedElementsByControl(fc.id());
fo.fontBold(true);
}
}

}


The final view.




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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
german_nav_developer: Catch Me If You Can – try-catch für .NET in C/AL Blog bot Dynamics CRM: Blogs 0 22.09.2014 11:00
Platform updates overview - 3.70.B - NAV2009 R2 Blog bot Dynamics CRM: Blogs 0 07.02.2011 22:06
Nav developer: Table Information including Index information (Usage, Blocks and Reads) Blog bot Dynamics CRM: Blogs 0 25.08.2009 19:34
NAV Sustained Engineering Team Blog: Index Usage Query Blog bot Dynamics CRM: Blogs 0 26.02.2008 12:29

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

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

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