Monday, January 19, 2026

Debug In D365fo with Tier 2 environment database

 Today in this blog we will see how to debug in d365fo with Tier2 env's(uat,gc,preprod)

Step 1:-  Request JIT access 

If you have LCS access take JIT by providing IP of DEV Env  or else

Request from Admin We will get credentials in the format shown below


Servername/DBname

Username

Password

Step 2:- Turn off All Services like w3,worldwide,batches services 

Step 3:- Go to Folder from Filemanger K>AOSService\webroot as shown in image below and locate webconfig file

Step 5:- Copy the file and place it on desktop as back once debugging we need make back local DB

Step 6:- After that Right Click and open with latest visual studio(VS2022) as shown in below

Step 7:- After opening the file Press ctrlf and search AXDB and what ever credentials we got from LCS Replace with them as shown in below

Step 8:- After that for password ctrlf search for Password then change for Databaseacces.Sqlpwd as shown in below

Step 9:-  Save the changes and restart all  services and start debugging !!

Step 10:- Once you finish the process down the services and replace file and Turn on services to get back to normal


Thank You!!

Tuesday, December 9, 2025

Get ledger dimension description beside dimension in d365fo x++

 In this blog we learn how to Get ledger dimension description beside dimension in d365fo x++


Step1)write a display method in table and give in formdatasource

logic:-

       [ExtensionOf(tableStr(BudgetTransactionLine))]

internal final class DaxBudgetTransactionLine_Extension
{
        public display str descriptionLedger()
    {
        str                                 descriptionLedgerLoc = '';

     boolean                             first = true;
     DimensionAttributeLevelValueAllView view,viewloc;
     DimensionAttributeValue             dimValue;
     DimensionAttributeValueGroup        dimensionAttributeValueGroup;
     container                           con;

 

     select firstonly viewloc
         where viewloc.ValueCombinationRecId==this.LedgerDimension;


     while select view order by view.ValueOrdinal asc 
         where view.ValueCombinationRecId == this.LedgerDimension 
&& view.DimensionAttributeValueGroup==viewloc.DimensionAttributeValueGroup

     {
         dimValue = DimensionAttributeValue::find(view.AttributeValueRecId);

         if (!conFind(con,view.AttributeValueRecId))
         {
             con += [view.AttributeValueRecId];
             if (dimValue)
             {
                 if (!first)
                 {
                     descriptionLedgerLoc += " - ";
                 }

                 descriptionLedgerLoc += dimValue.getName();
                 first = false;
             }
         }
     }

     return descriptionLedgerLoc;
}

}

 

 

 Output:-

Wednesday, November 19, 2025

Filter Attachments Docuref when attachments are attached from standard and through custom

 [ExtensionOf(formDatasourceStr(DocuView,DocuRef))]

final class DaxDocuViewForm_Extension
{
    void initValue()
    {
        DocuRef      docuref;
        next initvalue();
        //Args args = element.args();
        //PurchTable     purchtable = args.record();
        if(element.args().menuitemname() == menuitemdisplaystr(Dax_VendorattachmentMenuitem))
        {
            docuref.DAX_NoYes = NoYes::Yes;
        }
        else
        {
            docuref.DAX_NoYes = NoYes::No;
        }
    }
}


and in Docuhistory:-

internal final class Dax_DocuHistoryTable
{

    [DataEventHandler(tableStr(DocuHistory), DataEventType::Inserted)]
    public static void DocuHistory_onInserted(Common sender, DataEventArgs e)
    {
        DocuHistory docuHistory = sender as DocuHistory;
        DocuHistory docuHistoryloc;
        DocuRef     docuRef;
        if(docuHistory.DocuValueDeleted==NoYes::No)
        {
            if (!docuHistory)
            return;

 

            select firstonly docuRef
                where docuRef.RecId == docuHistory.DocuRefRecId;

 

                if (docuRef)
                {
                    ttsbegin;
                    docuHistory.selectForUpdate(true);
                    docuHistory.Dax_IsCustomAttachment = docuRef.DAX_NoYes;
                    docuHistory.update();
                    ttscommit;
                }
        }
        else
        {
            if (!docuHistory)
            return;
            select firstonly docuHistoryloc
                where docuHistoryloc.DocuRefRecId==docuHistory.DocuRefRecId
&& docuHistoryloc.DocuValueDeleted==NoYes::No;
            ttsbegin;
            docuHistory.selectForUpdate(true);
            docuHistory.Dax_IsCustomAttachment =docuHistoryloc.Dax_IsCustomAttachment;
            docuHistory.update();
            ttscommit;

 

        }
    }

 

}

Tuesday, November 18, 2025

Highlight text of record based on condition in d365fo x++

 public void displayOption(Common _record, FormRowDisplayOption _options)

{

    WorkflowWorkItemTable workflowWorkItemTable;


    select workflowWorkItemTable

        where workflowWorkItemTable.Status==WorkflowWorkItemStatus::Pending

        && workflowWorkItemTable.UserId==curUserId()

        && workflowWorkItemTable.RefRecId==_record.RecId

        && workflowWorkItemTable.RefTableId==tableNum(BudgetTransactionLine);


    BudgetTransactionLine  budgetTransactionLine=_record;

    if(workflowWorkItemTable)

    {

        _options.textColor(WinAPI::RGB2int(0, 150, 0));

    }

    next displayOption(_record,_options);

}

Write a condition on HTML editor control if it is having value in d365fo x++

 Htmleditor htmledc=formRun.design().controlName("YourHtmlEditorControlName") as Htmleditor;

if(htmledc.parmHtmlContent())

{write condtion}

Wednesday, October 22, 2025

Get salestax amount of each individual purchline

 Scenario:- In this post we see how we can get salestax amount of a purchline from purchase order

code:-

PurchTable purchTable =PurchTable::find('00000400');
PurchTotals purchTotals = PurchTotals::newPurchTable(purchTable);
purchTotals.calc();
TmpTaxWorkTrans tmpTaxWorkTrans;
tmpTaxWorkTrans.setTmpData(purchTotals.tax().tmpTaxWorkTrans());

real salestax;

while select * from tmpTaxWorkTrans
     where tmpTaxWorkTrans.SourceRecId == Pass Purchlinerecid
{
     // Process the tax information for the specific line
     salestax+=tmpTaxWorkTrans.TaxAmount;
}

info(strfmt("SalesTaxamount:-%1",salestax));

Thursday, September 18, 2025

change lookup for documenttype in file upload from leave request

 Scenario:- Today in this blog we see how to alter lookup of document type based on document type in leave request form as shown in image below


 >>To get lookup of all document types write this logic

[ExtensionOf(classstr(DocuUpload))]
internal final class docucoc_Extension
{
    public DocuManagementOptions parmDocuMgmtOptions(DocuManagementOptions _value )
    {
        DocuManagementOptions docuMgmtOptions = next parmDocuMgmtOptions(_value);
        int num=this.currentTableId();
        if(tableId2Name(num)=="LeaveRequest")
        {this.setupDocuTypescoc();}
        return docuMgmtOptions;
    }

 

    public  void setupDocuTypescoc()
    {
        List            docuTypeList;
        ListIterator    docuTypeListIterator;
        ComboBoxItem    comboxBoxItem;

 

        // Get the list of document types for the primary table
        docuTypeList = DocuUpload::getDocuTypeListcoc();

 

        // Set the list of document types
        this.documentTypes(docuTypeList);

 

        // Initialize the iterator for the list of document types
        docuTypeListIterator = new ListIterator(docuTypeList);

 

        // If the iterator has at least one item, set the selected document type to the first element;
        // otherwise set the selected document to an empty string
        if (docuTypeListIterator.more())
        {
            comboxBoxItem = docuTypeListIterator.value();
            this.selectedDocumentType(comboxBoxItem.parmValue());
        }
        else
        {
            this.selectedDocumentType('');
        }
    }

 

    private static List getDocuTypeListcoc()
    {
        DocuType        docType;
        List            docuTypeList = new List(Types::Class);
        UserInfo        userInfo;

 

        // Get the current language
        select language from userInfo
            where UserInfo.id == curUserId();

 

        // Add all document types that aren't a document library
        while select @TypeId,ActionClassId from docType
            //index TypeIdx
            //where docType.ActionClassId == classNum(DocuActionArchive)
        {
            // If the document type isn't valid, just continue to the next element instead of adding it
            if (DocuEvent::doCheckSkipDocuType(docType))
            {
                continue;
            }

 

            docuTypeList.addEnd(new ComboBoxItem(docType.TypeId, docType.TypeId));
        }

 

        return docuTypeList;
    }

 

}

 

 





Debug In D365fo with Tier 2 environment database

 Today in this blog we will see how to debug in d365fo with Tier2 env's(uat,gc,preprod) Step 1:-  Request JIT access  If you have LCS ac...