Posts

Showing posts from June, 2020

Deleting a model in all environments

Image
At my company we use the known topology of environments. Devboxes, pre-test, customer test, UAT, Golden Config and Production. Lately I got the task of uninstalling an under-performing third party ISV module. This was a set of three models checked in from a devbox with source code. My thought were just to remove the models (using modelutil.exe) and check in the changes into TFS. Did not work on every other machine but the one doing the work, this because TFS only makes changes to models and does not delete them.  The proper way of doing things are to empty out the models, clean them of source code. Build the single deploy-able package (SDP) and install it normally, as if it was a normal code upgrade. The next time you perform this task of code upgrade, we have to download the SDP and add something to it before it gets installed. First set of tasks In Visual Studio, in the AOT search for model: "model name" , add all elements to new projects by right clicking it. D

Customer payment transaction, mark for settlement against invoice and post

Pre requisite is that you have your CustInvoiceJour table containing the invoice you wanted to receive payment for and settle. //... //Create your LedgerJournalTable and LedgerJournalTrans //ledgerJournalTrans.InvoiceId must be blank to hinder this becoming a free text invoice ledgerJournalTrans.MarkedInvoice = custInvoiceJour.InvoiceId; ledgerJournalTrans.MarkedInvoiceCompany = custInvoiceJour.DataAreaId; ledgerJournalTrans.MarkedInvoiceRecId = CustTransOpen::getFirstDueRecIdByInvoice(ledgerJournalTrans.MarkedInvoice); ledgerJournalTrans.insert(); //mark the open customer transactions LedgerJournalEngine_CustPayment::updateMarkedInvoiceSpecTrans(ledgerJournalTrans); After posting the payment journal, if everything validates, your transactions will be settled. //Post the journal LedgerJournalCheckPost::newLedgerJournalTable(ledgerJournalTable, NoYes::Yes).runOperation();

Lets make a service

Image
Custom services in D365 is a nice way to integrate with D365. In this post I will show how one can set up to receive JSON data and store it in a Table. To create a service you need these elements to make it operational A service class A service  A service group 1. Create your service class.  I created this simple service class that takes JSON as a parameter and inserts the data into a table. class TestService {     public System.Object testService(Newtonsoft.Json.Linq.JArray _data)     {         TestTable testTable;         int counter;         System.String netString = '';               System.IO.StringWriter          stringWriter    = new System.IO.StringWriter();         Newtonsoft.Json.JsonTextWriter  jsonWriter      = new Newtonsoft.Json.JsonTextWriter(stringWriter);         counter = this.processData(_data);         jsonWriter.WriteStartObject();         jsonWriter.WritePropertyName('processed lines');         jsonWriter.WriteValue(c