Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2022 Release Wave 1 PlanDynamics 365 release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.
2022 release wave 1 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
I want to improt excel So I created a class that extends runbasebatch, but I use the background batch to execute batch that fileUrl is null, how should I get the excel that uploaded in Temporary place at batch job,
please all help me.
fileUrl = result.getDownloadUrl();
fileUrl is null
I'm assuming that you're taliking about D365FO, although you're asking in the AX forum.
First of all, consider if you can't simply use data management, rather then developing your own solution for data import.
If you can't, please tell us how you're working with fileUrl. It's difficult to find the bug in your code if you don't give us almost any information about the code.
By the way, do you have any particular reason for using RunBaseBatch framework instead of the newer SysOperation framework? Note that many developers failed to implement serialization correctly when using RunBaseBatch framework, or even didn't realize that it's necessary. Maybe you've made the same mistake.
I know you. You are very famous. I am not an English speaking country, so please forgive my English.
First of all, I think D365FO or AX are developed in X++ language, so I think there is nothing wrong with it.
Second, I want to express my opinion. Is there a problem with the code, but when I execute batch processing in the background, the file address is not found.
Third, I really don’t know the existence of the SysOperation framework. Since AX2012, I have been using runbasebatch because it can provide dialog related information. Method, so please tell me how to get the temporary excel file that has been uploaded to the batch job thanks.
I'm not saying that there is anything wrong with writing X++ code. But the best code is the one that you don't have to design, write, test and keep maintaining at all. Therefore if the product already can do what you need, using the existing functionality is much more efficient than building something similar by yourself.
Can you show us your code, please? I'm particularly interested in how you construct the result object when running on batch server.
Regarding SysOperation framework, it was introduced in AX 2012 and even if you refuse to use it by yourself, you need to get familiar with it, because it's used by Microsoft. For example, reports in AX 2012 and D365FO uses SysOperation framework. Here are a few links with more information about this framework:
class ExcelBGUploadTest extends RunBaseBatch
public static void main(Args _args)
obj = new ExcelBGUploadTest();
server client static public ClassDescription description()
return "My batch job";
public boolean canRunInNewSession()
Dialog dialog = super();
dlgGroup = dialog.addGroup('');
buttonGroup = dialog.formBuildDesign().control(dlgGroup.formBuildGroup().id());
buttonControl = buttonGroup.addControl(FormControlType::Button, 'Upload');
private void uploadClickedEvent(FormButtonControl _formButtonControl)
FileUploadTemporaryStorageResult result = File::GetFileFromUser() as FileUploadTemporaryStorageResult;
if (result && result.getUploadStatus())
fileUrl = result.getDownloadUrl();
Public void run()
stream = File::UseFileFromURL(fileUrl);
public container readExcelData(System.IO.Stream _stream)
OfficeOpenXml.ExcelPackage package = new OfficeOpenXml.ExcelPackage(_stream);
_worksheet = package.get_Workbook().get_Worksheets().Copy("Sheet1","Journal");
var cells = _worksheet.get_Cells();
//iRowCount = _worksheet.get_Dimension().get_End().get_Row();
//iCellCount = _worksheet.get_Dimension().get_End().get_Column();
date nextDay = str2Date(cells.get_Item(1, 1).get_Value(),321);
select forupdate firstonly TransDate
where purchreqtable.PurchReqId == '002531';
purchreqtable.TransDate = nextDay;
I guessed it right - you forgot to implement pack() and unpack().
They're necessary for being able to save the object state to database and re-create it again when the batch server picks the data from database and wants to execute the task.
You said you're familiar with the RunBase framework, therefore I'm assuming that you know how to implement pack() and unpack(). If not, feel free to ask.
By the way, one of the benefits of the SysOperaration framework is that it handles these things for you.
Thank you so much. I think I know what to do and I will try to understand the sys operation framework. Thanks again
Business Applications communities