Showing posts with label Financial dimensions Mandatory. Show all posts
Showing posts with label Financial dimensions Mandatory. Show all posts

Friday, October 13, 2023

Financial dimensions Mandatory

How to write Code for financial dimension mandatory.

 [ExtensionOf(classStr(ProjJournalCheckPost))]

       internal final class DAXJournal_Extension

       {

           protected void postJournal(JournalTransList _journalTransList)

           {

               DimensionAttribute                  dimAttr;

               DimensionAttributeValue             dimAttrValue;

               DimensionAttributeValueSetItem      dimAttrValueSetItem;

               ProjJournalTrans                    ProjJournalTrans;

               RefRecId                            defaultDimension;

               JournalTransMap                     journalTransMap;

               boolean                             ret;

               next  postJournal(_journalTransList);

               journalTransMap = _journalTransList.item();

               projJournalTrans = journalTransMap;

               dimAttr             =   DimensionAttribute::findByName('Department');

               select firstonly RecId, DisplayValue from dimAttrValueSetItem

            where dimAttrValueSetItem.DimensionAttributeValueSet == ProjJournalTrans.DefaultDimension

         join dimAttrValue

     where dimAttrValue.RecId == dimAttrValueSetItem.DimensionAttributeValue

                   &&  dimAttrValue.DimensionAttribute == dimAttr.RecId

                     &&  dimAttrValue.IsDeleted == false;

               if (!dimAttrValueSetItem.DisplayValue)

               {

                   Warning("Department must be specified.");

               }

           }

       }


How to Retrieve the Purchase Order Number in the LedgerTransAccount Form using X++ in D365 Finance & Operations

 How to Retrieve the Purchase Order Number in the LedgerTransAccount Form using X++ in D365 Finance & Operations [ExtensionOf(tableStr(G...