I have a MorphX report (AOT report) that has been imported from 3.0. The problem is the class that starts the report is based off of RunBaseReport. It then sends in parameters from the dialog box. This all works client side. I want this to run on the batch server and schedule it to print out reports and email them.
The issue is in the init method. Where SalesReport is the above mentioned class that overrides RunBaseReport:
SalesReport = element.args().caller();
This line doesn't work when coming from the batch server. So then when I try to call SalesReport.parmDate() I get an
this object has not been initialized
error. Can this not be done from a batch server anymore or what are alternatives?
Related
I want to store the exported pdf file to clip board to be able to paste as an attachment in outlook. I'm using asp.net / vb and i've tried to import system.windows.forms in my web application to use the clipboard class.
any idea?
'here's my code:
Clipboard.SetDataObject(System.IO.Path.Combine("C:/Temp/", HttpContext.Current.Session("fileName")), True)
'this is the error after this process:
Exception thrown: 'System.Threading.ThreadStateException' in System.Windows.Forms.dll
An exception of type 'System.Threading.ThreadStateException' occurred in System.Windows.Forms.dll but was not handled in user code
Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
ASP.NET code is run on the back end side, i.e. server. So, accessing the Clipboard on the server doesn't make any sense. Instead, you can find a JavaScript code/component which can be run on the client browser.
I have a quastion regarding document services
I just want to create salesorders through document services I just follow the straight forward procces of https://technet.microsoft.com/en-us/library/hh352313.aspx.
I made the modifications that coresponds to my system through the help of the exception log of administration panel . Now I have to face the fact that my xml file is deleted and I have no salesOrders in salestable and not a response xml into response file.
Then my next action was to debug the service...attach the proccess load the debug symbols etc....
The time that I triger the services did not hit the breakpoint in the class/method SalesSalesOrder.read but instand I get a funny error from VisualStudio which make me to feel blind , also note that does not exist any error in exception log of dynamics ax or in the batch job.
The error from VS.
"An exception of type 'Microsoft.Dynamics.Ax.Xpp.ErrorException' occurred in Dynamics.Ax.Application.dll854.netmodule but was not handled in user code"
Can anyone help me or face something similar at the past?
iN inbound port I should specify the company id,
then everything works fine. The reason was that the default company was empty and the new salesorders cannot passed validation.
I was trying out one functionality of BizTalk from the below link
https://masteringbiztalkserver.wordpress.com/category/pipelines/
Till now I never had to go to event log to check for any entries.
Now when I am trying to get a custom message logged in event Log, from BizTalk application, I dont see any relevent entry from BizTalk other than 2 entries when I restart the BizTalk Host instance.
From my research I had written down the below code in Expression shape in the application Orchestration:
xmlMessage = InputMessage;
stringMessage = xmlMessage.OuterXml;
System.Diagnostics.EventLog.WriteEntry("BizTalk Server", stringMessage);
Here the InputMessage is a message defined in orchestration for sample Schema that I have created.
My application got build and deployed properly and it is also processing the messages properly. Its just that I don't see any log in event viewer for my code or for the suspended messages when I intentionally stop the send port.
The discussionfrom below link also didnt help
No eventlogs from BizTalk
I have BizTalk Server configured on my Windows 7 Ultimate machine. I am the administrator of the machine.
A few points on this:
BizTalk sever will not log an event for a suspended message, that's why you dont' see one.
You should never use the BizTalk Server Event Source since the BizTalk product owns that
You can very easily create you own custom Event Source using PowerShell.
To create a custom Event Source, use something like:
new-eventlog -logname "Application" -Source "MyApplicationThatLogs"
To write with this Event Source, use something like:
System.Diagnostics.EventLog.WriteEntry("MyApplicationThatLogs", "Some Error Occured!", System.Diagnostics.EventLogEntryType.Error, 100, 0);
Rather than using System.Diagnostics.EventLog for debugging purposes I would recommend that you use the BizTalk CAT Instrumentation Framework.
For a pipeline
TraceManager.PipelineComponent.TraceInfo(stringMessage);
For a Orchestration
Microsoft.BizTalk.CAT.BestPractices.Framework.Instrumentation.TraceManager.WorkflowComponent.TraceInfo(stringMessage);
It allows for real-time tracing when needed, "you can enable tracing on a production server with only a negligible impact on performance (when tracing to a file)."
I have created a new Exchange provider according to the Manual in the Microsoft Page but when I try to import the data's it shows nothing,no errors and doesn't make the import of the data.I try to debug but I get nowhere.
Any suggestion?
Thank you
I'm guessing that you are referring to the Creating Exchange Rate Providers for Microsoft Dynamics AX 2012 white paper.
Following the instructions in the white paper, I encountered the following problems:
The getExchangeRates method contains a try-catch block that swallows all exceptions silently, including the exceptions from the following problems.
The getExchangeRates method contains a hidden* TODO to replace part of a commented code line with the API key that you receive when you register with Oanda (see chapter "Before you begin" in the white paper or OANDA Exchange Rates API). After replacing the part with your API key, the line must be un-commented, of course.
For the rateEnumerator variable in the getExchangeRates method, no moveNext() is made, which causes the subsequent current() call to fail.
In the last if statement in method readRate, exchangeRate should be replaced with exchangeDate.
After resolving these issues and doing an incremental CIL compilation, I was able to import exchange rates.
Regarding debugging: the code of the new exchange rate provider is run in CIL, so you need Visual Studio to debug the code (see Walkthrough: Using the Debug Properties When Debugging Managed Code (AX 2012)). You can also set a breakpoint in class SysOperationServiceController, method run and then force the code to execute not in CIL using the "Set Next Statement" function in the debugger to execute the this.runOperation(false); statement.
*hidden because it does not appear as a task in the compiler window
I have a scheduled task set up to run Scan.aspx every 3 minutes in IE7. Scan.aspx reads data from 10 files in sequence. These files are constantly being updated. The values from the file are inserted into a database.
Sporadically, the value being read is truncated or distorted. For example, if the value in the file was "Hello World", random entries such as "Hello W", "Hel", etc. will be in the database. The timestamps on these entries appear completely random. Sometimes at 1:00 am, sometimes at 3:30 am. And some nights, this doesn't occur at all.
I'm unable to reproduce this issue when I debug the code. So I know under "normal" circumstances, the code executes correctly.
UPDATE:
Here is the aspx codebehind (in Page_Load) to read a text file (this is called for each of the 10 text files):
Dim filename As String = location
If File.Exists(filename) Then
Using MyParser As New FileIO.TextFieldParser(filename)
MyParser.TextFieldType = FileIO.FieldType.Delimited
MyParser.SetDelimiters("~")
Dim currentrow As String()
Dim valueA, valueB As String
While Not MyParser.EndOfData
Try
currentrow = MyParser.ReadFields()
valueA= currentrow(0).ToUpper
valueB = currentrow(1).ToUpper
//insert values as record into DB if does not exist already
Catch ex As Exception
End Try
End While
End Using
End If
Any ideas why this might cause issues when running multiple times throughout the day (via scheduled task)?
First implement a Logger such as Log4Net in your ASP.NET solution and Log method entry and exit points in your Scan.aspx as well as your method for updating the DB. There is a chance this may provide some hint of what is going on. You should also check the System Event Log to see if any other event is associated with your failed DB entries.
ASP.NET is not the best thing for this scenario especially when paired with a Windows scheduled task; this is not a robust design. A more robust system would run on a timer inside a Windows-Service-Application. Your code for reading the files and updating to the DB could be ported across. If you have access to the server and can install a Windows Service, make sure you also add Logging to the Windows Service too!
Make sure you read the How to Debug below
Windows Service Applications intro on MSDN: has further links to:
How to: Create Windows Services
How to: Install and Uninstall Services
How to: Start Services
How to: Debug Windows Service Applications]
Walkthrough: Creating a Windows Service
Application in the Component Designer
How to: Add Installers to Your Service Application
Regarding your follow up comment about the apparent random entries that sometimes occur at 1am and 3.30am: you should:
Investigate the IIS Log for the site when these occur and find out what hit(visited) the page at that time.
Check if there is an indexing service on the server which is visiting your aspx page.
Check if Anti-Virus software is installed and ascertain if this is visiting your aspx page or impacting the Asp.Net cache; this can cause compilation issues such as file-locks on the aspnet page in the aspnet cache; (a scenario for aspnet websites as opposed to aspnet web applications) which could give weird behavior.
Find out if the truncated entries coincide with the time that the files are updated: cross reference your db entries timestamp or logger timestamp with the time the files are updated.
Update your logger to log the entire contents of the file being read to verify you've not got a 'junk-in > junk-out' scenario. Be careful with diskspace on the server by running this for one night.
Find out when the App-Pool that your web app runs under is recycled and cross reference this with the time of your truncated entries; you can do this with web.config only via ASP.NET Health Monitoring.
Your code is written with a 'try catch' that will bury errors. If you are not going to do something useful with your caught error then do not catch it. Handle your edge cases in code, not a try catch.
See this try-catch question on this site.