Posts

Showing posts from February, 2022

Consume odata/web api d365fo and parsing json content

// Two types of content type url will have usually , //1. normal URL encocoding(means adding parameters in url link)   //2. multiform-data(values needs to specify on webforms to accesss data ) //Check RetailCommonWebAPI and do find references how they are consuming odata API    class ALMMenaiHRMSIntegrationService {     str accessToken,responseJsONData;     RecordInsertList recIns;     public void  getAuthToken()     {         RetailCommonWebAPI  webApi;         str                 rawResponse;         RetailWebResponse   response;         URL loginURL;         str contentType;         Map docFields = new Map(Types::String, Types::Class);         webApi = RetailCommonWebAPI::construct();         loginURL = "https://hrms.almajed4oud.com/menaitech/index.php/api/login/";         Map strFields = new Map(Types::String, Types::String);         strFields.insert("UserName", "ERPintegrationAdmins");         strFields.insert("PassWord", "yed*mZC7LA66&

Get voucher transactions,settlement , and other details from customer , invocie other posted transactions via GJentry and subledger entry

   //From here the code is common for all posted transactions if Project invoice one then we need to join with projinvoicejour instead of vendinvoicejour like this way GeneralJournalAccountEntry accEntry; SubledgerVoucherGeneralJournalEntry subGjEntry ;  LedgerDimensionPreviewTmp   ledgerDimensionPreviewTmpLocal; while select maxof(GeneralJournalEntry) from  subGjEntry                         where subGjEntry.AccountingDate == vendInvoiceJour.InvoiceDate                         &&     subGjEntry.Voucher ==  vendInvoiceJour.LedgerVoucher                          join sum(TransactionCurrencyAmount),LedgerDimension,maxof(Text),maxof(IsCredit) from   accEntry group by accEntry.LedgerDimension                         where accEntry.GeneralJournalEntry  == subGjEntry.GeneralJournalEntry                         &&  accEntry.PostingType != LedgerPostingType::VendBalance                         &&  accEntry.PostingType != LedgerPostingType::InterunitCredit