Types of Databases in AX 2012
Package deployment on Build and Test environment
Hello everyone,
I am trying to install deployable package on Build and Test environment on cloud. I read on the Microsoft website that I can only install the deployable package using command line. Also, there is no admin account in Microsoft subscription.
I have already unblocked the file.
But when I follow the steps, I get the error "Access is denied".
Reading table BatchJob.recurrenceData EDT SysRecurrenceData
Below find to X++ objects:
(1) Class_OSISysRecurrenceReader.xpo
(2) Job_OSISysRecurrenceReaderJob
The job is used to demonstrate how to use the class.
---- Class follows ----
Exportfile for AOT version 1.0 or later
Formatversion: 1
***Element: CLS
; Microsoft Dynamics AX Class: OSISysRecurrenceReader unloaded
; --------------------------------------------------------------------------------
CLSVERSION 1
CLASS #OSISysRecurrenceReader
PROPERTIES
Name #OSISysRecurrenceReader
Origin #{541DBFDD-8D6E-4430-90DA-F1F38B693EAF}
ENDPROPERTIES
METHODS
SOURCE #classDeclaration
#/// <summary>
#/// OSISysRecurrenceReader class is used to read batch job recurrence info.
#/// </summary>
#/// <remarks>
#/// Created by Kwarner
#/// </remarks>
#
#class OSISysRecurrenceReader
#{
#}
ENDSOURCE
SOURCE #getBatchInfo_Caption
#public static str getBatchInfo_Caption(container c)
#{
# return conPeek(c,2);
#}
ENDSOURCE
SOURCE #getBatchInfo_GetStatus
#public static str getBatchInfo_GetStatus(container c)
#{
# return conPeek(c,1);
#}
ENDSOURCE
SOURCE #getBatchInfo_LogLevel
#public static str getBatchInfo_LogLevel(container c)
#{
# return conPeek(c,3);
#}
ENDSOURCE
SOURCE #getBatchInfo_NextStartDate
#public static str getBatchInfo_NextStartDate(container c)
#{
# return conPeek(c,9);
#}
ENDSOURCE
SOURCE #getBatchInfo_NextStartDateTime
#public static str getBatchInfo_NextStartDateTime(container c)
#{
# return conPeek(c,8);
#}
ENDSOURCE
SOURCE #getBatchInfo_NextStartTime
#public static str getBatchInfo_NextStartTime(container c)
#{
# return conPeek(c,10);
#}
ENDSOURCE
SOURCE #getBatchInfo_OrigStartDate
#public static str getBatchInfo_OrigStartDate(container c)
#{
# return conPeek(c,6);
#}
ENDSOURCE
SOURCE #getBatchInfo_OrigStartDateTime
#public static str getBatchInfo_OrigStartDateTime(container c)
#{
# return conPeek(c,5);
#}
ENDSOURCE
SOURCE #getBatchInfo_OrigStartTime
#public static str getBatchInfo_OrigStartTime(container c)
#{
# return conPeek(c,7);
#}
ENDSOURCE
SOURCE #getBatchInfo_Recurrence
#public static str getBatchInfo_Recurrence(container c)
#{
# return conPeek(c,13);
#}
ENDSOURCE
SOURCE #getBatchInfo_RecurrenceEnd
#public static str getBatchInfo_RecurrenceEnd(container c)
#{
# return conPeek(c,12);
#}
ENDSOURCE
SOURCE #getBatchInfo_RuntimeJob
#public static str getBatchInfo_RuntimeJob(container c)
#{
# return conPeek(c,4);
#}
ENDSOURCE
SOURCE #getBatchInfo_TimeZone
#public static str getBatchInfo_TimeZone(container c)
#{
# return conPeek(c,11);
#}
ENDSOURCE
SOURCE #getBatchInfoByCaption
#public static container getBatchInfoByCaption(BatchCaption batchCaption)
#{
# BatchJob batchJob;
#
# select RecId from batchJob where batchJob.Caption == batchCaption;
# return OSIBase::getBatchInfoByRecId(batchJob.RecId);
#}
ENDSOURCE
SOURCE #getBatchInfoByRecId
#public static container getBatchInfoByRecId(RecId batchJobRecId)
#{
# SysRecurrenceData recurrenceData;
# utcdatetime recurrenceDataStartDateTime;
# date recurrenceDataStartDate;
# TimeOfDay recurrenceDataStartTime;
# int recurrenceType;
# str recurrenceTypeStr;
# str recurrenceRepeatStr;
# str recurrenceRepeatCnt;
# int recurrenceRepeatCntInt;
# str recurrenceRepeatDay;
# Timezone recurrenceTZ;
# utcdatetime startDateTime;
# date startDate;
# TimeOfDay startTime;
# recId batchHeaderId;
# BatchCaption caption;
# BatchLogLevel logLevel;
# boolean runtimeJob;
# container results;
# container conTmp;
# container ConWeekDay;
# int i, dayOfWeekInt, weekOfMonthInt, monthInt;
# str monthInterval, weekOfMonth, dayOfWeek, month;
# str dayOfWeekStr, weekOfMonthStr, monthStr;
# BatchJob batchJob;
#
# select batchJob where batchJob.RecId == batchJobRecId;
# if(batchJob)
# {
# batchHeaderId = batchJob.RecId;
# startDateTime = batchJob.OrigStartDateTime;
# startDate = batchJob.StartDate;
# startTime = batchJob.StartTime;
# recurrenceData = batchJob.RecurrenceData;
# caption = batchJob.Caption;
# logLevel = batchJob.LogLevel;
# runtimeJob = batchJob.RuntimeJob;
#
# recurrenceDataStartDateTime = SysRecurrence::getRecurrenceStartDateTime(recurrenceData);
# recurrenceDataStartDate = SysRecurrence::getRecurrenceStartDate(recurrenceData);
# recurrenceDataStartTime = SysRecurrence::getRecurrenceTime(recurrenceData);
# recurrenceTZ = SysRecurrence::getRecurrenceTimezone(recurrenceData);
# recurrenceType = conpeek(recurrenceData, 4);
# recurrenceTypeStr = '';
# switch (recurrenceType)
# {
# case 1:
# recurrenceTypeStr = 'No end';
# break;
# case 2:
# recurrenceTypeStr = strFmt('End after %1 iterations', conpeek(recurrenceData, 5));
# break;
# case 3:
# recurrenceTypeStr = strFmt('End after %1 date', conpeek(recurrenceData, 6));
# break;
# }
# recurrenceRepeatStr = conpeek(recurrenceData, 7);
# //0 = Minutes
# //1 = Hours
# //2 = Days
# //3 = Weeks
# //4 = Months
# //5 = Years
#
# if (recurrenceRepeatStr == '0')
# {
# recurrenceRepeatCnt = conpeek(recurrenceData, 8);
# recurrenceRepeatStr = strFmt('Repeat every %1 minutes', recurrenceRepeatCnt);
# }
# if (recurrenceRepeatStr == '1')
# {
# recurrenceRepeatCnt = conpeek(recurrenceData, 8);
# recurrenceRepeatStr = strFmt('Repeat every %1 hours', recurrenceRepeatCnt);
# }
# if (recurrenceRepeatStr == '2')
# {
# conTmp = conpeek(recurrenceData, 8);
# if (conpeek(conTmp, 1) == 1)
# {
# recurrenceRepeatCnt = conpeek(conTmp, 2);
# recurrenceRepeatStr = strFmt('Repeat every %1 days', recurrenceRepeatCnt);
# }
# else
# {
# recurrenceRepeatStr = 'Repeat every day';
# }
# }
# if (recurrenceRepeatStr == '3')
# {
# conTmp = conpeek(recurrenceData, 8);
# recurrenceRepeatCnt = conpeek(conTmp, 1);
# recurrenceRepeatStr = strFmt('Repeat every %1 weeks', recurrenceRepeatCnt);
# recurrenceRepeatCnt = conpeek(conTmp, 2);
# recurrenceRepeatCntInt = str2int(recurrenceRepeatCnt);
# i = 0;
# if (recurrenceRepeatCntInt - 64 >= 0)
# {
# i = i + 1;
# ConWeekDay = conIns(ConWeekDay, i, 'Sunday');
# recurrenceRepeatCntInt = recurrenceRepeatCntInt - 64;
# }
# if (recurrenceRepeatCntInt - 32 >= 0)
# {
# i = i + 1;
# ConWeekDay = conIns(ConWeekDay, i, 'Saturday');
# recurrenceRepeatCntInt = recurrenceRepeatCntInt - 32;
# }
# if (recurrenceRepeatCntInt - 16 >= 0)
# {
# i = i + 1;
# ConWeekDay = conIns(ConWeekDay, i, 'Friday');
# recurrenceRepeatCntInt = recurrenceRepeatCntInt - 16;
# }
# if (recurrenceRepeatCntInt - 8 >= 0)
# {
# i = i + 1;
# ConWeekDay = conIns(ConWeekDay, i, 'Thursday');
# recurrenceRepeatCntInt = recurrenceRepeatCntInt - 8;
# }
# if (recurrenceRepeatCntInt - 4 >= 0)
# {
# i = i + 1;
# ConWeekDay = conIns(ConWeekDay, i, 'Wednesday');
# recurrenceRepeatCntInt = recurrenceRepeatCntInt - 4;
# }
# if (recurrenceRepeatCntInt - 2 >= 0)
# {
# i = i + 1;
# ConWeekDay = conIns(ConWeekDay, i, 'Tuesday');
# recurrenceRepeatCntInt = recurrenceRepeatCntInt - 2;
# }
# if (recurrenceRepeatCntInt - 1 >= 0)
# {
# i = i + 1;
# ConWeekDay = conIns(ConWeekDay, i, 'Monday');
# recurrenceRepeatCntInt = recurrenceRepeatCntInt - 1;
# }
#
# if (conFind(ConWeekDay, 'Monday') > 0)
# recurrenceRepeatStr = recurrenceRepeatStr + ' Monday';
# if (conFind(ConWeekDay, 'Tuesday') > 0)
# recurrenceRepeatStr = recurrenceRepeatStr + ' Tuesday';
# if (conFind(ConWeekDay, 'Wednesday') > 0)
# recurrenceRepeatStr = recurrenceRepeatStr + ' Wednesday';
# if (conFind(ConWeekDay, 'Thursday') > 0)
# recurrenceRepeatStr = recurrenceRepeatStr + ' Thursday';
# if (conFind(ConWeekDay, 'Friday') > 0)
# recurrenceRepeatStr = recurrenceRepeatStr + ' Friday';
# if (conFind(ConWeekDay, 'Saturday') > 0)
# recurrenceRepeatStr = recurrenceRepeatStr + ' Saturday';
# if (conFind(ConWeekDay, 'Sunday') > 0)
# recurrenceRepeatStr = recurrenceRepeatStr + ' Sunday';
# }
#
# if (recurrenceRepeatStr == '4')
# {
# conTmp = conpeek(recurrenceData, 8);
# if (conpeek(conTmp, 1) == 1)
# {
# recurrenceRepeatCnt = conpeek(conTmp, 3);
# recurrenceRepeatDay = conpeek(conTmp, 2);
# recurrenceRepeatStr = strFmt('Repeat every %1 Months on %2 day', recurrenceRepeatCnt, recurrenceRepeatDay);
# }
# else
# {
# dayOfWeek = conpeek(conTmp, 5);
# monthInterval = conpeek(conTmp, 6);
# weekOfMonth = conpeek(conTmp, 4);
#
# dayOfWeekInt = str2int(dayOfWeek);
# if (dayOfWeekInt == 1)
# dayOfWeekStr = 'Monday';
# if (dayOfWeekInt == 2)
# dayOfWeekStr = 'Tuesday';
# if (dayOfWeekInt == 3)
# dayOfWeekStr = 'Wednesday';
# if (dayOfWeekInt == 4)
# dayOfWeekStr = 'Thursday';
# if (dayOfWeekInt == 5)
# dayOfWeekStr = 'Friday';
# if (dayOfWeekInt == 6)
# dayOfWeekStr = 'Saturday';
# if (dayOfWeekInt == 7)
# dayOfWeekStr = 'Sunday';
#
# weekOfMonthInt = str2int(weekOfMonth);
# if (weekOfMonthInt == 0)
# weekOfMonthStr = '1st';
# if (weekOfMonthInt == 1)
# weekOfMonthStr = '2nd';
# if (weekOfMonthInt == 2)
# weekOfMonthStr = '3rd';
# if (weekOfMonthInt == 3)
# weekOfMonthStr = '4th';
# if (weekOfMonthInt == 4)
# weekOfMonthStr = 'last';
#
# recurrenceRepeatStr = strFmt('Repeat every %1 months %2 week on %3', monthInterval, weekOfMonthStr, dayOfWeekStr);
# }
# }
# if (recurrenceRepeatStr == '5')
# {
# conTmp = conpeek(recurrenceData, 8);
# if (conpeek(conTmp, 1) == 1)
# {
# recurrenceRepeatStr = strFmt('Repeat once per year', recurrenceRepeatCnt, recurrenceRepeatDay);
# }
# else
# {
# dayOfWeek = conpeek(conTmp, 3);
# weekOfMonth = conpeek(conTmp, 2);
# month = conpeek(conTmp, 4);
#
# dayOfWeekInt = str2int(dayOfWeek);
# if (dayOfWeekInt == 1)
# dayOfWeekStr = 'Monday';
# if (dayOfWeekInt == 2)
# dayOfWeekStr = 'Tuesday';
# if (dayOfWeekInt == 3)
# dayOfWeekStr = 'Wednesday';
# if (dayOfWeekInt == 4)
# dayOfWeekStr = 'Thursday';
# if (dayOfWeekInt == 5)
# dayOfWeekStr = 'Friday';
# if (dayOfWeekInt == 6)
# dayOfWeekStr = 'Saturday';
# if (dayOfWeekInt == 7)
# dayOfWeekStr = 'Sunday';
#
# weekOfMonthInt = str2int(weekOfMonth);
# if (weekOfMonthInt == 0)
# weekOfMonthStr = '1st';
# if (weekOfMonthInt == 1)
# weekOfMonthStr = '2nd';
# if (weekOfMonthInt == 2)
# weekOfMonthStr = '3rd';
# if (weekOfMonthInt == 3)
# weekOfMonthStr = '4th';
# if (weekOfMonthInt == 4)
# weekOfMonthStr = 'last';
#
# monthInt = str2int(month);
# if (monthInt == 1)
# monthStr = 'January';
# if (monthInt == 2)
# monthStr = 'Feburary';
# if (monthInt == 3)
# monthStr = 'March';
# if (monthInt == 4)
# monthStr = 'April';
# if (monthInt == 5)
# monthStr = 'May';
# if (monthInt == 6)
# monthStr = 'June';
# if (monthInt == 7)
# monthStr = 'July';
# if (monthInt == 8)
# monthStr = 'August';
# if (monthInt == 9)
# monthStr = 'September';
# if (monthInt == 10)
# monthStr = 'October';
# if (monthInt == 11)
# monthStr = 'November';
# if (monthInt == 12)
# monthStr = 'December';
#
# recurrenceRepeatStr = strFmt('Repeat every year on %1 week of %2 on %3', weekOfMonthStr, monthStr, dayOfWeekStr);
# }
# }
#
# results = ['Batch Job Found', caption, strFmt('%1', logLevel), strFmt('%1', runtimeJob), strFmt('%1', recurrenceDataStartDateTime), strFmt('%1', recurrenceDataStartDate), strFmt('%1', recurrenceDataStartTime), strFmt('%1', startDateTime), strFmt('%1', startDate), strFmt('%1', startTime), strFmt('%1', recurrenceTZ), strFmt('%1', recurrenceTypeStr), strFmt('%1', recurrenceRepeatStr)];
# }
# else
# {
# results = ['Batch Job Not Found', '', '', '', '', '', '', '', '', '', '', '', ''];
# }
#
# return results;
#}
ENDSOURCE
ENDMETHODS
ENDCLASS
***Element: END
---- Job follows ----
Exportfile for AOT version 1.0 or later
Formatversion: 1
***Element: JOB
; Microsoft Dynamics AX Job: OSISysRecurrenceReaderJob unloaded
; --------------------------------------------------------------------------------
JOBVERSION 1
SOURCE #OSISysRecurrenceReaderJob
#static void OSISysRecurrenceReaderJob(Args _args)
#{
# container result;
#
# info('Calling OSIBase with batch job RecId:');
# result = OSISysRecurrenceReader::getBatchInfoByRecId(5637218082);
# if (OSISysRecurrenceReader::getBatchInfo_GetStatus(result) == 'Batch Job Found')
# {
# info(strFmt(' Log level : %1', OSISysRecurrenceReader::getBatchInfo_LogLevel(result)));
# info(strFmt(' Caption : %1', OSISysRecurrenceReader::getBatchInfo_Caption(result)));
# info(strFmt(' Runtime job : %1', OSISysRecurrenceReader::getBatchInfo_RuntimeJob(result)));
# info(strFmt(' Original start date time : %1', OSISysRecurrenceReader::getBatchInfo_OrigStartDateTime(result)));
# info(strFmt(' Original start date : %1', OSISysRecurrenceReader::getBatchInfo_OrigStartDate(result)));
# info(strFmt(' Original start time : %1', OSISysRecurrenceReader::getBatchInfo_OrigStartTime(result)));
# info(strFmt(' Next start date time : %1', OSISysRecurrenceReader::getBatchInfo_NextStartDateTime(result)));
# info(strFmt(' Next start date : %1', OSISysRecurrenceReader::getBatchInfo_NextStartDate(result)));
# info(strFmt(' Next start time : %1', OSISysRecurrenceReader::getBatchInfo_NextStartTime(result)));
# info(strFmt(' Time zone : %1', OSISysRecurrenceReader::getBatchInfo_TimeZone(result)));
# info(strFmt(' Recurrence type : %1', OSISysRecurrenceReader::getBatchInfo_RecurrenceEnd(result)));
# info(strFmt(' Recurrence : %1', OSISysRecurrenceReader::getBatchInfo_Recurrence(result)));
# }
# else
# {
# info(OSISysRecurrenceReader::getBatchInfo_GetStatus(result));
# }
#
# info('');
# info('Calling OSIBase with batch job Caption:');
# result = OSISysRecurrenceReader::getBatchInfoByCaption('KW Test');
# if (OSISysRecurrenceReader::getBatchInfo_GetStatus(result) == 'Batch Job Found')
# {
# info(strFmt(' Log level : %1', OSISysRecurrenceReader::getBatchInfo_LogLevel(result)));
# info(strFmt(' Caption : %1', OSISysRecurrenceReader::getBatchInfo_Caption(result)));
# info(strFmt(' Runtime job : %1', OSISysRecurrenceReader::getBatchInfo_RuntimeJob(result)));
# info(strFmt(' Original start date time : %1', OSISysRecurrenceReader::getBatchInfo_OrigStartDateTime(result)));
# info(strFmt(' Original start date : %1', OSISysRecurrenceReader::getBatchInfo_OrigStartDate(result)));
# info(strFmt(' Original start time : %1', OSISysRecurrenceReader::getBatchInfo_OrigStartTime(result)));
# info(strFmt(' Next start date time : %1', OSISysRecurrenceReader::getBatchInfo_NextStartDateTime(result)));
# info(strFmt(' Next start date : %1', OSISysRecurrenceReader::getBatchInfo_NextStartDate(result)));
# info(strFmt(' Next start time : %1', OSISysRecurrenceReader::getBatchInfo_NextStartTime(result)));
# info(strFmt(' Time zone : %1', OSISysRecurrenceReader::getBatchInfo_TimeZone(result)));
# info(strFmt(' Recurrence type : %1', OSISysRecurrenceReader::getBatchInfo_RecurrenceEnd(result)));
# info(strFmt(' Recurrence : %1', OSISysRecurrenceReader::getBatchInfo_Recurrence(result)));
# }
# else
# {
# info(OSISysRecurrenceReader::getBatchInfo_GetStatus(result));
# }
#
#}
ENDSOURCE
PROPERTIES
Origin #{DE838A0F-C720-4DD5-9CCC-2C3809910FF9}
ENDPROPERTIES
***Element: END
---- End Code ----
DataEntity Extension Metadata
Hey,
any input on "How to get Metadata for DataEntityViewExtensions" would be appreciated.
Facing the need of evaluating AxDataEntityViewExtensions to achive a Technical Reference Report lookalike.
Select that returns a maxof and sum of the same field.
I am querying thru the business connector and I need to get the maxof and sum of the same field. Since there is no way to alias in AX is this possible?
Here is my query
Select KEY1, maxof(REALCONSUMP), sum(REALCONSUMP) FROM %1 GROUP BY KEY1,PRODID WHERE PRODID == '{0}'
If I use .get_Field("REALCONSUMP") I get the maxof but I dont know how to get the maxof.
Thanks
Brian
AIF service consumption in .net
Hi,
I have scenario and I am not able to figure it out. So I have exposed one table from AX through AIF in inbound port. Then I added the service reference to a c# class library and I wrote code to consume the service method in that library class. I built the vs project and imported the dll in a Windows form application or console application project. I wrote code to call my dll's operation consumption method. But when run my project it throws exception that the web reference configuration is incorrect or not available. Is there anything I am missing? I noticed if I consume the service directly in my windows form application then it works. Is it not possible to create a wrapper class for an AX AIF exposed service? Please help.
How to Find AX Method from SQL Query
Hi, everyone.
I got a query(heavy select statement - customized) and want to find which x++ code call this query.
It's very hard to find because I didn't make any customization at all.
I used activity monitor from SSMS and trace parser, but I couldn't find the query.
Is there any good way to find or backtrack the x++ code from query?
Please give me any information of solution about them.
Container in query
Hello,
I need your help to configure a query. I am in the customer invoice diary and for each invoice, I show the printer that has the client configured with a display method.
I want to filter this field and I have the query made of the relationship between the tables.
The display method:
The method is done in the StringEdit of the Grid. I pick up the value and everything, but the query does not do it well.
The problem is that this field is a container and I'm only interested in position four, which is where the name of the printer is. What you do not know is in the range how to enter that value and be able to compare it with the value to be filtered.
Thank you,
Alex
Sequence Number by year issue
We have a legal requirement in our country concerning the Sequence numbers for the vouchers and Sales invoices, the sequence numbers must be continuous by year and conflict between years is not allowed.
Example:
- In 2017 a sales invoice is generated with number Inv-00010
- In the beginning of 2018 the company enters a 2018 invoice and the system generates the number Inv-00011
- For a reason the company issues an invoice in the beginning of 2018 but with posting date 2017, the system generates the number Inv-00012 for this transaction.
The same Issue apply for vouchers, the company can enters vouchers for 2017 in 2018.
Replacing standard business logic
Hi
With the deprecation of overlayering and introduction of chain of command extension, I am having a basic problem, that used to be simple:
How can I replace business logic in a standard class with that of my own?
When using the chain of command, I am not allowed to break this chain. The standard class I am trying to replace the logic in a certain method has to run.
But there are certain cases, where a customer would require something else than what the standard has to offer.
The approaches so far:
- Do your business logic , and throw an error in a try/catch before the next() call --> Unusable. It could work, but if you are in a tts-scope you break something else.
- extend the new() method on the class you wish to replace with chain of command, to return an instance of your extension instead.
I like option 2, but I have not been able yet to make it work, as it seems the constuctor can not be extended through Chain of command.
Does anyone else have experience with this sort of scenario? I haven't been able to find anything on how to solve this particular problem.
Deployment - Business Logic (Scripts / Forms) Changes
Hi,
I am an analyst and was asked to assess how changes to a specific report business logic was last modified to ensure it been intact during a specific period. I was told the IT at client that in D365 a change rolled into Production from Dev / Test thru deployment package including all scripts / form previously deployed in the new deployment. They said, a single change will require to drop the previous deployment and include everything in the package with the new change and re-deploy everything.
Could this be confirmed. This restrict our visibility to ensure when was a specific report business logic was changed.
S Ahmad
Should I deploy the windows update to Development VM?
I was wondering if it is valid to deploy the latest windows update to development VM environment? I know in the past it used to break the envrionment whenever I deploy the windows update(I wasn't able to debug and keep giving me system error when I clicked on "start" button) but recently it works nicely even I apply the windows update.
Sales order isn't created from X++ code
Hi All,
I am creating the sales order using X++ code for my import process. When calling Saletable.Insert() the RecId had been genrated but when I check the record in SSMS I couldn't able to find the record. No new sales order created in the Sales order list page.
private SalesId createSalesTable(CustAccount _custAccount, CustPurchaseOrder _custPurchaseOrder, TransDate _requestShipDate, SalesOriginId _salesOriginId, InventLocationId _inventLocationid, CustRef _customerRef) { InventParameters inventParameters = InventParameters::find(); CustParameters custParameters = CustParameters::find(); SalesParameters salesParameters = SalesParameters::find(); SalesTable salesTable; SalesId salesId; CustTable custTable; NumberSeq numberSeq; ; select firstonly custTable where custTable.AccountNum == _custAccount; ttsbegin; numberSeq = NumberSeq::newGetNum(SalesParameters::numRefSalesId()); numberSeq.used(); salesId = numberSeq.num(); // create sales header salesTable.clear(); salesTable.initValue(); salesTable.CustAccount = custTable.AccountNum; salesTable.ShippingDateRequested = _requestShipDate; salesTable.initFromCustTable(); salesTable.initInvoiceAccount(); salesTable.SalesId = salesId; salesTable.PurchOrderFormNum = _custPurchaseOrder; salesTable.bfpSeasonId = seasonId; salesTable.SalesOriginId = _salesOriginId; salesTable.Reservation = ItemReservation::None; salesTable.DocumentStatus = DocumentStatus::None; salesTable.SalesStatus = SalesStatus::Backorder; salesTable.SalesType = SalesType::Sales; salesTable.PostingProfile = custParameters.PostingProfile; salesTable.SettleVoucher = SettlementType::None; salesTable.InventLocationId = _inventLocationid; salesTable.CustomerRef = _customerRef; if (indicator == "3") { salesTable.Reservation = ItemReservation::Automatic; } salesTable.insert(); ttscommit; info(strFmt("Sales order '%1' created", salesId)); return salesTable.SalesId; }
Please help me to resolve this...
Customer account not generated while creating new customer using OData entity from .net application
Hello, we are trying to create a new customer using OData entity but it gives error while saving that "Field Customer Account must be filled in" as we want to generate customer number automatically from number sequence.
When the number sequence is set to manual, we can save the record by assigned the value to customer account. but what if we need to auto generate it?
How to add new value in container with code?
WinAPI methods replacement in D365
Hi All,
In AX 2012, I have the code which calls WinAPI method getSaveFileName. This method shows the Saveas dialog with the fileName suggested in the FileName field. Does anyone know if there is any replacement for this method in D365, as WinAPI has been deprecated. I already looked at the FileUpload.. classes in AOT, but couldn't find any method which does the same thing I am looking for. The requirement is to get the fileName from the user through SaveAs dialog and then write to that file.
Thanks,
Baber.
Fetching Some Fields Data On Report
Hi,
I want to fetch E Way Bill Number, Document Date, Document No., Vehicle No. To Display On My Sales Invoice Report
Also InventBatchID. I am new in AX Development I Don't It How To Fetch That Data, Please Help....
Thanks
How To get data from sysdatabaselog and how to make list
Hi, im new in AX 2012
1. i wanna ask how to get data from sysdatabselog table. i dont know how is the best way to make relation between sysdatabase and another table. example i wanna make relation between sysdatabselog and prodtable.
2. how to make list like the right side from the picture below
thanks
Dynamic file name for the SalesINVOICE PDF
Hello,
When the sales invoice report is printed in the screen, we have a option to save the report as PDF.
It saves in the the name "Show tax invoice" as default. Is there an option to save this name as Dynamically.
I need the PDF name to be Invoice no: XXX when user saves the report as PDF.
Please let me know if this is possible.
I have tried with creating a new controller class, extending the salesinvoicecontroller and there in the main method, i put it as follows,
but it it still saving in the name , Show TaX Invoice.
SalesInvoiceController formLetterController = SalesInvoiceController::construct(); formLetterController.parmArgs(_args); formLetterController.parmReportName(PrintMgmtDocType::construct(PrintMgmtDocumentType::SalesOrderInvoice).getDefaultReportFormat()); formLetterController.parmShowDialog(false); formLetterController.parmDialogCaption("XX");// here i pass the invoice number formLetterController.startOperation();
Problem checking into VCS (Azure DevOps)
I have a problem checking my code into VCS (Azure DevOps)
First a little history, I have a module that I had to move from AX2012 to D365FO, and it was first moved using LCS, and a project was created on DevOps for this.
But in the meantime, the D365FO Developer machine where this was done had a problem with a disk and was lost, but we did have a backup of the folder with the code.
So, I created a new machine and finished the conversion on that, and now I am trying to check in the code to a new project, but after mapping the workspace on the new machine i get an error saying:
"Error: The working folder C:\AOSService\PackagesLocalDirectory is already in use by the workspace MININT-F36S5H;Someuser on computer MININT-F36S5EH"
How do I solve this, especially since i do not have access to the old devbox?