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

Опции темы Поиск в этой теме Опции просмотра
Старый 23.01.2019, 11:11   #1  
Blog bot is offline
Blog bot
24,236 / 809 (75) +++++++
Регистрация: 28.10.2006
ax.docentric: Comment on Append Terms and Conditions to printed Purchase orders or Invoices in D365FO by Ana

Hi Bablu,You did everything OK but the thing is that we did this example on the existing DSP class for Purchase order (DocPurchPurchaseOrderReportDSP), which can be found in our additional model: Docentric AX SSRS Replicas.We actually strongly recommend to install this model no matter if you are using Free or Full Edition because it will bring you numerous benefits such as report specific placeholders and support for improved Print archive: How to make it work with your custom classThe method which was modified in the blog article is the private method which is not overridden nor called from your custom class, so it gets never executed.I suggest to move this code snippet in your overridden generateXmlDataSource() method, after calling the super().It should look like the following:protected void generateXmlDataSource(DocXmlRecordBuilder _recordBuilder){ super(_recordBuilder); _recordBuilder.goToParentRecord(); DocXmlRecord topDataRecord = _recordBuilder.currentRecord(); DocXmlRecord subDocumentsDataRecord = topDataRecord.addChildCalculatedRecord('Subdocuments'); purchTable = PurchTable::find(purchId); // Use PurchId stored in the onSelectedRdpTableRecord() method. DocuRef docuRef; while select docuRef where docuRef.RefTableId == purchTable.TableId & docuRef.RefRecId == purchTable.RecId & docuRef.TypeId == 'File' { using (System.IO.Stream docuRefStream = DocumentManagement::getAttachmentStream(docuRef)) { using (System.IO.MemoryStream subdocMs = new System.IO.MemoryStream()) { docuRefStream.Position = 0; docuRefStream.CopyTo(subdocMs); subDocumentsDataRecord.addCalculatedField(docuRef.Name, DocGlobalHelper::convertMemoryStreamToContainer(subdocMs)); } } }protected void onSelectedRdpTableRecord(Common _rdpTableRecord, TableName _rdpTableName){ PurchPurchaseOrderHeader purchPurchaseOrderHeader; super(_rdpTableRecord, _rdpTableName); // Store PurchId into a class global variable to use it in this.generateXmlDataSource() // method in order to add additional data related to the printing purchase order. if (tableStr(PurchPurchaseOrderHeader) == _rdpTableName) { purchPurchaseOrderHeader = _rdpTableRecord; purchId = purchPurchaseOrderHeader.PurchId; }}Please let me know if this worked out for your scenario.And yes, this code will work only if you attach Terms and conditions on each purchase order, which is not OK.Probably is better to attach this document, e.g. on particular legal entity and then fetch it from there.Kind regards,Ana

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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
ax.docentric: Comment on Append Terms and Conditions to printed Purchase orders or Invoices in D365FO by bablu Blog bot DAX Blogs 0 23.01.2019 11:11
DAX: Microsoft Dynamics AX 2012 R3: a preview Blog bot DAX Blogs 0 05.11.2013 15:11
dynamics-coe: Dynamics AX Export/Import Framework for Vendor balance migration Blog bot DAX Blogs 0 22.05.2013 20:13
Microsoft Dynamics AX Connector for SAP Poleax DAX: База знаний и проекты 0 17.03.2011 18:04
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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