Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all 175888 articles
Browse latest View live

Calling AX class via a visual studio console app by calling .Net Business Connector through it

$
0
0

Hi All,

I have created a class in AX. Then have created a .Net Business Connector .

Actually the requirement is to create Sales Quotation report in PDF format and to save it in a share drive. For this I have created a class in AX .  When I call the class through the .Net Business Connector it is perfectly creating the report in PDF format and saving it in the share drive as required.  Then I have created a visual studio console app and calling the .Net Business Connector from it which will be calling the AX class , Now the problem is it is creating the report in the share drive but with just 1kb , I mean it contains no data in it when tried to open getting error as it not a valid PDF file.

Please let me know why it is working correctly when I am calling the AX class via .Net Business Connector directly and why it is not working when the same AX class is called via a Console app.

Please find my Below Codes:

(1) Visual Studio Console App Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Dynamics.BusinessConnectorNet;

namespace GenerateQuote
{

   public class Program
    {

        static void Main(string[] args)
        {
            Program p = new Program();
            p.NonStaticMethod();

            //objGenQuote.sUserName = username;
            //objGenQuote.sPassword = password;
            //objGenQuote.sID = quotation;
        }
            public void NonStaticMethod()
            {
                string sUserName, sRes, sID;
            bool b;
            Console.WriteLine("Enter User Name :");
            string username = Console.ReadLine();
            Console.WriteLine("Enter Password :");
            string password = Console.ReadLine();
            Console.WriteLine("Pass the Quotation No :");
            string quotation = Console.ReadLine();

                SalesQuotation objGenQuote = new SalesQuotation();
                if(objGenQuote != null)
                {
                var path = objGenQuote.connect(username,password,quotation);
                     Console.WriteLine("Quote PDF Generated Successfully at :" + path);
                Console.ReadLine();
                }
            }



           /* //Console.ReadLine();
            CreateQuotationPDF objGenQuote = new CreateQuotationPDF();
            //objGenQuote.sUserName = username;
            //objGenQuote.sPassWord = password;
            //objGenQuote.sID = quotation;
            objGenQuote.Logon(username, password, quotation);
            string path = objGenQuote.Logon(username, password,quotation);
            //var path = objGenQuote.connect(quotation); */

        }
    }


(2) .Net Business Connector Code:

using System;
//using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
//using System.Drawing;
//using System.Threading.Tasks;
using Microsoft.Dynamics.BusinessConnectorNet;

namespace GenerateQuote
{

 public  class SalesQuotation
    {
        // public string sUserName;

        //System.Net.NetworkCredential nc = new System.Net.NetworkCredential("karya-jovishp", "Pioneer1");
        //System.Net.NetworkCredential nc = new System.Net.NetworkCredential("sa-grb13", "S3viceMet1mbeRs");

       static string sRes;

        // Pass Quotation Id to sID
       // public static string sID;//= "QT-00167631";

        //string strUserName = "karya-jovishp";
        static string strUserName;//= "sa-grb13";
        public string sAxConfig;
       // public static  string sUserName;
       // public static string sPassword;
        public string sObjSer;

       public string connect(string sUserName,string sPassword,string sID)
        {
            System.Net.NetworkCredential nc = new System.Net.NetworkCredential(sUserName, sPassword);
            Axapta ax;

            //strUserName = "karya-jovishp";
            strUserName = sUserName;//"sa-grb13";
            ax = new Axapta();
            bool b;
            try
            {
                // Login to Microsoft Dynamics Ax.
                ax = new Axapta();


                ax.LogonAs(strUserName.Trim(), "", nc, "", "", "", "");

            }
            catch (Exception e)
            {
                Console.WriteLine("Exception Caught :" + e);
            }

            // Logon was successful.
            try
            {
                // Call a static class method.

                sRes = ax.CallStaticClassMethod("pmf_GenerateQuotationRpt", "callBusinessLogic", sID).ToString();

            }
            catch (Exception e)
            {

                Console.WriteLine("Exception Caught :" + e);
                b = ax.Logoff();

            }

            // Display the returned string.

            return sRes;

            // Log off from Microsoft Dynamics AX.
            b = ax.Logoff();

        }
    }


    }



Please let me know what m I doing wrong here.

Regards,

Mania


positive pay file AX 2012 R3 CU8

$
0
0

Hi,

I would like to know where and how can I change the Check issued value from "I" to "O" in the positive pay file generated in AX 2012 R3 CU8.

Thanks,

Sreeni

Vendor transaction report

$
0
0

Why when you run the vendor transaction report and you click on the hyper-link for some of the transactions such as AP payment vouchers and AP vendor invoices it will bring up a search criteria on one set and then voucher transaction form on the others. AP > reports > Transactions > Vendor > Vendor transaction.

RE: Block super() call of Menu item button

$
0
0

Sorry I'm not getting any error..I'm just throwing error to stop the execution..

RE: Block super() call of Menu item button

$
0
0

did you try above mentioned suggestion . you are not getting value in control variable , that's why always error is popping up.

Block super() call of Menu item button

$
0
0

Hi Axperts,

Can you tell me how to block super() call of menu item button in AX 7 using extensions..?

I have tried with the event handler method of 'On Clicked' event..But no luck..

Please tell me possible suggestions...

RE: Vendor transaction report

$
0
0

Hi Brian,

Can you rephrase your question? It is unclear to me what you are trying to ask.

RE: Settle open transaction X++ code not working in Service class (IL)

$
0
0

Hi Mohamed,

Can you elaborate? What do you mean with 'Service class'? Have you checked if all code is running on the same tier? e.g. all on client or all on server?


RE: Three way matching with additional charges

$
0
0

If you are using miscellaneous charges for registering those costs, you have to add them on the PO first. You can also use service items or purchase categories; then you can add the charges as service item or category directly on the invoice as additional line.

RE: AP Invoice Balance - Reverse a reversal

$
0
0

Hi Mohsin,

Can you check if there are more vendor transactions for this vendor? Have you also tried to look at the settlement history if the invoice and the reversal were settled with the same or probably another voucher?

RE: Debugger problem in D365

$
0
0

Hi Johnny,

You should setup a startup object on a visual studio project. Then start this object from within visual studio. Can you verify if you are following this procedure?

RE: "Label '%1' does not exist in the resx file." Error in SSRS deployment in AX D365

$
0
0

can you try by restarting SSRS service ?

"Label '%1' does not exist in the resx file." Error in SSRS deployment in AX D365

$
0
0

Hi all,

I have created new report and label file(e.g. ABC) I want to use labels created under this custom label file 'ABC' in my report design to display header.

When I am using labels in design I am getting below error -

"Label '%1' does not exist in the resx file."

Kindly help on this.

Thanks in advance.

RE: AP Invoice Balance - Reverse a reversal

$
0
0

Hi Andre,

There are other transactions for the vendor but they are all settled and there are no transactions in the Settlement.

Please see the following screen shot.

Also, I've tested reversing the last transaction on the screenshot for Production and it reverses the balance and the vendor balance is Zero. The question stands, what and why this happened, the user is unable to recall the steps. Our Admin is working on getting the reports up and running in test so I can verify if aging matches Trial balance. I will confirm.

Thanks,

Mohsin Kamal

RE: Vendor transaction report

$
0
0

When I run that report and click the hyper-links for some of the links there is a search box that opens and for others it just opens up the voucher transactions list


Pallet use after packing (containerization)

$
0
0

Hi,

We are searching ways for repackaging containers into pallets after packing screen. This needs to be manual process, rather than a planned packing structure. I have tested the scenario using "Pack to nested license plates", but  I received the "Cannot pack from parent license plate... A packing structure has not been created for the license plate" error message.

Any idea/link describing how to hand manually putting containers into pallets after packing before shipment?

Thanks 

RE: how to delete transaction data ?

$
0
0

What are you trying to achieve? With the relational databasse structure, the related tables and transactions the requirement here is huge, but I see no real reason you would want to do this - can you explain more because the solution would be to look at each transactional table individually, analyse the date relation, decide what you want and write scripts for each table - I am sure there are rules you could make on related tables but it really is not that simple, look at Fixed Assets, GL balances, Costing, Production over periods, Projects over period, sales orders processed from initial transaction of entry through to payment and the same for purchase requisition through purchase order, receipt, invoice and payment across a period. I have not even mentioned elements like advanced warehousing, the list goes on.

RE: Workflow completed with status pending in ax 2009

$
0
0

Hi Chaianan,

The workflow batch is showing errors as it cannot find something. Try to get this error fixed. Then the workflow can continue. A user approved a work-item, but due to the batch error, the workflow instance itself cannot be processed to really completed or probably other steps in the configuration.

There might be some data manipulated manually as there are tasks or workflow configurations which cannot be found anymore. We don't know what happened in your environment.

Workflow completed with status pending in ax 2009

$
0
0

Workflow completed with status pending how to resume

Batch job running with error 

RE: French labels in report not working

$
0
0

Hi Ludwig,

I still have the issue with my report, the French words doesn't show up for my report (still prints in English).

Viewing all 175888 articles
Browse latest View live


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