Wednesday 17 July 2024

Move custom field data to CustTrans or VendTrans from LedgerJournalTrans D365FO X++

 

Many times there are custom fields created on LedgerJournalTrans need the same information on Customer transactions. It can be achieved by extending existing class.

For this you need to extend existing class called CustVoucher


For customer data


[ExtensionOf(Classstr(CustVoucher))]

final class CustVoucher_Extension

{


 protected void initCustVendTrans(CustVendTrans _custVendTrans, LedgerVoucher                 _ledgerPostingJournal, boolean _useSubLedger) 

  {

    LedgerJournalTrans ledgerJournalTransLocal;

    next initCustVendTrans(_custVendTrans, _ledgerPostingJournal, _useSubLedger);

    CustTrans custTrans = _custVendTrans as CustTrans;  // Get custTrans table buffer form CustVendTrans map instance


    if (common.TableId == tableNum(LedgerJournalTrans)) 

    {

      LedgerJournalTrans ledgerJournalTrans = common;  // Get journalLine table buffer


      custTrans.CustomField1 = ledgerJournalTrans.CustomeField1;

      custTrans.CustomField2 = ledgerJournalTrans.CustomeField2;

    }

  }

}


Same way you can do for Vendor data. Use VendVoucher


Thursday 6 May 2021

File upload for entity '' in data project 'xxx' did not succeed.

 Error:

  1. File upload for entity '' in data project 'xxx' did not succeed.


Above error raised during file upload on project with package option.


  1. Unable to connect to remote server

This error raised when try to load default templates on data management > templates


Resolution:


start the Azure storage emulator by following the steps below:


on server, run command prompt as administrator.

Navigate to “C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\”

Run “AzureStorageEmulator.exe start”

This should resolve the issue reported above which surfaces while exporting data through data entities in Dynamics 365 for Operations.