Sunday, July 5, 2026

Maintenance mode in d365fo

 Scenario:- Generally For activating some configurations  maintenance mode is required .

This can be done in two ways

1) From LCS

2) SQL procedure

We discuss here 2 step 

 SQL procedure

Step1) First of all  , run this script 

select * from SQLSYSTEMVARIABLES where PARM = 'CONFIGURATIONMODE'


result :- value field 0=normal and 1= maintenance mode


Step2) To turn into maintenance mode run the below script

update SQLSYSTEMVARIABLES SET VALUE = 0 where PARM = 'CONFIGURATIONMODE'


Step3) DO iisreset in commandprompt

Step4) do db sync

visualstudio>extensions>syncorinzedb

Step 5) Now after db sync env will be in maintence mode

Note:- after activating and put maintenance mode back to normal by following same procedure but with 0



Wednesday, June 24, 2026

Get product receipt details from posted invoice

 code:-

sql:-

select DISTINCT vendPackingSlipTrans.PACKINGSLIPID from vendInvoiceTrans

inner join vendInvoiceJour

  on vendInvoiceTrans.PurchID = vendInvoiceJour.PurchId and

      vendInvoiceTrans.InvoiceId = vendInvoiceJour.InvoiceId and

      vendInvoiceTrans.InvoiceDate = vendInvoiceJour.InvoiceDate and

      vendInvoiceTrans.NumberSequenceGroup = vendInvoiceJour.NumberSequenceGroup and 

      vendInvoiceTrans.InternalInvoiceId = vendInvoiceJour.InternalInvoiceId

  inner join vendInvoicePackingSlipQuantityMatch

      on vendInvoicePackingSlipQuantityMatch.InvoiceSourceDocumentLIne = vendInvoiceTrans.SourceDocumentLine

  inner join vendPackingSlipTrans

      on vendPackingSlipTrans.SourceDocumentLine = vendInvoicePackingSlipQuantityMatch.PackingSlipSourceDocumentLine

  and vendInvoiceJour.LEDGERVOUCHER='pass your journal vocuher'

Monday, May 11, 2026

Assign roles through ssms in d365fo

 Step1;- Here my Role name I want to assign is System admin

SELECT  RecId,* FROM SecurityRole WHERE Name = 'System administrator';

step 2:- User name here is sai  and pass recid from above to below query

insert into SECURITYUSERROLE (USER_, SECURITYROLE, ASSIGNMENTSTATUS, ASSIGNMENTMODE)
VALUES ('sai', 171,1,1);


Thats it!! refresh and check


For deleting of roles through SSMS

Step1:-SELECT  RecId,* FROM SecurityRole WHERE Name = 'System administrator';

pass recid from above to below query

Step 2:-DELETE FROM SECURITYUSERROLE WHERE USER_='sai'and SECURITYROLE=171;


Thank you!!

Thursday, April 30, 2026

Get all Dimensions values with - separated with provided dimension recid

 To get all dimension with - separated with provided dimension recid

Code:-

public static str Getdimensionset(RecId recid)
{
     str                                 descriptionLedgerLoc = '';
     boolean                             first = true;
     DimensionAttributeLevelValueAllView view,viewloc;
     DimensionAttributeValue             dimValue;
     DimensionAttributeValueGroup        dimensionAttributeValueGroup;
     container                           con;

     select firstonly viewloc
         where viewloc.ValueCombinationRecId==recid;

 

     while select view order by view.ValueOrdinal asc
      where view.ValueCombinationRecId == recid
&& view.DimensionAttributeValueGroup==viewloc.DimensionAttributeValueGroup
     {

         if (!first)
         {
             descriptionLedgerLoc += " - ";
         }
         descriptionLedgerLoc +=view.DisplayValue ;
         first = false;


     }
     return descriptionLedgerLoc;
}


Note:-dimensions will get with - separated

Thank you!!

Get dimensions values with provided dimension Recid

 To get Dimensions value as displayed in Control level 

Code:-

LedgerDimensionFacade::getDisplayValueForLedgerDimension(DimensionRecid);

Note:- dimensions will get with ~ separated

Thank you!!

Thursday, April 23, 2026

Run a class through front end in d365fo

 link to run a class from front end through sysclassrunner

dynamics url/?mi=SysClassRunner&cls=classname

Maintenance mode in d365fo

 Scenario:- Generally For activating some configurations  maintenance mode is required . This can be done in two ways 1) From LCS 2) SQL pro...