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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 13.11.2013, 22:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
emeadaxsupport: Dynamics Ax 2012: How to implement an edit method and use it within Enterprise Portal
Источник: http://blogs.msdn.com/b/axsupport/ar...se-portal.aspx
==============



Overview

I want to assign specific colors to our customers. The color will help our sales representatives determine what industries they are in. We need to create an associated Colors table which contains the Accountnum and Color fields. We want to give the data entry personnel the ability to add/edit this field from within Enterprise Portal. We would like to do this using an edit method.

I have attached the word document for download.

Create the Colors table
  1. Within the AOT, navigate to Data Dictionary->Tables.
  2. Right-click the Tables element and select “New Table”.
    1. In the Name attribute, enter Colors.
  3. Expand the Colors table so you see its child nodes. (Fields, Field Groups, etc.)
  4. Open a new AOT window and navigate to Data Dictionary->Extended Data Types
  5. Locate the “AccountNum” Extended Data Type and drag it to the Fields node of the Colors table.
  6. Locate the “Color” Extended Data Type and drag it to the Fields node of the Colors table.
  7. Right-click the Indexes element under the Colors table and select “New Index”.
    1. Enter “AccountNum_Idx” for the Name attribute.
    2. Enter “No” for the AllowDuplicates attribute.
  8. Right-click the “AccountNum_Idx” and select “New Field”.
    1. In the DataField attribute select AccountNum.
  9. Right-click the Methods element and select “New Method”.
    1. Copy the following code into the new method.


10. Save the Colors table.

Your table layout should look similar to the image below:



Create the Edit Method on the CustTable
  1. Within the AOT, navigate to Data Dictionary->Tables->CustTable.
  2. Expand the CustTable table so you see its child nodes. (Fields, Field Groups, etc.)
  3. Right-click the Methods element and select “New Method”.
    1. Copy the following code into the new method.


4. Save the CustTable table.



Restore the CustomerDetail dataset.
  1. Within the AOT, navigate to Data Sets->CustomerDetail.
  2. Right-click the CustomerDetail dataset and select Restore.
Complete the incremental compile
  1. From the file menu select Build->Generate Incremental CIL.
Refresh the cache
  1. From the file menu select Tools->Caches->Refresh dictionary.
  2. From the file menu select Tools->Caches->Refresh data.
  3. From the file menu select Tools->Caches->Refresh elements.
Update the CustomerAddEdit user control
  1. Open Visual Studio 2010.
  2. From the file menu select View->Application Explorer.
  3. Within the Application Explorer navigate to Web->Web Files->Web Controls->CustomerAddEdit.
  4. Right-click the CustomerAddEdit user control and select “Edit”.
  5. The CustomerAddEdit.ascx file should open up in source view. Click “Design” tab at the bottom of the window.



  1. Locate the AxDataSource – CustomerDS element and select it.
  2. Click the arrow to open the AxDataSource Tasks.
  3. Click the Refresh Schema link.



  1. Locate the AxGroup – Administration element and select it.
  2. Click the arrow to open the AxGroup Tasks.
  3. Click the Edit Fields link.
  4. From the Bound Field Designer – Dataset View: CustTable window locate “editCustomerColor**” within the Available Fields frame.

  1. Click “Add Field” button.
  2. Highlight “editCustomerColor**” in the Selected Field frame and under BoundField Properties set the HeaderText to “Customer Color”

  1. Click OK.
  2. Save all items.
  3. Close Visual Studio. (If it asks you to save the item to the AOT, select yes.)
Deploy the user control
  1. Within the AOT, navigate to Web->Web Files->Web Controls->CustomerAddEdit.
  2. Right-click the CustomerAddEdit control and select “Deploy Element”.
Test the user control
  1. Open Enterprise Portal and from the left hand navigation refresh the AOD, Dictionary, and Data to ensure we are looking at the latest data.
  2. Navigate to the Sales site by selecting the Sales tab at the top of the web page.

  1. From the customer list, highlight a customer and select “Edit” from the action menu.
  2. Minimize the “General” tab.
  3. Expand the “Details” tab.
  4. Under the Administration group you should see the Customer Color field.

  1. Enter a color 9 character long or less. (Red, Green, etc).
  2. Click Save & Close from the Action Menu.
  3. You can then verify that a record was created using the table browser within the AOT.


Источник: http://blogs.msdn.com/b/axsupport/ar...se-portal.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


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

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

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