Quantcast
Channel: Technical Tutorials on MS Dynamics Axapta 2012,D365 FnO
Viewing all 219 articles
Browse latest View live

Online Practical to Create Security Role,Privileges,Duties in Ax 2012

$
0
0
If you want to learn How to Create Role ,Privileges,Duties in Ax 2012 then You can follow below .
Steps are as below
These are the steps How to create new role for Form display menu item in Ax 2012
1.Go to Menu item and create new menu item attach form object in properties.
2.Go to AOT security note and go to  privilege and create new privilege then drag menu item to entry point.
3.Go to duty and create new Duty drag created privilege to duty.
4. Go to role and create new role and drag duty and privilege to role.
Now you can see your role for assigning to users on users form

Same steps you can view on below clip on YouTube.


You can subscribe video to learn more and get update for new version like dynamics 365.



Things to Know in Dynamics 365 architecture

$
0
0
To Consider in Dynamics 365 portal architecture:


Consider deployment. Desktop applications must be installed upon a particular nimble system and deployed for each PC. Web applications can have less deployment or update effort for hundreds or thousands of PCs.

Consider platform limitations. The desktop is limited by its hardware, and must meet the hardware requirements to intend the application. Web applications can meet the expense of admission to rarefied applications delivered from a centralized infrastructure. A Mobile device is limited by its screen place, user-within take effect memory and data association.

Consider users.  Who will be the majority of the users?  How will they be accessing Dynamics 365?  We are in a mobile driven world where most individuals surrounded by 12 to 70 years very old-fashioned own a mobile device. Of those mobile users 46% use a mobile application to urge regarding them considering shopping and a propos-the-go research.

Consider security. Does your viewpoint have protection that requires added security? What precautions compulsion to be taken? Online and mobile banking options have become preferential due to ease of goodwill and malleability they have enough child support.

Consider supported device. What is the preferred browser at your meting out?  How does leveraging the same Web application upon alternating browsers modify the fanatic experience?

Consider availability. Web applications are universally comprehensible but, rely upon internet connectivity in order to achievement.  In comparison, a stand-alone desktop utter is not inhibited by connectivity. Something before happening taking into account the money for a ruling in addition to a mobile device is that the application could quit or restart subsequent to the enthusiast receives a call.

How to get all Columns of Table in ax 2012 by job x++ code

$
0
0
To get all Columns of Table in ax 2012 by job x++ code you can try below code . If you table have large number of columns and do not have much time then you can use this job to get all columns to use in your code.

This job can be very useful for your development.

  DictTable  dictTable = new sysDictTable(tableNum(testTable));  
fieldId fieldId=dictTable.fieldNext(0);
dictField dictField;
while(fieldId)
{
dictField=dictTable.fieldObject(fieldId);
info(strFmt('testTable.%1 = %2;',
dictField.name(),
any2str("")));
fieldId= dictTable.fieldNext(fieldId);
}

Introducing new website to find correct answer for your question including D365

$
0
0
I am Introducing new website to find correct answer for your question including D365 and SQL along with many section .

The title is Genius Advice  website and URL is  Expert advice on your issues



We have shown you way of working and purpose of the website on below clip. Many more section will come in future.

You can visit and if you like then you can register to become permanent genius person on that site. 

Delete Cascade,Loop statement ,Query build data source and Ax tips

$
0
0
Delete Cascade Option in Ax 2012

This clip will show you How can you Delete Cascade Option in Table Ax 2012.You can understand this option better way by reading below.

Types of delete action
Cascade
Restricted
Cascade+restricted

A cascading deletion action will delete all records in the related table, where the foreign key is equivalent to the primary key of the current table. That is, deleting the parent record will also delete the child record(s) in the related table.
This cascading will take place whether the deletion is performed in code or directly by a user through the user interface.
Restricted

A restricting delete action will raise an error message if the user tries to delete a record, where records exist in the related table where the foreign key is equivalent to the primary key of the current table.
This error will only appear if the deletion is performed through the user interface. A deletion from X++ code will be allowed to proceed and will not be cascaded to the related table. In this case the programmer should call .validateDelete() themselves prior to the call to .delete()
Cascade+Restricted

This delete action normally works as a Restricted delete action. However, if the deletion is performed through X++ code, no error will be raised and the deletion will be cascaded to the related table.



If ,While for, switch etc Statement in Axapta

This clip will show you Ax 2012  Loop Statements, conditions and query build data source at runtime.

It also includes switch statement, if else if conditions, query ranges, ternary operator etc



Dynamics Ax 2012 Tips and tricks

This video clip will show you why dynamics Axapta is user-friendly ERP software.Summarize the features like security roles assignment, workflow, outlook and excel integration, master upload facility, menu driven, add to favorites, administration, go to the main form, master form, page navigation, search etc.

In this clip, you will get Idea what is Axapta and how it works and why demand of Axapta is increasing day by day.


A version of Axapta included in this clip is ax 2012 r3, Most of the bugs fixed in R3 modules.


Overview of Ax build version and history summary

$
0
0
I Want to share information from one video which I have created recently. URL is as below.



By viewing This video you will able to know Introduction of Microsoft Dynamics Ax and build version in the Hindi language.

Following topics included in this clip.
1.Axapta is born
2.Build versions of MS Axapta
3.Purpose of different versions of Axapta.
4.Journey of ax 2012
5.CU and RU Updates
6.Roadmap survey
7.Axapta service packs
8. Purpose of ERP
9. Year of versions
10.Working knowledge of Axapta

If you like this clip then you can go for subscription to know latest updates on ax in future.

Code sample to open existing excel file in Axapta

$
0
0
Code sample to open excel file in Axapta. You can use below code in any version of Axapta. First, you need to paste the file in particular folder path then you can open it by using job or class.

You can check below code through job x++ editor. This code can be helpful if you want to provide the menu item to export template for the user.

  fileName = "C:\\Users\\Public\\Documents\\TestTemplate.xlsx"  
;
WinAPI::shellExecute(fileName);
WinAPI::setFileAttributes(filename,1);

Ax 2012 Dynamic or run time Query Range without coding in Reports

$
0
0
I am sharing This clip which will show you How to Add Dynamic or runtime Query Range without coding in Report In Axapta. This tips will work in all version of Axapta. Ax versions which are available in Market are from ax 2.5 to Dynamics 365.

How to use query range in a smart way to avoid customization and coding.

Dynamics ax is very much user-friendly ERP. I hope you will like this tips.



Add custom Lookup for Employee id in Ax 2012

$
0
0
To Add customLookup for Employee id in Ax 2012 you can try below code sample in datasource filed of the form.

You can add data method to lookup easily to get the name of the employee. Here HcmWorker is a master table of employee and personnel number and name is the field of Hcmworker table.


   SysTableLookup     sysTableLookup = SysTableLookup::newParameters(tableNum(HcmWorker),_formControl);  
Query query = new Query();
QueryBuildDataSource queryBuildDataSource = query.addDataSource(tableNum(HcmWorker));
queryBuildDataSource.addRange(fieldnum(HcmWorker,Tester)).value(queryvalue(Noyes::Yes));
sysTableLookup.addLookupfield(fieldNum(HcmWorker,PersonnelNumber));
sysTableLookup.addLookupMethod(tableMethodStr(HcmWorker,Name));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();

Enable disable sales Invoice,Confirmation,packing slip and Picking list button in Ax 2012

$
0
0
Sometimes we need to enable disable button in Sales order form then you can apply your code in below method in SalesTableType class

\Classes\SalesTableType\canConfirmationBeUpdated
\Classes\SalesTableType\canInvoiceBeUpdated
\Classes\SalesTableType\canPackingslipBeUpdated
\Classes\SalesTableType\canPickingListBeUpdated

For sales order list page you can refer below method.

\Classes\SalesTableListPageInteraction\setButtonEnabled


Ax 2012 Form Development,User control,Role centers,Citrix lookup issues

$
0
0



Simple form development using multiple tables
How to create role center in Ax 2012


Custom lookup issue On citrix client



How to create User control on EP website


X++ code to print sales invoice on printer directly

$
0
0
Below is the X++ code to print sales invoice on printer directly.

  Args          salesArgs = new Args();  
SalesInvoiceContract salesInvoiceContract;
SalesInvoiceController controller;
SrsReportRunImpl srsReportRunImpl;
str fileName;
CustInvoiceJour custInvoiceJour;// = _args.record();
select custInvoiceJour where custInvoiceJour.InvoiceId=="INV_00000009";
salesArgs.record(custInvoiceJour);
controller = new SrsReportRunController();
salesInvoiceContract = new SalesInvoiceContract();
controller.parmReportName(ssrsReportStr(SalesInvoice,Report));
controller.parmShowDialog(false);
controller.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::Printer);
// controller.parmReportContract().parmPrintSettings().printerName(@"\\espprn03\Follow Me - MFP");
salesInvoiceContract.parmRecordId(custInvoiceJour.RecId); // Record id must be passed otherwise the report will be empty
salesInvoiceContract.parmCountryRegionISOCode(SysCountryRegionCode::countryInfo()); // comment this code if tested in pre release
controller.parmReportContract().parmRdpContract(salesInvoiceContract);
controller.startOperation();

Add Financial dimension Lookup at Enterprise portal in Axapta

$
0
0
To Add Financial dimension Lookup at Enterprise portal in Axapta you can to help with below code.

 protected void BusinessSector_LookUp(object sender, AxLookupEventArgs e)  
{
//Getcurrent user to filter record based on current user
String usr = WindowsIdentity.GetCurrent().Name;
int pos = usr.IndexOf('\\');
usr = pos != -1 ? usr.Substring(pos + 1) : usr;
AxLookup lookup = (AxLookup)sender;
// Create the lookup data set. The respective table will be used.
Proxy.SysDataSetBuilder sysDataSetBuilder;
sysDataSetBuilder = Proxy.SysDataSetBuilder.constructLookupDataSet(AxSession.AxaptaAdapter, TableMetadata.TableNum(AxSession, "DimensionFinancialTag"));
// Set the generated data set as the lookup data set.
lookup.LookupDataSet = new DataSet(AxSession, sysDataSetBuilder.toDataSet());
using (Proxy.Query query = lookup.LookupDataSet.DataSetViews[0].MasterDataSource.query())
{
query.dataSourceNo(1).addRange(TableArrayFieldMetadata.FieldNum(this.AxSession, "DimensionFinancialTag", "FinancialTagCategory")).value = "5637146078";
}
// Specify the fields for the lookup.
lookup.Fields.Add(AxBoundFieldFactory.Create(AxSession, lookup.LookupDataSetViewMetadata.ViewFields["Description"]));
lookup.Fields.Add(AxBoundFieldFactory.Create(AxSession, lookup.LookupDataSetViewMetadata.ViewFields["Value"]));
lookup.SelectField = "Value";
}

Import References for SSRS Report user Control in Enterprise portal axapta

$
0
0
Following Import References  are required in using section for Creating SSRS Report user Control in Enterprise portal axapta

 using System;  
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.DataVisualization.Charting;
using System.Web.UI.WebControls;
using Microsoft.Dynamics.Framework.Portal.UI.WebControls;
using Microsoft.Dynamics.Framework.Portal.UI.WebControls.WebParts;
using System.Diagnostics;
using Microsoft.Dynamics.AX.Framework.Reporting.Shared;
using Microsoft.Dynamics.Framework.BusinessConnector.Session;
using Microsoft.Dynamics.AX.Framework.Portal.Data;
using Microsoft.Dynamics.Framework.Portal.CommonControls;
using System.Globalization;
using Microsoft.Dynamics.AX.Framework.Services.Client;
using Microsoft.Dynamics.Framework.Portal;
using Microsoft.Dynamics.Framework.Portal.UI;
using Proxy = Microsoft.Dynamics.Framework.BusinessConnector.Proxy;
using Microsoft.Dynamics.Framework.BusinessConnector.Adapter;
using System.Security.Principal;

Solved:Getting Error during Full CIL in Ax 2012 R3 CU11

$
0
0
I am Getting Error during Full CIL in Ax 2012 R3 CU11 version.

"The SysWorkflowDictElement.getAttribute() reflection API could not create and return the AifCollectionTypeAttribute object. Please check the parameters."

No any single report executing and giving parameter related error then tried to do full CIL then above error coming.

Solution: Solution of this issue is as below.
1.
first, compile the class mentioned in the error message and see if this solves the problem if not then use compile forward option.
2.Then use incremental compile option if again other class error coming then compile again till incremental compile issue not resolved.

3. Once incremental compile did then do full CIL.

4. Then if the issue still exists then do steps.


1) first stop the aos services and go to the folder of the XPPIL folder and delete all files

2) start the services of aos

3) and do the incremental CIL

4)THEN  Do FULLY CIL, THEN ALL THE SERVICE WILL BE STARTED.

Getting Error on AIF Web service enabling for custom class in Ax 2012

$
0
0
Problem
I am Getting below Errors on AIF Web service enabling for custom class in Ax 2012.

1.Application pool 'MicrosoftDynamicsAXAif60' is being automatically disabled due to a series of failures in the process(es) serving that application pool.


2.
There was an error during processing of the managed application service auto-start for configuration path: 'MACHINE/WEBROOT/APPHOST/Default Web Site/MicrosoftDynamicsAXAif60'. The error message returned is: 'An initialization error occurred while trying to preload an application.

Exception: System.Configuration.ConfigurationErrorsException

Message: Duplicate type with name 'Dynamics.Ax.Application.NewItem' in assembly 'Dynamics.Ax.Application, Version=6.3.1000.309, Culture=neutral, PublicKeyToken=null'.

StackTrace:    at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
   at System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
   at System.Web.Configuration.AssemblyInfo.get_AssemblyInternal()
   at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
   at System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded)
   at System.Web.Compilation.BuildManager.ExecutePreAppStart()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)

InnerException: System.BadImageFormatException

Message: Duplicate type with name 'Dynamics.Ax.Application.NewItem' in assembly 'Dynamics.Ax.Application, Version=6.3.1000.309, Culture=neutral, PublicKeyToken=null'.

StackTrace:    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)'.  The worker process will be marked unhealthy and be shutdown.  The data field contains the error code.


Solution:After struggling a lot I found solution for this which I am sharing here to help you and save your time.

Following steps I did to resolve this issues.

1.Stop AOS, 
2.Truncate table SYSXPPAssembly, 
3.delete folder xppil form Bin folder
C:\Program Files\Microsoft Dynamics AX\60\Server\AX_60_Dynamics_TEST\Bin\
4.Run AOS services, 
5.Axbuild, and full compile full cil
6.the problem cause the dll and net module not refresh delete all file in C:\Program Files\Microsoft Dynamics AX\60\AifWebServices\Bin
7.Enable customized port in ax again 
Now problem resolved enjoy and happy daxing.

Code to approve bom for product in Ax 2012.

$
0
0
Code to approve bom for product in Ax 2012.If you are creating or uploading bom list by code then auto approval may required,below code will help to approve bom item automatically.

 void God_setBOMActive(BOMId bomid,str 20 approver1)  
{
BOMVersion BOMVersion1;
BOMApprove bomApprove = new BOMApprove();
RecId approver = HcmWorker::findByPersonnelNumber(approver1).RecId;
boolean ret=true;
try
{
select forUpdate BOMVersion1 where BOMVersion1.BOMId==bomid;
BOMVersion1.selectForUpdate();
BOMVersion1.Approved = true;
BOMVersion1.Active = true;
BOMVersion1.Approver = approver;
ttsBegin;
BOMVersion1.write();
ttsCommit;
bomApprove.init();
bomApprove.parmApprover(approver);
bomApprove.parmBOMId(bomid);
bomApprove.run();
}
catch
{
info(strFmt("(%1) approval failed.", bomid));
}
}

Code to get Miscellaneous charges of purchase line in Ax 2012

$
0
0
This is Code to get Miscellaneous charges of purchase line in Ax 2012. You can try below code to check in job.

 PurchTable purchTable;  
PurchLine purchLine;
MarkupTrans markupTrans;
while select * from purchLine
Join purchTable
Join markupTrans
Where purchTable.PurchId == purchLine.PurchId
&& markupTrans.TransRecId == purchLine.RecId
&& purchTable.PurchId=="PO-0000043"
{
info(strFmt("%1 , %2 , %3",purchLine.PurchId,markupTrans.Txt,markupTrans.Value));
}

Code to get opening balance for Ledger Main account in Ax 2012

$
0
0
If you want to check opening balance for particular main account then you can check below code to get the same.

This is sample Code to get opening balance for Ledger Main account in Ax 2012.

  LedgerBalanceMainAccountAmounts ledgerBalance;  
AmountMst opSum;
;
ledgerBalance = LedgerBalanceMainAccountAmounts::construct();
ledgerBalance.parmIncludeRegularPeriod(true);
ledgerBalance.parmIncludeOpeningPeriod(true);
ledgerBalance.parmIncludeClosingPeriod(false);
ledgerBalance.parmAccountingDateRange(mkDate(01,01,2000), mkDate(31,12,2017));
ledgerBalance.calculateBalance(MainAccount::findByMainAccountId('1123333'));
opSum = ledgerBalance.getAccountingCurrencyBalance();
info(num2str(opSum,10,2,1,1));

Code to Confirm and Post Project Item Requirement for Sales Order in Ax 2012

$
0
0
This is a sample Code to confirm and Post Project Item Requirement for Sales Order in Ax 2012 . You need to pass sales order in salesFormLetter class method update and you can pass transaction date or posting date as per your need it will create or post project sales order item requirement packing slip. Its same functionality as post button on project item requirement form.

 SalesFormLetter salesFormLetter;  
salesTable Salestablelocal;
str 200 msg;
salesid salesid;
if(salesid)
{
select Salestablelocal
where Salestablelocal.Salesid ==salesid
&& Salestablelocal.salestype==SalesType::ItemReq
&& Salestablelocal.SalesStatus==SalesStatus::Backorder;
if(Salestablelocal)
{
ttsBegin;
salesFormLetter = SalesFormLetter::construct(DocumentStatus::Confirmation);
salesFormLetter.update(Salestablelocal);
salesFormLetter = SalesFormLetter::construct(DocumentStatus::ProjectPackingSlip);
salesFormLetter.update(Salestablelocal);
ttsCommit;
msg = "Item Requirement with Sales order id : " + salesid + " Posted ";
}
else
{
msg = "Item Requirement with Sales order id: "+ salesid + " already posted";
}
}
else
{
msg = "Item Requirement with provided Sales order id does not exists";
}

Viewing all 219 articles
Browse latest View live