These are new two operators added to X++ libraries.
*=
/=
Example:
X *= 2
X /= 2
These are short for X = X * 2 and X = X / 2.
These are new two operators added to X++ libraries.
*=
/=
Example:
X *= 2
X /= 2
These are short for X = X * 2 and X = X / 2.
Login to D365FO URL,
Navigate to Sales order (Sample)
Create new order
Converting to view computed column method.
T-SQL statment like this way.
return strFmt(@'select top 1 WHT.ACCOUNTNUM from WHSSHIPMENTTABLE as WHT
where WHT.WaveId = %1 order by WHT.RECID asc',waveId);
using AK = Microsoft.Dynamics365.LocalizationFramework.MicrosoftInternalUseOnly.ApiKeys;
using GR = Microsoft.Dynamics365.LocalizationFramework.Repositories.GlobalRepository;
using Microsoft.Dynamics365.LocalizationFramework;
using TL = Microsoft.Dynamics365.LocalizationFramework.Telemetry;
using BCS = Microsoft.Dynamics365.LocalizationFramework.ExternalApi.BCS;
using EA = Microsoft.Dynamics365.LocalizationFramework.ExternalApi;
using Microsoft.Dynamics.ApplicationPlatform.Environment;
using Microsoft.Dynamics.ApplicationPlatform.Environment.Settings;
using Microsoft.Dynamics.AX.Security.AuthenticationCommon;
using Microsoft.Dynamics.AX.Security.ADALClientAuthentication;
using Microsoft.Dynamics.AX.Framework.FileManagement;
class WordToPDFConverter
{
/// <summary>
/// Runs the class with the specified arguments.
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
System.IO.Stream inputStream; //word stream
str fileExtension = '.docx';
System.IO.Stream outputPDFStream; //Pdf stream
System.IO.Stream fileStream;
try
{
fileStream = File::UseFileFromURL('C:\\wordfile\\word1.docx');
}
catch
{
warning("File not found");
}
inputStream = fileStream;
BCS.ConvertToPdfRequest request = new BCS.ConvertToPdfRequest();
BCS.ConvertToPdfResponse response;
request.FileStream = inputStream;
request.ClientCorrelationId = newGuid();
request.ClientName = identifierStr(DynamicsAxElectronicReporting);
request.FileExtension = fileExtension;
var ret = new BCS.PdfConversionPageOptions();
ret.Orientation = BCS.PdfConversionPageOrientation::Portrait;
request.PageOptions = ret;
request.LocaleIdentifier = 0;
AK.IApiKeysProviderService apiKeysProvider = null;
Microsoft.Dynamics.Client.ServerForm.Contexts.SessionContext sessionContext;
System.Uri currentUrl = null;
sessionContext = Microsoft.Dynamics.Client.ServerForm.Contexts.SessionContext::get_Current();
if (sessionContext)
{
currentUrl = sessionContext.get_RequestUrl();
}
str ProdUrl = 'https://apikeys.configure.global.dynamics.com';
System.String configValue = System.Configuration.ConfigurationManager::AppSettings.Get('RCS.GlobalRepoKeysAPIUrl');
var configProvider = System.String::IsNullOrEmpty(configValue) ? ProdUrl : configValue;
str authProvd = ERParameterTable::find().RCSApplicationAADUrl;
if (!authProvd)
{
authProvd = (ERParameterTable::isMooncake() ? 'https://configure.global.dynamics.cn' : 'http://configure.global.dynamics.com');
}
var s2SAuthProvider = new GR.S2SAuthenticationProvider(authProvd);
apiKeysProvider = new GR.MicrosoftInternalUseOnly.GlobalRepositoryApiKeysClient(s2SAuthProvider, configProvider);
var provider = apiKeysProvider;
var conversionClient = EA.BCS.BcsApiClient::Instance;
response = conversionClient.ConvertToPdf(request, provider, TL.ElectronicReportingMappingTelemetryLogger::Log);
if (response.IsValidResponse)
{
outputPDFStream = response.ResultStream;
File::SendFileToUser(outputPDFStream,'word1.pdf');
}
}
}
Error:
SSRS file error message: The number of defined parameters is not equal to the number of cell definitions in the parameter panel
In D365FO - SSRS report
Workaround solution:
1. Create new design (Shouldn't duplicate it from existing design)
2. Copy all objects from Old design and paste it in new design
3. Save report
4. Rebuild and deploy reports
The data source is not embedded within a (parent) data source.
Write COC for FORM DS extension method
(In my case, SalesTable (Form) & SalesLine_IN (DS)). Even IN region localization not enabled.
Note: This has been fixed by MS as part of PU43 (10.0.19) + QU
1. Code fix solution (Temporary)
// Temporary fix for "The data source is not embedded within a (parent) data source." Error while opening All Sales order form after upgrade PU43 (10.0.19)
void init()
{
next init();
this.insertIfEmpty(false);
this.allowCreate(false);
}
2. Workaround solution (Temporary)
//Changed personalize view to Standard view
class GetCategoryLevels
{
public static void main(Args _args)
{
// TOP to BOTTOM hierarchy level data
void loopchild(RefRecId _recId)
{
EcoResCategory ecoResCategoryChk, ecoResCategoryChild;
while select ecoResCategoryChk
where ecoResCategoryChk.ParentCategory == _recId
{
//Child query insert to table Write ur logic
Info(ecoResCategoryChk.Name);
ecoResCategoryChild.clear();
select firstonly ecoResCategoryChild
where ecoResCategoryChild.ParentCategory == ecoResCategoryChk.RecId;
if(ecoResCategoryChild)
{
loopchild(ecoResCategoryChild.ParentCategory);
}
}
}
EcoResCategory ecoResCategory;
EcoResProductCategory ecoResProductCategory, ecoResProductCategoryCHk;
RefRecId parentCategory;
select firstonly ecoResCategory
where ecoResCategory.Name == "Refrigeration";
parentCategory = EcoResCategory.RecId;
if(parentCategory)
{
//Parent query insert - Write ur logic
Info(ecoResCategory.Name);
loopchild(parentCategory);
}
}
}
Map queryContracts = reportController.parmReportContract().parmQueryContracts();
MapEnumerator mapEnumerator = queryContracts.getEnumerator();
while(mapEnumerator.moveNext())
{
Query query = mapEnumerator.currentValue();
if(query)
{
QueryBuildDataSource qbds = query.dataSourceTable(tableNum(WHSWorkLine));
if(qbds)
{
qbds.addRange(fieldNum(WHSWorkLine, ShipmentId)).value(queryValue(_shipmentTable.ShipmentId));
}
}
}
QueryBuildDataSource
findFirstDsForTable(Query _q, TableId _tableId)
{
QueryBuildDataSource ds;
int i;
for (i = 1; i <= _q.dataSourceCount(); i++)
{
ds = _q.dataSourceNo(i);
if (ds.table() == _tableId)
{
return ds;
}
}
return null;
}
Decorate contract class with this attribute.
[Newtonsoft.Json.JsonObjectAttribute(IsReference = false)]
[ExtensionOf(classStr(InventUpd_Reservation))] final class InventUpd_ReservationCls_SAN_Extension { void updateNow() { if(mo...