Wednesday, August 5, 2026

Get enumvalues through sql

 Generally in AOT sometimes we can not see tthe basenum values in properties so here is the query which helps 

SELECT
    EIT.NAME AS EnumName,
    EVT.ENUMVALUE,
    EVT.NAME AS EnumElement
FROM ENUMIDTABLE EIT
INNER JOIN ENUMVALUETABLE EVT
    ON EVT.ENUMID = EIT.ID
WHERE EIT.NAME = 'YourBaseenum'
ORDER BY EVT.ENUMVALUE;

Thursday, July 30, 2026

Get workflow firstApprover and firstapproval datetime through code

  WorkflowTrackingStatusTable wfTrackingTable;

 WorkflowTrackingTable       wfTracking;


 select firstonly wfTrackingTable

     order by wfTrackingTable.CreatedDateTime desc

             where wfTrackingTable.ContextTableId == _purchTable.TableId

             && wfTrackingTable.ContextRecId   == _purchTable.RecId;


 select firstonly   wfTracking

         order by wfTracking.CreatedDateTime asc

         where wfTracking.WorkflowTrackingStatusTable == wfTrackingTable.RecId

            && wfTracking.TrackingType == WorkflowTrackingType::Approval

             && wfTracking.TrackingContext==WorkflowTrackingContext::WorkItem;


 Date POApprovalDate = DateTimeUtil::date(wfTracking.CreatedDateTime);

 str POApprovedBy   = HcmWorker::find(HcmWorker::userId2Worker(wfTracking.user)).name();

Sunday, July 19, 2026

Get base enum lables insted enum ids in SSRS report

Generally in ssrs report to get baseenum labels instead basenum element id , we can do that in two ways

Way1) Take a  string field in Tmp table and make enum2str and assign.

Way2) In expressions generally we get for basenums =Fields!BaseenumName.Value now change it to 
Fields!BaseenumLabel.Value 
==> build it and check it.

Wednesday, July 8, 2026

Get workflow LastApprover and Lastapproval datetime through code

  WorkflowTrackingStatusTable wfTrackingTable;

 WorkflowTrackingTable       wfTracking;


 select firstonly wfTrackingTable

     order by wfTrackingTable.CreatedDateTime desc

             where wfTrackingTable.ContextTableId == _purchTable.TableId

             && wfTrackingTable.ContextRecId   == _purchTable.RecId;


 select firstonly   wfTracking

         order by wfTracking.CreatedDateTime desc

         where wfTracking.WorkflowTrackingStatusTable == wfTrackingTable.RecId

            && wfTracking.TrackingType == WorkflowTrackingType::Approval

             && wfTracking.TrackingContext==WorkflowTrackingContext::WorkItem;


 Date POApprovalDate = DateTimeUtil::date(wfTracking.CreatedDateTime);

 str POApprovedBy   = HcmWorker::find(HcmWorker::userId2Worker(wfTracking.user)).name();

Tuesday, July 7, 2026

SSRS report

 To make values empty while opening contract and making last given values empty

code:-

In controller class :-

 protected void prePromptModifyContract()

 {

     super();


     MyContract contract = this.parmReportContract().parmRdpContract() as MyContract;


     if (contract)

     {

         contract.parmFromDate(dateNull());

         contract.parmToDate(dateNull());

         contract.parmPRNumber(null);

     }

 }

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



Get enumvalues through sql

 Generally in AOT sometimes we can not see tthe basenum values in properties so here is the query which helps  SELECT     EIT.NAME AS EnumNa...