Showing posts with label Miscellaneous code. Show all posts
Showing posts with label Miscellaneous code. Show all posts

Thursday, July 10, 2025

Miscellaneous code

 1) Dimensions  view :- To get all dimension values use this views

DimensionAttributeLevelValueAllView  ---ldger 

DefaultDimensionView   ------------------------default 


---------------------------------- 

2) To access Global declared buffers in methods 

Use "element.buffer" by  this one can get all buffers from global level.  

 

Note:- By just using element. You won't see the buffers list , just copy and paste and save you will see no errors 


-------------------------------------------------------------------------

3) To insert data in TempDB table use snippet shown in below:-


 LedgerVoucherTransAuditLogDetailTmp tembuf;

 str note = "today test";

 ttsbegin;

 tembuf.GeneralJournalAccountEntry=5637144XXX;

 tembuf.Description="Manitest";

 tembuf.doinsert();

 ttscommit;

---------------------------------------------------------------------------------

4) To get user fullname from shortname 

code:-

HcmWorker::find(HcmWorker::userId2Worker(wfTracking.user)).name();

Note:- here wfTracking.user is the buffer i am using

Custom services in d365fo

 In this blog we see how to develop custom services in d365fo Mainly we need to develop 1) Request class 2) Response class  3) service class...