Backup from UAT to Dev
Daxing with Lohith
Tuesday, February 11, 2025
Monday, February 10, 2025
Azure Devops configurations
The below link provides information on how to create a DevOps project and link it to LCS
Key points :
While creating a project Keep version control as Team Foundation Version Control.
Must copy the Public access token when linking with the LCS.
Setup Azure DevOps Project for Dynamics 365 Finance and Operations
...........................................................................................................................
The below link provides the information on how to create build server in LCS
how to create a Agent Pool, and branching
https://www.youtube.com/watch?v=k-Wnjf9T5YU
........................................................................................
The below link provides the information of how to create a Dev Machine.
How to connect VS to workspace.
Wednesday, February 5, 2025
Export data from all legal entities using DIXF
Check the value of ‘Primary company context‘ in the entity. By default, it is set to ‘DataAreaId’. This means the data will be exported specific to the company.
Clear the value from this property if the requirement is to export data from all the legal entities in a single execution.
Tuesday, February 4, 2025
Code to get workflow assignee in X++
public UserId getWorkflowAssignee()
{
WorkflowTrackingStatusTable workflowTrackingStatusTable;
WorkflowWorkItemTable workflowWorkItemTable;
UserInfo userInfo;
UserId ret;
select firstonly workflowWorkItemTable
where workflowWorkItemTable.Type == WorkflowWorkItemType::WorkItem
&& workflowWorkItemTable.Status == WorkflowWorkItemStatus::Pending
join workflowTrackingStatusTable
where workflowWorkItemTable.CorrelationId == workflowTrackingStatusTable.CorrelationId
&& workflowTrackingStatusTable.ContextTableId == this.TableId //your table id
&& workflowTrackingStatusTable.ContextRecId == this.RecId
&& workflowTrackingStatusTable.TrackingStatus == WorkflowTrackingStatus::Pending
join userInfo
where workflowWorkItemTable.UserId == userInfo.id;
if (workflowWorkItemTable.RecId)
{
ret = userInfo.id;
}
return ret;
}
Workflow step name x++
I need to fetch the name of the "Step" of the workflow.
For example:
In my workflow, step1 : approved by teamlead (name of step)
step2: approved by manager (name of step)
so, I need to show the name i.e: approved by teamleader
public display Description currentStep() { WorkflowTrackingTable trackingTable; WorkflowTrackingStatusTable trackingStatusTable; select RecId, User,Name, CreatedDateTime from trackingTable order by CreatedDateTime desc where trackingTable.TrackingType == WorkflowTrackingType::Creation && trackingTable.TrackingContext == WorkflowTrackingContext::Step join trackingStatusTable where trackingTable.WorkflowTrackingStatusTable == trackingStatusTable.RecId && trackingStatusTable.ContextRecId == this.RecId && trackingStatusTable.ContextTableId == this.TableId; return trackingTable.Name; }
Thursday, January 30, 2025
Error
Wednesday, January 15, 2025
Working with date functions
1. How to get current date in dynamics 365 Finance and Operations?
In Dynamics 365 Finance and Operations a date function today() is used to get the current date from the given date in dynamics 365 finance and operations,This function returns the current date that is used by the client.
Here i have created one runnable class DateFunctionsJob. Once you created the class , you can copy and paste the below codes as per your requirements.

internal final class DateFunctionsJob
{
public static void main(Args _args)
{
Transdate dateToday ;
dateToday = today();
info(strfmt("Date- %1",dateToday));
}
}
Output :
Date - 7/22/2023
2. How to gets the Month Number from the given date in Dynamics 365 Finance and Operations?
public static void main(Args _args)
{
Transdate dateToday;
int monthNumber;
dateToday = today();
monthNumber=mthofYr(dateToday);
info(strfmt("Month Number - %1",monthNumber));
}
Output :
Month Number- 7
3. How to gets the Month Name from the given date in Dynamics 365 Finance and Operations?
public static void main(Args _args)
{
Transdate dateToday;
str monthName ;
dateToday = today();
monthName = mthname(mthofYr(dateToday));
info(strfmt("Month Name - %1",monthName));
}

Output :
Month Name - July
4. How to gets the Day Number from the given date in Dynamics 365 Finance and Operations?
public static void main(Args _args)
{
Transdate dateToday;
int dayNumber;
dateToday = today();
dayNumber = dayOfMth(dateToday);
info(strfmt("Day Number- %1",dayNumber));
}
Output :
Day Number - 22
5. How to gets the Day Name from the given date in Dynamics 365 Finance and Operations?
public static void main(Args _args)
{
Transdate dateToday;
str dayName;
dateToday = today();
DayName = dayname(dayOfMth(dateToday));
info(strfmt("Day Name - %1",dayName));
}
Output :
Day Name - Saturday
6. How to get the year from the given date in Dynamics 365 Finance and Operations?
public static void main(Args _args)
{
Transdate dateToday;
int year ;
dateToday = today();
Year =year(dateToday);
info(strfmt("Year - %1",year));
}
Output :
Year - 2023
7. How to gets the week day number from the given date in Dynamics 365 Finance and Operations?
public static void main(Args _args)
{
Transdate dateToday;
int weekDayNumber;
dateToday = today();
weekDayNumber= dayOfwk(dateToday);
info(strfmt("Week Day Number - %1",weekDayNumber));
}

Output :
Week Day Number - 6
8. How to gets the day of year from the given date in Dynamics 365 Finance and Operations?
public static void main(Args _args)
{
Transdate dateToday;
int dayOfYear;
dateToday = today();
dayOfYear= dayOfyr(dateToday);
info(strfmt("Day of year - %1",dayOfYear));
}
Output :
Day of year - 203
9. How to get week of the year from the given date in Dynamics 365 Finance and Operations?
public static void main(Args _args)
{
Transdate dateToday;
int weekOfYear;
dateToday = today();
weekOfYear= wkofyr(dateToday);
info(strfmt("Week of the year - %1",weekOfYear));
}
Output :
Week of the year - 29
Wednesday, January 8, 2025
Create the LedgerDimension RecId from Mainaccount and the default dimension RecId using X++ in D365FO
LedgerDimensionFacade::serviceCreateLedgerDimension
(LedgerDefaultAccountHelper::getDefaultAccountFromMainAccountRecId
(MainAccount::findByMainAccountId(_mainAccountId).RecId),
defaultDimensionRecId);
How to get MainAccount using ledger dimension recId in ax 2012
Tuesday, December 17, 2024
Code to auto submit the workflow in D365f&o x++
WorkflowVersionTable workflowVersionTable = Workflow::findWorkflowConfigToActivateForType(workFlowTypeStr(ProjBudgetRevision),
projBudRevision.RecId,
projBudRevision.TableId);
//If workflow is active then submit the workflow.
if (projBudRevision.RecId && workflowVersionTable.RecId)
{
//submitting to workflow
Workflow::activateFromWorkflowType( workFlowTypeStr(ProjBudgetRevision),
projBudRevision.RecId,
"@AutomaticWorkflowSubmit",
false,
curUserid());
//Update revison workflow status to submit
ProjBudgetRevision::updateProjBudgetRevisionStatus(projBudRevision.RecId, ProjBudgetRevisionWFStatus::Submitted);
}
Wednesday, August 7, 2024
Monday, July 15, 2024
MultiSelect lookup in D365f&o
public void MultiSelectLookup(FormStringControl _control)
{
Query query = new query();
QueryBuildDataSource qbds;
Container cont;
qbds = query.addDataSource(tableNum(PRO_ZPayrollStaging));
qbds.addSelectionField(fieldNum(PRO_ZPayrollStaging, JournalBatchnumber));
qbds.orderMode(ordermode::GroupBy); //skip for duplicate values
qbds.addSortField(FieldNum(PRO_ZPayrollStaging,JournalBatchnumber));
SysLookupMultiSelectGrid::lookup(query, _control, _control, _control, cont);
}
/// <summary>
///
/// </summary>
public void lookup()
{
super();
this.MultiSelectLookup(this);
}
......................................
Output :
Tuesday, July 9, 2024
No report data table with name [Table Name] in report scheme for data provider [SSRS Report] in Dynamics 365 F&O - Error
Hey Dynamics 365 FinOps developer, If you are working on an SSRS data provider report, you may have experienced this error.
"(X) - No report data table with name [Table Name] in report scheme for data provider xxxxxxDP"
This error takes much of developers time to debug the root cause. So why and when this error actually raises. The answer is when your SSRS report table crosses the length of characters more than 40. So, if you are facing this error make sure your report temp/regular table length cannot be more than forty.
Other Way :
1.Rename the report dataset name.(error table name)
2.After renaming , select the dp class and table.
3.Deploy the report, restart sql services, clear the cache.
Monday, July 8, 2024
Send email with report attachment in D365 F&O
public static void sendEmail(System.IO.MemoryStream _mstream, Filename _fileName, str _requestID)
{
Map templateTokens;
str emailSubject,emailBody;
Filename fileName;
SysEmailTable SysEmailTable;
var messageBuilder = new SysMailerMessageBuilder();
templateTokens = new Map(Types::String, Types::String);
select SysEmailTable;
emailSubject = "Vendor Request Report";
templateTokens.insert("@SYS74341", emailSubject);
templateTokens.insert("@SYS4009003", _fileName);
emailBody = strFmt("A vendor request has been registed with the vendor request id %1 please find the attached document for more information.",_requestID);
emailBody = SysEmailMessage::stringExpand(emailBody, SysEmailTable::htmlEncodeParameters(templateTokens));
emailBody = strReplace(emailBody, '\n', '<br>');
emailBody +='<br><br>Thanks,<br>' +'Daxarch'; // for thanks
messageBuilder.addTo("lohith.m@daxarch.in")
.setSubject(emailSubject)
.setBody(emailBody)
.addCC("");
messageBuilder.setFrom("lohithmudigonda.m@gmail.com" , "Thiru") ; //sendor mail must be configured in front end.
messageBuilder.addAttachment(_mstream, _fileName);
SysMailerFactory::sendNonInteractive(messageBuilder.getMessage());
info(strFmt("Email sent successfully for vendor request %1",_requestID));
}
............................
Configure the sendor mail id :