Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all 73760 articles
Browse latest View live

Batch Job is not added to batch

$
0
0

Hi Team,

     I have created batch job using sysoperation framework with following code

class CG_AGR_AdjustInvoiceTermsController extends SysOperationServiceController
{
}

public void new()
{
    super();

    this.parmClassName(classStr(CG_AGR_AdjustInvoiceTermsService));
    this.parmMethodName(methodStr(CG_AGR_AdjustInvoiceTermsService, upload));
}

public static void main(Args args)
{
    CG_AGR_AdjustInvoiceTermsController controller = new CG_AGR_AdjustInvoiceTermsController();

    controller.parmDialogCaption("Adjust Invoice Terms");
    controller.parmExecutionMode(SysOperationExecutionMode::ScheduledBatch);
    controller.startOperation();
}

class CG_AGR_AdjustInvoiceTermsService extends SysOperationServiceBase
{
    //To get the path from the dialog
    FilePath inputPath;
    FilePath failPath;
    FilePath processedPath;

    //
    FileName        importFile;
    FilePath        filePath;
    FileName        fileNameOnly;
    FileNameType    fileType;

    //For file access & creation
    ITP_AsciiIOPerm      fileIn;
    ITP_AsciiIOPerm      fileError;
    ITP_AsciiIOPerm      fileProcessed;

    //Holds the path of the newly created processed and error files
    FilePath             processedfilePath;
    FilePath             errorfilePath;

    //To hold the values from the input file
    IUS_AGR_AgreementId agreementId;

    container                  fileLine;
    int         failed, total;

    #File
}

[SysEntryPointAttribute]
public void upload(CG_AGR_AdjustInvoiceTermsDataContract _contract)
{
    container       listOfFiles;
    int             i;
    boolean         fileExist;

    inputPath = _contract.parmInputPath();
    failPath = _contract.parmFailPath();
    processedPath = _contract.parmProcessedPath();

    listOfFiles = this.createListOfFiles();
    fileExist = this.validateListOfFiles(listOfFiles);

    for (i = 1; i <= conlen(listOfFiles); i++)
    {
        importFile = conpeek(listOfFiles, i);
        [filePath, fileNameOnly, fileType] = fileNameSplit(importFile);

        if(!this.adjustInvoiceTerms())
            failed++;

        total++;
    }

    if (fileExist)
    {
        if(failed == 0)
        {
            info("@IUS37463");
            info(strFmt("@IUS4480", total));
        }
        else
        {
            warning("@IUS37464");
            info(strFmt("@IUS37465", total - failed, total));
            info(strFmt("@IUS37466", failed, total));
        }
    }
}

Requirement: It is always going to be added to the batch task and will run as batch.

Test Cases:

1. When I try to run the controller class from the AOT, it is added to the batch. (Success)

2. When I add it to the batch task and set the parameters, it is not added to the batch instead it starts running. (Failure)

Question: How can I avoid this failed scenario? I tried to clear both client and server cache, still the problem exist.

Note: Its just single AOS system (Development environment)

Thanks in advance


Sales pool in POS retail

$
0
0

i'm wondering is there sales pool in retail POS
because i want use that for restaurant to let them to take table
sales pool = table
but not for Booking a table in a restaurant

year end closing process Balance difference for vendor sub ledger accounts

$
0
0

Hi all, we are facing balance difference after running Year End Closing.

For e.g. We have an Account A with closing balance of $100 in 2018 period, now after we run the Year End Closing, the Opening Balance of this GL in 2019 is $70. The total balance is not transferred.

Like this some sub ledger accounts were not transferred correctly. Any one experienced this kind of issue? And can you please tell me the solution for this.

RunAsync functionality doesn't always gets called in D365FO

$
0
0

Hi Experts,

In our D365FO , we dealing with Integration between different application and D365. We have various incoming inbound that automates the processes in D365. But we have customization which does the process change , sends the outbound and later on completion of the process sends back the response of the call. We have made use of Global::RunAsync to do the process in parallel to avoid performance issue for inbound calls but we have observed that intermittently it doesn't call the classes and method defined in the RunAsync  function.The RunAsync process always work while debugging and most of the time without debugger in Tier 1 and Tier 2 Environment but intermittent issue of non working does happen.

My question is do we have any other functionality in D365 which can serve our purpose similar to RunAsync since it is becoming unreliable to us.

It will be of great help to us get inputs on this.

Thanks ,

Abhijeet

How to temporary turn off object compile in Dynamics AX?

$
0
0
Hi all.

How can I temporary turn off AOT compile dynamics AX in my dev environment?

I can add temporary code in order to jump the object compile.

I'm here to ask a trick like to jump Synch, dbSynchronize method, I want to jump the compile too.

Thanks

Query in AX Dynamics 2012 R3

$
0
0

Hi all. When form opens I get this error-Query does not contain 1 data source(s). I checked task no addition data source addings required. Mentioned one table. That's all.How to solve this.

Sincerely,

Zymantas

Add a computed field to entity

$
0
0

I have an entity with a field (LedgerDimension) that cannot be set to public, but need in my BYOD export. My idea is to clone it as a computed field.


According to the article below,


https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/data-entity-computed-columns-virtual-fields


"it's easier to come up with the SQL definition in Microsoft SQL Server Management Studio (SSMS) before using it in X++."

The example shows T-SQL code after X++ Code, is it supposed to be included there? Can't I just edit the view directly from SSMS and add the computed column there?

Multi-select multi-parameters SSRS Report in D365 Finance and Operations

$
0
0

Hi Everyone,

I am doing multiselect multiparameter SSRS Report in D365 Finance and Operation.
I have written my Logic with 4 classes which are Contract, Controller, UIBuilder and Data Provider.
Now one of my Parameter is Date Field.
And I have to display the Report Data Customer wise as shown in attached Screenshot.
To achieve this requirement, I have used below logic in "processReport" method of my Data Provider Class,

query = new Query(querystr(WSPLDailyReportQuery_14102019));
qbds = query.dataSourceTable(tableNum(WSPLInvTransTable_2307));
qbds.addRange(fieldNum(WSPLInvTransTable_2307, PhysicalDate)).value(queryRange(asOnDate, asOnDate));
qbds.addRange(fieldNum(WSPLInvTransTable_2307, SOBusinessChannelValue)).value(businessChannelStr);
qbds.addRange(fieldNum(WSPLInvTransTable_2307, SOCustomerAccount)).value(custAccountStr);
qbds.addRange(fieldNum(WSPLInvTransTable_2307, SiteId)).value(siteIdStr);
qbds.addRange(fieldNum(WSPLInvTransTable_2307, SOProductGroupValue)).value(productGroupStr);

queryRun = new QueryRun(query);
while (queryRun.next())
{
wsplInvTransTable = queryRun.get(tableNum(WSPLInvTransTable_2307));
this.insertDayData();
}

In above Logic businessChannelStr, custAccountStr, siteIdStr, productGroupStr are comma(,) separated strings.
As per the requirement the data has to be shown for a day, for a month and for a financial year.
Hence I want to change the date range of my query three times for each Customer selected in filter screen.
And also want to display the sum of those transactions in single row as shown in attached screenshot.
How can I achieve this with minimum execution time? Need help on this urgently.
Thank you in advance.


Amount in interim account is remains unmoved when making payment to vendor

$
0
0

An invoice received from a vendor for services obtained from the vendor. The amount of Tax was posted in an interim payable account. When the payment is done to vendor, the tax amount is still in interim account.

Facing build errors with disabling the proxy of FTP web request during SDP creation.

$
0
0

Hi every one,

I had a simple requirement to upload a csv file to the FTP server.

Below is my code,

void export()

{

ProjPlanVersion projPlanVersion;
ProjPlanVersionDetail projPlanVersionDetail;
CompanyInfo companyInfo = CompanyInfo::find();
String10 dataAreaId;

TextStreamIo commaIO = TextStreamIo::constructForWrite();
commaIO.outFieldDelimiter(#Semicolon);
System.Object webRequest,response,credential;
System.Net.FtpWebRequest ftpWebRequest;
System.Net.FtpWebResponse ftpWebResponse;
System.IO.Stream requestStream;
System.Byte[] bytes;
System.Text.Encoding getUTF8;
CLRObject sysException;

Hours hr;
Minutes minute;
str hrStr;
str minuteStr;
hr = DateTimeUtil::hour(DateTimeUtil::getSystemDateTime());
hrStr = hr > 9 ? any2str(hr) : ('0' + any2Str(hr));
minute = DateTimeUtil::minute(DateTimeUtil::getSystemDateTime());
minuteStr = minute > 9 ? any2str(minute) : ('0' + any2Str(minute));

//str ftpurl = "">ftp.current.no/testfile.csv";
str ftpurl = "">ftp.current.no/.../" + 'Project' + #Underscore + date2Str(DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone()), 321, DateDay::Digits2, DateSeparator::None, DateMonth::Digits2, DateSeparator::None,DateYear::Digits4) + #Underscore + hrStr + minuteStr + #csv;

new InteropPermission(InteropKind::ClrInterop).assert();

str ftpfullpath = ftpurl;

}

// wirite content to file

commaIO.writeExp([dataAreaId,companyInfo.Name,ProjTable::find(projPlanVersionDetail.ProjId).Name,projPlanVersionDetail.ProjId,ProjTable::find(projPlanVersionDetail.ProjId).Name,projPlanVersionDetail.ProjId,projPlanVersion.TaskCategory]);

try
{

// read csv file
System.IO.Stream stream = commaIO.getStream();
stream.Position = 0;
System.IO.StreamReader reader = new System.IO.StreamReader(stream);
getUTF8 = System.Text.Encoding::get_UTF8();
bytes = getUTF8.GetBytes(reader.ReadToEnd());
reader.Close();
// write file in FTP
webRequest = System.Net.WebRequest::Create(ftpfullpath);
ftpWebRequest = webRequest;
credential = new System.Net.NetworkCredential('bakke', #Ftppassword);
ftpWebRequest.set_Credentials(credential);
ftpWebRequest.set_ContentLength(bytes.get_Length());
ftpWebRequest.set_Method('STOR');
ftpWebRequest.set_Proxy(NULL); //SIYE, commented only because to avoid Build errors from Build Automation while SDP.

requestStream = ftpWebRequest.GetRequestStream();
requestStream.Write(bytes,0,bytes.get_Length());
requestStream.Close();
response = ftpWebRequest.GetResponse();
ftpWebResponse = response;
}
Catch(Exception::CLRError)
{
sysException = CLRInterop::getLastException();
info(sysException.get_Message());
}
}

}

from the above code I am getting build error CLR type System.Net.IwebProxy  is not found in any reference assembly.

but I included all the assemblies. Does any one know how to solve this.

Run report in batch to CSV file

$
0
0

Hi. I want to run a standard sales report to a CSV file by batch.  How do I find where D365 stores the exported CSV file? Cheers. James

facing build errors with disabling the proxy of FTP web request

$
0
0
Hi every one,
I had a simple requirement to upload a csv file to the FTP server.
Below is my code,
void export()
{
ProjPlanVersion projPlanVersion;
ProjPlanVersionDetail projPlanVersionDetail;
CompanyInfo companyInfo = CompanyInfo::find();
String10 dataAreaId;

TextStreamIo commaIO = TextStreamIo::constructForWrite();
commaIO.outFieldDelimiter(#Semicolon);
System.Object webRequest,response,credential;
System.Net.FtpWebRequest ftpWebRequest;
System.Net.FtpWebResponse ftpWebResponse;
System.IO.Stream requestStream;
System.Byte[] bytes;
System.Text.Encoding getUTF8;
CLRObject sysException;
Hours hr;
Minutes minute;
str hrStr;
str minuteStr;
hr = DateTimeUtil::hour(DateTimeUtil::getSystemDateTime());
hrStr = hr > 9 ? any2str(hr) : ('0' + any2Str(hr));
minute = DateTimeUtil::minute(DateTimeUtil::getSystemDateTime());
minuteStr = minute > 9 ? any2str(minute) : ('0' + any2Str(minute));
//str ftpurl = "">ftp.current.no/testfile.csv";
str ftpurl = "">ftp.current.no/.../" + 'Project' + #Underscore + date2Str(DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone()), 321, DateDay::Digits2, DateSeparator::None, DateMonth::Digits2, DateSeparator::None,DateYear::Digits4) + #Underscore + hrStr + minuteStr + #csv;
new InteropPermission(InteropKind::ClrInterop).assert();
str ftpfullpath = ftpurl;
}
// wirite content to file
commaIO.writeExp([dataAreaId,companyInfo.Name,ProjTable::find(projPlanVersionDetail.ProjId).Name,projPlanVersionDetail.ProjId,ProjTable::find(projPlanVersionDetail.ProjId).Name,projPlanVersionDetail.ProjId,projPlanVersion.TaskCategory]);
try
{
// read csv file
System.IO.Stream stream = commaIO.getStream();
stream.Position = 0;
System.IO.StreamReader reader = new System.IO.StreamReader(stream);
getUTF8 = System.Text.Encoding::get_UTF8();
bytes = getUTF8.GetBytes(reader.ReadToEnd());
reader.Close();
// write file in FTP
webRequest = System.Net.WebRequest::Create(ftpfullpath);
ftpWebRequest = webRequest;
credential = new System.Net.NetworkCredential('bakke', #Ftppassword);
ftpWebRequest.set_Credentials(credential);
ftpWebRequest.set_ContentLength(bytes.get_Length());
ftpWebRequest.set_Method('STOR');
ftpWebRequest.set_Proxy(NULL); //commented only because to avoid Build errors from Build Automation while SDP.
requestStream = ftpWebRequest.GetRequestStream();
requestStream.Write(bytes,0,bytes.get_Length());
requestStream.Close();
response = ftpWebRequest.GetResponse();
ftpWebResponse = response;
}
Catch(Exception::CLRError)
{
sysException = CLRInterop::getLastException();
info(sysException.get_Message());
}
}
from the above code I am getting build error CLR type System.Net.IwebProxy  is not found in any reference assembly.
but I included all the assemblies. Does any one know how to solve this.

WorkFlow Approval Report

$
0
0

Dear Experts

                 a report i need about the managers workflow approval in a day? means how many workflows approved by a person whether on 2nd level or 3rd level?

                Thanks in advance for your replies

Regards

 

x++ settle open transaction from 1-7-2019 till Auto settlement activated

$
0
0

Hello..

I activated the auto settlement option in 1-10-2019 but I have open transaction since July till the option is activated

How can I settle this transaction  automatically , the new transaction now is settled the old transaction 

Thanks 

Credit Limit Approval Workflow

$
0
0

Hi All,

I am implementing Dynamics 365 Finance & Operations and have requirement from client regarding Credit limit approval.

The scenario is as follows:-

Suppose the Customer is "ABC LLC" and we set as credit limit = $100 over the period the credit limit is exhausted and when creating the new transaction system prompt a message that credit limit is exceed. 

SO the requirement is when we get the error message of credit limit exceed then the workflow has to be trigger and then it has to be approve by the proper authority. But they are not going to change the credit limit immediately only they want workflow approval so that it can be tracked.

Is this requirement is possible without any customization or can be configurable?

Thankig you in anticipation

rgds

dhananjay


Terms of Payment

$
0
0

Hi All,

While implementing D365 F & O have one requirement to set up payment terms as  50 % at the time of delivery and remaining 50% will be after 20 days.

How this can be configure or any other way around for this method?

Thanking you in anticipation.

rgds

dhananjay

Help regarding Workflow in AX 2012

$
0
0

HI All,

Greetings

I have AX 2012 version. We have appraisal system developed. The workflow defined is 

Start->First Appraiser-->2nd Appraiser-->1st reviewer-->2nd reviewer(Hr setup-Hr workflows-The workflow is defined here)

The 1st, 2nd appraiser and reviewer are defined in workers form

The 2nd reviewer is HR in most of the cases-

the new requirement is that for 2nd reviewer(approve, reject, change request, delegate-options enabled in portal) want to push back to 2nd reviewer.

After pushing it to 2nd Reviewer it should come back the HR for final completion

Can anyone guide me how can I achieve this

Kindly help

AX client configuration utility

$
0
0

Hi Friends,

We have a terminal server for all users to remote in and run AX, how to setup default client configuration for all users?

I setup one, but that apparently only works for myself.

Many thanks.

How to attach a new file into resource node through x++ in D365

$
0
0

I have customization to load a audio file into resource node.

I was using the method 'SysResource::saveResource()' method in Ax 2012 which is not working D365 and its throwing a error "Save is not allowed from inside the client" from the method 'resourceNode::createResourceAndSaveContent()'
I have noticed, in AX 2012 the framework is using these methods(ResourceNode.AOTSetData() and ResourceNode.AOTSave()) which are deprecated in D365.
FYI, I am working in D365 FO version : 10.0.4 with update 28.
It would be great if anybody is having a idea about this. Thanks in advance!.

Reseting status of assembly production order de-link marking with sub assemblies?

$
0
0

D365 team,

When i Firm production orders from MRP i use Standard marking so sub assemblies production orders are marked to its upper level.

but because of BOM changes sometime i have to bring top assembly production order to created status(Copy BOM feature is only available on Created status.), when i do that all sub assembly production orders linked to this production order get unmarked .

i want marking to stay regardless the status change on production order, can someone suggest on this issue

Viewing all 73760 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>