Skip to main content

PostMan- Service


In this blog we will discuss simple custom service with normal parameters and with List parameters:

Normal Request Service:

1. Create a contract a class and add elements which you want to pass as parameters to get request:


2. Create a service and add the created method ( In operation class ) to it and add following properties:


3. Create a group service and add your created service in it and add following properties:


4. Create an Operation class to add your business logic in it 


If there is List of contracts and list used for requests through custom service then below mentioned classes can be used:

LIST Request-Response Service:

Above is the simple get list of order contract class and below mentioned is update list of orders


Below mentioned service class for GET request-list of orders:
Below mentioned service class is for UPDATE - PATCH list of orders: 
Below is the response contract for list of orders which will be updated:
Below mentioned sample Postman body for list of orders:



  
HEY HEY HEY !!! HACK OF THE DAY !!!

Always remember to add AIF COLLECTION 

While Using List as the return type.

Comments

Popular posts from this blog

Edit Method on Form

Edit Method D365 for a form Data Source 1. To create an edit method first create a controller class. with following properties  public static edit MainAccountNum LedgerJournalTransLedger(LedgerJournalTrans _ledgerjournal, boolean _set, MainAccountNum _id) { MainAccountNum accountId = _id; MainAccount mainAccount = MainAccount::findByMainAccountId(_id); if(_set) { if(_ledgerjournal.AccountType== LedgerJournalACType::Ledger) { mainAccount = MainAccount::findByMainAccountId(accountId); if(_ledgerjournal.LedgerDimension) { DimensionDefault defaultDim = LedgerDimensionFacade::getDefaultDimensionFromLedgerDimension(_ledgerjournal.LedgerDimension); _ledgerjournal.LedgerDimension = LedgerDimensionDefaultingEngine::getLedgerDimensionFromAccountAndDim(mainAccount.RecId, DimensionHierarchy::getAccountStructure(mainAccount.RecId), defaultDim); } else { _ledgerjournal.LedgerDimension = LedgerDimensionDefaultingEngine::getLedgerDimensionFromAccountAndDim(mainAccount.RecId, DimensionHierarchy::ge...

EXCEL Add-in D365 FO

EXCEL add-in USED FOR D365 DATA ENTITY To use excel add-in for D365 data entities for CRUD operations. You can easily follow below mentioned steps: 1. Open Excel from any Desktop or VM and click on Add-ins option under insert tab: 2. Check if you have Microsoft Dynamics Office Add-ins, If not then download it from Microsoft store: 3. If you have above mentioned Add-in click on this and click add server information: 4. In server URL add your environment URL either dev, UAT or PROD and click OK.  for e.g:  (https://xxxxxxxxxxxxxxxxxxx.dynamics.com/)  5. Click on Design button and it will display below mentioned screen: 6. Click on Select entity data source and choose your desired data entity from list on which you need to perform CRUD operations and click on NEXT: 7. Double click on each field present in AVAILABLE FIELD SECTION to get them in SELECTED FIELD SECTION: 8. Click on Refresh Once and you will be able to see data in your entity in Excel: 9. After making changes to...

Field Level Security In Ax 2012

FIELD LEVEL SECURITY IN AX 2012 In this blog we will discuss field level security applied in  Ax 2012. 1. Field level security is added on form level as well in Ax 2012 its bit different then field level security in D365 2. This also requires privileges to be applied on form specific fields only. Step #1 :  Change datasource property of the field which need to be added in security. Step #2 : Now add these 2 fields in form --- > permissions --- > Read Step #3 : Now finally create privilege and add these fields explicitly in it.       HEY HEY HEY !!!! HACK OF THE DAY  Add Fields in Entry point privilege section of form  Explicitly.