Quantcast
Channel: Martin Dráb's Activities
Viewing all 17532 articles
Browse latest View live

Grid Control linkPhysicalTableInstance to TempTable, first record inserted doesn't appear in Grid, fine afterwards

$
0
0

Hi Guys.

- I have a Wizard that generates a new form at runtime, containing a Grid Control.

- The Wizard passes a reference to one of its temp Tables to the form, in which I use linkPhysicalTableInstance in the runtime form's datasource init() method. - The GridControl has an add new record button, which inserts records in to the tmp table reference.

- The new record is saved to the reference temp table correctly, and displays in the grid *when the runtime form is closed and reopened* but does *not* display in the grid immediately after the insert.

- To add to the weirdness, after a runtime form has been created, a record inserted and then closed, subsequent run time forms do display new record insertions immediately, without needing to be re-opened.  Some code snippets below.

Can anyone please suggest why this behavior only happens for the first time that data is inserted in to the temp table, but displays fine for subsequent runs of the runtime form?

Creating the runtime form:

                args                    = new Args(formstr(RunTimeFormName));
                formRun             = classFactory.formRunClass(args);
                formRun             .parmRuntimeFormsGridTmpDS(sysWizard.ReferenceToWizardsTableTmp()); // Passing a reference for Wizards tmpTable to form
                formRun             .init();
                formRun             .run();
                formRun             .wait();
                formRun             .detach();

RunTime Form's parmDataSourceMethod:

public void parmRuntimeFormsGridTmpDS(CommentsGridTmp _ReferenceToWizardsTableTmp)
{
    ReferenceToWizardsTableTmp = _ReferenceToWizardsTableTmp;

}

DataSource init() method:

public void init()
{

    super();
    RuntimeFormsGridTmpDS.linkPhysicalTableInstance(ReferenceToWizardsTableTmp);

}

RunTime Form's New button clicked method:

void clicked()
{
    int64                                             numRows;
    ;
    // Refresh records loaded in grid DS to ensure correct number of records for setting initial index number

// Note:  SomeId is passed in Args() record, its passing fine as is the number of rows count - and replacing with a static value has no effect.


    select count(RecId) from ReferenceToWizardsTableTmp
        where ReferenceToWizardsTableTmp.SomeId == someId;

    numRows                                           = ReferenceToWizardsTableTmp.RecId;

    ReferenceToWizardsTableTmp.Comment                  = "Comment " + int642str(numRows + 1);
    ReferenceToWizardsTableTmp.Filename                 = "";
    ReferenceToWizardsTableTmp.someId                    = someId;
   ReferenceToWizardsTableTmp.insert();
   
    element                                           .Task(#TaskF5);
//    super();
}

So as described above, the first time that the runtime form is created and a record is inserted, it doesn't display. Reopening the form will display the inserted data fine. Also, after reopening the form any new records inserted appear in the grid in real time.

So I guess it must be something to do with the linkToPhysicalTable and where the grid fields look for records to display.

Any help appreciated!


Tim


Control the records in the table per user currently logged in.

$
0
0

I would like to be able to control the records in the table per user currently logged in.

I want to know a common unique key among the AX standard table to realize it.

Please let me know if you know the unique key.

DMFEntityWriter.write.xpp not found error in batch job

$
0
0

Hi Experts,

I am using AX 2012 R3 CU10 version.

I am trying to import data using DIXF (DMFInventTableEntity). The import is working fine in interactive mode.

But, system is throwing error DMFEntityWriter.write.xpp not found when importing through batch job.

Kindly guide.

Thanks,

N.Sridhar

getting path of menu in ax 2012

$
0
0

Hi All,

Good day!!

Is it possible to get path of a menu in ax 2012

example : if i select customers report in Accounts receivable then the path would be like

CEU/Accounts receivable/Reports/Customer/Customers

is it possible to achieve through code.

As i need to display the path of the report in each report print.

thanks in advance

AX7 development tools without VM

$
0
0

If you want to run and/or modify AX 7 (Dynamics 365 for Operations), you get a whole virtual environment configured by Microsoft and you either deploy it to Azure or run as a local virtual machine on Hyper-V.

I have a huge laptop with 32 GB RAM and two SSD disks built specifically for running AX 2012 and AX 7 VMs and I also have a few environments in Azure (my MSDN subscription gives me some credit for Azure every month), therefore I have all I need for development. But sometimes I don’t have access to these environments, such as when I travel just with a small laptop, and I would still like to review some X++, verify something when answering questions in forums and so on, and having AX development tools with me would be a great help.

I tried it and found that setting it up wasn’t very difficult, as I’m going to show below. Just let me make it clear – I’m talking about having access to Application Explorer, projects, designers and code, not about building and running Dynamics AX. It would be possible, but it would require more effort and my small laptop isn’t even powerful enough to do that. When I want to develop something, I use one of my proper development environment.

First of all, you need a machine with Windows and Visual Studio 2015. To show the process from the beginning on an empty box, I’ll use a virtual machine in Azure based on the image called Visual Studio Enterprise 2015 Update 3 with Universal Windows Tools and Azure SDK 2.9 on Windows 10 Enterprise N (x64).

Files and website

We won’t build the environment from scratch – we’ll copy the application from an existing development environment. Go to an environment you want to copy, find the folder containing packages and WebRoot (most likely J:\AosService), make a copy and put it to your machine. In my example, I’ve put it to c:\AX7.

Find web.config file inside WebRoot folder and update paths according to the new location. Edit > Find and Replace > Quick Replace (or just Ctrl+H) in Visual Studio will help you with it.

Then create a site referring to WebRoot. Because IIS isn’t enabled by default, go to Windows features and add it.

Open IIS manager and add a new website.

Set the name to AOSService, Physical path to the WebRoot folder (C:\AX7\AosService\WebRoot in my case) and Port to something that isn’t already used.

We’re not going to run the website; it’s here just for Visual Studio to locate configuration. If we wanted to actually run it, we would have to pay much more attention to the configuration of both the website and the application pool.

Visual Studio tools

When you have files and the service ready, it’s time to install the Visual Studio extension containing all tools for AX (Application Explorer, project types, the menu and so on). Download a binary update from LCS and extract it to a folder (D:\AllBinary71Update3Updates in my case). Then go to DevToolsService\Scripts, find Microsoft.Dynamics.Framework.Tools.Installer.vsix, double-click it to start the installation and walk through the installation wizard.

If you want to be able to create AX projects (which may be useful), you also have to copy MSBuild target files (which are references by project files) to the expected location. You can do it, for example, by executing the following Powershell script (with the Script folder as the current location).

$dir=New-Item"C:\Program Files (x86)\MSBuild\Microsoft\Dynamics\AX"-Type Directorycp*.targets $dir

When you run Visual Studio (as administrator), you should be able to open Application Explorer, view code, create AX projects and so on.

But one important thing is missing. When you’re trying to locate an object or you’re familiarizing yourself with the application, you’ll likely use cross references, which we don’t have there in the moment. Let’s fix it.

Cross references

Cross references are stored in a SQL Server database called DYNAMICSXREFDB, therefore go to the source environment, create a full backup of this database and copy the file to your machine. If you have SQL Server installed, connect to it, if not, not an issue – Visual Studio comes with a local DB. You may want to download and install SQL Server Management Studio and then simply connect to a server called (localdb)\MSSQLLocalDB in the same way as if it was a regular SQL Server.

Restore DYNAMICSXREFDB from the file.

Give yourself sufficient permissions to the database, such as making yourself a database owner.

You have to tell Visual Studio where it’ll find the database, therefore open {Documents}\Visual Studio 2015\Settings\DefaultConfig.xml and change the value of CrossReferencesDatabaseName to (localdb)\MSSQLLocalDB (or your database server if you don’t use local DB). Start Visual Studio again and you can start using references as usual.

Although it doesn’t build a full environment with all features, it fulfills its purpose. Now I can easily carry all AX 7 code with me, exploring it on plane, quickly checking code or property names when somebody asks in a forum and so on. My intention isn’t to stop using VMs from Microsoft for development and testing – on machines powerful enough to run AX (don’t forget that the compiler is designed for 16 GB RAM, for example), I can use the VM as well, so configuring the whole environment on my own installation of Windows would be worth the effort. I did this when I couldn’t use the VM and the time spent with setting it up it is already paying off. Documenting it for others took much more time than that.

Exception handling with Web Service (not catching)

$
0
0

Hi,

After all these years I have encountered this problem where exceptions were handled differently.

Martin wrote about X++ and CIL.

http://dev.goshoom.net/en/2013/09/exception-handling-with-x-and-net-interop/

I wrote a custom web service with try/catch statements to see how it behaves.

After debugging I found it errored with unhandled ErrorException.

The calling .NET console app catches the error as System.ServiceModelCommunicationException. This has the first error.

The fact that AX does not respect the "catch" concerns me. What this is telling me is that I have to make my web service much more granular. Also, catching the errors in the calling application and dealing with it.

I wanted to see if others are experiencing the same or if any comments.

AX.ManagedInterop.Session .Logon fails in BackgroundWorker

$
0
0

Hi.

We are using managed host to use WPF custom controls inside AX 2012 R3 CU10 Form.

I am trying to get data from AX from the ViewModel of a WPF control using a BackgroundWorker. It is critical to use that as it is a long operation that freezes the UI.

The problem is that the AX.ManagedInterop.Session.Current is null on that thread.

 

So I try to connect again using

Microsoft.Dynamics.AX.ManagedInterop.Session axs = new Microsoft.Dynamics.AX.ManagedInterop.Session();
 
axs.Logon("ic1", "en-US", null, "AX12310_GPBD_ISV");

if (axs.isLoggedOn())
{
 
result = Dal.GetAllResources();

}
 
This throws an InvalidLogonInSingleSessionException.
 
I cannot find any specific details of why the logon is invalid.
 
Please help me out.
Thanks in advance.

Exception thrown when emailing statements with print management in a batch

$
0
0

Can anyone help me with the below problem, basically at the moment I'm having to run the statements every month and end up doing it in about 20-30 'batches' because of the seemingly random crashes.

I get the following error at seemingly random intervals when attempting to email statements (External->Customer account Statement) using a batch and print management.

For testing purposes, I have set the email address to my own email address in print management but the same thing happens when I use @Business@ as the purpose field for the email when trying to send to customers (I usually add our debtors manager into the CC field as well but leave this out for testing).

By picking up the last customer sent to from the emails, I then 'select' >Customers->Csutomer Account for the next run which then continues from where it seemingly left off until it crashes again.

I cannot see why it crashes when it does but it always has the same error as shown below.

Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type 'Microsoft.Dynamics.Ax.Xpp.ErrorException' was thrown.
at Dynamics.Ax.Application.SrsPrintMgmtController.Outputreports() in SrsPrintMgmtController.outputReports.xpp:line 96
at Dynamics.Ax.Application.CustAccountStatementExtController.Outputreports() in CustAccountStatementExtController.outputReports.xpp:line 3
at Dynamics.Ax.Application.CustAccountStatementExtController.Runprintmgmt() in CustAccountStatementExtController.runPrintMgmt.xpp:line 116
at Dynamics.Ax.Application.SrsPrintMgmtController.Run() in SrsPrintMgmtController.run.xpp:line 14
at Dynamics.Ax.Application.BatchRun.runJobStaticCode(Int64 batchId) in BatchRun.runJobStaticCode.xpp:line 54
at Dynamics.Ax.Application.BatchRun.runJobStatic(Int64 batchId) in BatchRun.runJobStatic.xpp:line 13
at BatchRun::runJobStatic(Object[] )
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)
at BatchIL.taskThreadEntry(Object threadArg)


Multiple AIF on single server

$
0
0

Hi,

Here is the case I am facing ryt now...

Can any one please guide me on this.

I have a Single machine where AX is installed (AX2009) and three AOS instances were installed on same machine.

X   (LIVE)

Y   (AX core Development)

Z   (E-Commerce and AX integration) Testing

Currently we are working on Z for eCommerce integration and the AIF services installed is communicating to Z only. 

Client needs the eCommerce integration on X. Now my question is, can we configure another AIF on the same machine that is communication to X only

i.e.

Z AIF should exist (Parallel development is going on)

X AIF also should exist (Completely Live).

Can any one suggest me how to configure multiple AIF for communicating different AOS instances.

Regards,

Rasool

How to set SSRS language in the data provider class

$
0
0

Hi,

I am aware of this.parmReportContract().parmRdlContract().parmLanguageId(language-id) code to change the language of the report. But, I have seen this code only in the controller class's prePromptModifyContract() method.

I have a scenario where the language of the report needs to be determined in the data process class (DP class) of the report. How can I specify the language in the DP class processReport() method?

Regards,

Abhinay

Approach to take on adding a new report destination option in AX 365?

$
0
0

Can anyone give me a general idea on  how to add a new report destination option in AX 365?

I took a look into the standard report printer code and realized that I will need to modify the SRSReportRunPrinter and some other related classes to implement the new print destination option.  However I found the objects belong to Application foundation package can’t be customized, and I am not sure if it can be accomplished by extension method.   

To rephrase , I can extend the SRSReportRunPrinter class to add a new method  for the Web service option, but I will still have to customize the SrsReportRunService class to call the new extension method. However the SrsReportRunService class belongs to Application foundation package, it can’t be customized. What to do here?

Thanks in advance.

How to find the classes used for invoice registration

$
0
0

 I have added a field in vendInvoiceJour which should be initialized with the values from another field in VendInvoiceInfoTable. This to tables have no relations with each other, so i have to find the class that is used to create the invoice. How can I find this class??

Use table in different packages

$
0
0

How can i use table in application suite package  from another package ??

New to Dynamics 365 - can't find stuffs

$
0
0

Hi, I am new to Dynamics. My company wants me to build integration between Dynamics and our own system. So I just installed Microsoft Dynamics 365 trial version. I have installed it for a couple of days now but still being unable to figure out. The current screen looks like below: 

enter image description here

I can't find those ... things which should appear here - something like leads, contacts, accounts, opportunities, or create new record types here. Where is everything...

How to find the classes used for invoice registration

$
0
0

 I have added a field in vendInvoiceJour which should be initialized with the values from another field in VendInvoiceInfoTable. This to tables have no relations with each other, so i have to find the class that is used to create the invoice. How can I find this class??


send Json data to external WebService from AX2009

$
0
0

How can I realize to send JSON data to an external Webservice from AX2009?

I think I have to create an external C# tool where I put my data (URL, Login Data and Data to post) in and than send the stuff from there. Am I right?

How can I easily realize this and how can I handle this inside AX?

Report name output as dynamic

$
0
0

hi 

i am new to Dynamics AX 2012 , i need the report output name should have include parameter and report with timestampe.

its possible , 

thanks 

kumar

Functional regression test automation in Dynamics AX 2012

$
0
0

I am looking for a tool to automate functional regression tests in Dynamics AX 2012:

1. I looked at third party (ISV) tools like Axeptance and Executive Automats. Does anyone have experience with these tools? Could you provide me pro's/cons and your experience when you made it part of your testing process?

2. I read Dave Froslie's Testing Best Practices white paper and am also interested in using Microsoft Test Manager in Visual studio. Does anyone have any videos/examples/blog posts using Test Manager with Dynamics AX? So far all I have found is videos showing web application testing, but I would like to see it in action with Dynamics AX.

Any other suggestions, tips and tools regarding automated functional regression testing also welcome! 

P.S. - I am not interested in unit tests or SysTest yet; hopefully that will be phase 2 of our new testing process! :-) 

how to transit to another screen by pressing button

$
0
0

I would like to create a system that can transit to another screens by pressing the button

like InventOnHandItemListPage form.

I investigated properties and methods of InventOnHandItemListPage, but I did not understand how to do it.

Would you please let me know if I need to set property settings and methods?

<Image : From InventOnHandItemListPage To InventOnhandItem by pressing Details button>

Disable a field based on second field value in AX 2012 R3.

$
0
0

Hi all,

I have a scenario where I have to disable a field if the second field value is yes.

I have two fields created in InventTabble table i.e.

- String type (Manufactur ID)

- Enum type (MID per batch)

The default value for "MID per batch" is No.

I have to show this fields in the "EcoResProductDetailsEntended" form based on a condition i.e.

- if "MID per batch" = Yes then disable "Manufactur ID) and,

- if "InventItemSetupSupplyType.DefaultOrderType <> "Purchase Order" then disable "MID per batch" and "Manufactur ID" fields.

I am using the modified( ) method under the form method and code used is -

public void modified( )
{
   if(InventTable.MIDPerBatch == NoYes::Yes)
   {
     InventTable_ds.object(fieldnum(InventTable, ManufacturID)).allowEdit(false);
   }
   else
   {
     InventTable_ds.object(fieldnum(InventTable, ManufacturID)).allowEdit(true);
   }

   if(InventItemSetupSupplyType.DefaultOrderType <> "Purchase Order")
   {
     InventTable_ds.object(fieldnum(InventTable, MIDPerBatch)).allowEdit(false);
     InventTable_ds.object(fieldnum(InventTable, ManufacturId)).allowEdit(false);
   }
   else
   {
     InventTable_ds.object(fieldnum(InventTable, MIDPerBatch)).allowEdit(true);
     InventTable_ds.object(fieldnum(InventTable, ManufacturId)).allowEdit(true);
   }
}


But I am still not able to perform the requirement - am I doing wrong or should I not be using the modified( ) method or am I calling the method under wrong form level. I tried to create the method under the data source of InventTable method but still no result.

How can I disable the fields based on the other field conditions?

Viewing all 17532 articles
Browse latest View live


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