AX Vigneshvaran
1 FOLLOWERS
x++
AX Vigneshvaran
4M ago
Alter database AxDB_Prod set single_user with rollback immediate;
alter database AxDB_Prod modify name = AxDB
alter database AxDB set multi_user ..read more
AX Vigneshvaran
5M ago
To remove the last 4 characters from the string,
substring(“26111993.txt”
, 0
, sub(Length(“26111993.txt”), 4))
Sample Input:
26111993.txt
Sample Output:
26111993 ..read more
AX Vigneshvaran
5M ago
Requirement: We need to call the print management configured report with some modifications,
by adding another checkbox control in SalesEditLines form.
Whenever they clicking the standard checkbox, standard print management report needs to open
and when clicking the custom check box, our custom report needs to open.
SalesInvoiceController
[ExtensionOf(classStr(SalesInvoiceController))]
final class SalesInvoiceController_Extension
{
public SRSCatalogItemName parmReportName(SRSCatalogItemName _reportNamee)
{
Args reportArgs = this.parmArgs();
SRSCatalogItemName reportName = next parmReportName ..read more
AX Vigneshvaran
5M ago
In this example, am taking to create the derived dimensions against worker through some integrations process using X++ code.
As per the requirement, we can modify this part whenever the scenario of creating Derived Dimensions.
public void createOrUpdDerivedDimension()
{
DimensionAttributeValueSetStorage attributeValueStorage;
DimensionAttributeValueSetStorage attrNewValueStorage;
DimensionAttribute dimensionAttribute;
DimensionAttributeValue value;
DimensionAttributeValueDerivedDimensions derivedDimensions;
DimensionHierarchy dimensionHierarchy;
Map dimensionMap;
MapIterator mapIterator;
RefRe ..read more
AX Vigneshvaran
5M ago
#Sample Code
using Renci.SshNet;
using Renci.SshNet.SftpClient;
using Renci.SshNet.Common;
using Renci.SshNet.Sftp;
using Renci.SshNet.Sftp.SftpFile;
using System.IO;
Public class IntMT940FileProcessor
{
VendParameters vendParameters;
SftpClient sftpClient;
public SftpClient connectSFTP()
{
Password sftpPassword;
boolean ret;
vendParameters = VendParameters::find(); //parameter you can change as per req.
sftpPassword = vendParameters.SFTPPasswordS;
sftpClient = new SftpClient(vendParameters.SFTPHostName
, vendParameter ..read more
AX Vigneshvaran
5M ago
memoryStream = new System.IO.MemoryStream(bytes);
str contentType = ‘text/plain’; //based on the requirement of file type you can set this.
FileUploadTemporaryStorageStrategy fileUploadStrategy = new FileUploadTemporaryStorageStrategy();
FileUploadTemporaryStorageResult fileUploadResult = fileUploadStrategy.uploadFile(memoryStream, fileName, contentType , “.txt”);
if (fileUploadResult == null || !fileUploadResult.getUploadStatus())
{
warning(“@ApplicationPlatform:FileUploadFailed”);
}
else
{
downloadUrl = fileUploadResult.getDownloadUrl();
if (downloadUrl == “”)
{
throw Exception::Error;
}
u ..read more
AX Vigneshvaran
5M ago
Query query = new Query();
QueryBuildDataSource qbdsItemLookup;
qbdsItemLookup = query.addDataSource(tableNum(PurchReqLookup));
str filterString = strFmt('((%1.%2 == "%4") || (%1.%3 == %5) || ((%1.%3 != %5) && (%1.%6 == %5)))'
, qbdsItemLookup.name()
, fieldStr(PurchReqLookup, userId)
, fieldStr(PurchReqLookup, GroupId)
, SysQueryRangeUtil::currentUserId()
, SysQueryRangeUtil::valueEmptyString()
, fieldStr(PurchReqL ..read more
AX Vigneshvaran
5M ago
As we all know we could not able to proceed more than 10 dimensions. So Microsoft providing the feature named Financial Tags.,
Whenever we met the scenarios like more than 10 financial dimensions, after 10 we can take it through Financial Tag.
So here we can see the code below like how we can merge the financial tag using code.
internal final class FinTagTesting
{
public static void main(Args _args)
{
LedgerJournalTrans ledgerJournalTrans;
FinTagConfiguration finTagConfiguration;
FinTagName tagName;
FinTag finTag;
container finTagNameCon = ["ServiceType", "TrainingCategory ..read more
AX Vigneshvaran
5M ago
We can use the list, adding all columns in the list and then using SyscomputedColumn::addList method we can achieve this.
public static str getTotalQty()
{
List additionList;
additionList = new List(Types::String);
additionList.addEnd(SysComputedColumn::returnField(viewstr(InventSumView), tableStr(InventSum), fieldStr(InventSum, PhysicalInvent)));
additionList.addEnd(SysComputedColumn::returnField(viewstr(InventSumView), tableStr(InventSum), fieldStr(InventSum, ReservPhysical)));
additionList.addEnd(SysComputedColumn::returnField(viewstr(InventSumView), tableStr(InventSum ..read more
AX Vigneshvaran
5M ago
We need to override the run method of the form.
public void run()
{
Query query;
QueryRun queryRun;
query = new Query();
query.addDataSource(tableNum(ItemMasterView));
query.dataSourceTable(tableNum(ItemMasterView)).addRange(fieldNum(ItemMasterView, ItemId));
query.dataSourceTable(tableNum(ItemMasterView)).addRange(fieldNum(ItemMasterView, itemBarCode));
query.dataSourceTable(tableNum(ItemMasterView)).addRange(fieldNum(ItemMasterView, InventLocationId));
queryRun = new QueryRun(query);
if (queryRun.prompt())
{
super();
ItemMasterView_ds ..read more