Skip to main content

Notifications

Announcements

No record found.

Supply chain | Supply Chain Management, Commerce
Answered

Can not disable custom field in receipt layout when return String.Empty

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

HI all,

I have new custom fields in receipt, in request type: GetSalesTransactionCustomReceiptFieldServiceRequest, I return string.Empty but in real receipt, It have a row with data blank.

So how can I disable or remove row blank data return  string.Empty in receipt?

My code:
pastedimage1594784834727v1.png

My receipt bill:

pastedimage1594784969902v3.png

My receipt design:
pastedimage1594785071720v8.png


Thanks for help.

Nghia Song

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Can not disable custom field in receipt layout when return String.Empty

    Hi Ram,

    Thanks a lot for support. Same solution but In D365 Retail, I override request GetReceiptService and use GetReceiptServiceRequest. Then remove the blank row.

    And result:

          XXX Convenience Stores      

     Owned by: XXX Philippines Inc.  

                Pearl Drive              

     Unit 6 & 7, The Pearl Place Bldg.,  

     Pearl Drive cor. Gold Loop Ortigas  

    Center, Brgy. San Antonio, Pasig City

               1605 Pasig PHL            

    VAT Reg TIN: 008-789-736-012        

    Contact....: 8727-2480              

    -------------------------------------

      SALES INVOICE  

              (Customer  copy)          

    -------------------------------------

  • Verified answer
    Ramshenkar Profile Picture
    Ramshenkar on at
    RE: Can not disable custom field in receipt layout when return String.Empty

    Hi Nghia, 

    These empty space is because you have placed multiple custom fields on the receipt. It will take the space irrespective of data present or not.  There is no standard way available to remove this space during runtime.

    I will suggest below workaround if you can play with the report string data.

    - Override request "GetReceiptRequest" and  use "GetReceiptRequestHandler" populate default receipt string data.

    - Identify blank string in the receipt data something like '|1C|1C' and remove the blank string data as per your requirement. 

    Hope this will help you. 

    Regards, 

    Ram

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,253 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans