Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Receipt Printing for Suspended Transactions Through Default Receipt Printing Utility In POS Dynamics AX

Posted on by Microsoft Employee

I am working to customize a functionality for printing the receipt of suspended transactions. One option is to develop a new crystal report for receipt printing. But I am concerned with the default receipt that is already available in POS and its code is also available in POS SDK (printing, peripheral) . How can I use that receipt for printing the suspended transactions ?

any help will appreciate able.

Thanx in advance. 

fsrcpt.png

*This post is locked for comments

  • Oksana Kovaliova Profile Picture
    Oksana Kovaliova 3,595 on at
    RE: Receipt Printing for Suspended Transactions Through Default Receipt Printing Utility In POS Dynamics AX

    Hi Abdul,

    Your 'test' object is null - and you try to call GetSuspendedTransaction for NULL - it will cause exception

  • Abdul Manan Profile Picture
    Abdul Manan 120 on at
    RE: Receipt Printing for Suspended Transactions Through Default Receipt Printing Utility In POS Dynamics AX

    Hi Oksana Kovaliova ,

    I am trying to do same thing in suspend trigger but facing error of null reference in obj Transaction object ,can you check what is wrong in this code and also mention what should I pass in IRounding parameter ,currently I am passing null.

    Your quick response is highly appreciated .

    public void PostSuspendTransaction(IPosTransaction posTransaction)
    {
    LSRetailPosis.ApplicationLog.Log("SuspendTriggers.PostSuspendTransaction", "After the suspension of a transaction...", LSRetailPosis.LogTraceLevel.Trace);
    SuspendRetrieveData test =null;
    RetailTransaction obj;
    //SqlConnection conn =this.Application.Settings.Database.Connection;
    SqlConnection conn = new SqlConnection();
    conn.ConnectionString =
    "Data Source=DEVSRVR;" +
    "Initial Catalog=MTH01;" +
    "Integrated Security=SSPI;";

    obj = test.GetSuspendedTransaction(conn, posTransaction.TransactionId, null, posTransaction.StoreId, "PKR", true);
    }

  • Verified answer
    Oksana Kovaliova Profile Picture
    Oksana Kovaliova 3,595 on at
    RE: Receipt Printing for Suspended Transactions Through Default Receipt Printing Utility In POS Dynamics AX

    Hi Muhammad,

    1) You can use standard method GetSuspendedTransaction of class SuspendRetrieveData from POS DataAccess.dll to load suspended transaction data from database to RetailTransaction object.

    2) After this you can call Printing service PrintReceipt method with FormType = Receipt and Transaction = your RetailTransaction from p.1

    2 things to remember are:

    1) Receipt ID will be empty, because Receipt ID is populated right after transaction is closed (when full amount is paid)

    2) When you recall this transaction, its transaction ID will be changed by POS => transaction ID from your receipt will become invalid.

    Regards,

    Oksana

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,232 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,064 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans