Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Like to disabled original preview button

(0) ShareShare
ReportReport
Posted on by

Hi team,

As per the client requirement,  in AR - Invoice Journal - Document - Original Preview. 

If suppose , user select one Invoice I'd and click on Original preview. After generating the report the option should be disabled becuse user dont want to print the original invoice multiple times. That I have done.

If the Original preview button is disabled from Invoice Journal simentaneously from Voucher - Voucher Trandaction - original document - Print preview also should be disabled as well as from Customer transactions also. 

So, that user not able to print the Original print preview from other form.

Kindly let me know how we can disable the original preview option from Vouchet a d customer transaction. 

Pls give me more shed on this 

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Like to disabled original preview button

    Hi @rp@n, May I know how you are disabling Print button or Original Document in Invoice journal form.

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 on at
    RE: Like to disabled original preview button

    I assume you make have added some condition for Form A to disable that menuitem once report is generated.

    Now in Form B or Form C we have datasource. So create a new field in that datasource. As you said that if report is generated then menuitem should be disabled in Form B and C. So, I assume there is some common field between them.

    Lets assume report is generated so Form A menuitem is disabled.

    Now you already added NoYes in B right. Thing is if you update it to Yes, your menuitem in Form B will be disbled as you already have written a code in Form B active (lets assume). That means you are left with updating the Noyes to yes right?

    So write the update code in the FormDs class extenstion in a new method and call this method in the active method of form A.

    Then, first report will be generated > your form A menuitem is disabled as we have active method code > active calls new method for update > if Noyes is yes you will have active method again in form B > This active makes the menuitem disable.

    Same for form c.

  • @rp@n Profile Picture
    @rp@n on at
    RE: Like to disabled original preview button

    Thanks Baharani,

    Little bit not understood.

    Yes, in form A, active method I already wrote code to disable the button Original preview for Form A.

    Now, Form B and Form C are separate form then how I will call those buttons Original preview in Form A active method?

    If possible,  kindly send me the code pls

    Pls give me more shed on this

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 on at
    RE: Like to disabled original preview button

    That is why I said to create a new field. If you create new field in that ds, then

    Presently you are able to disable in A form. So at that condition where you are disabling this original in A form, just call the update logic for that field so that it will change to Yes right?

    You will have already a code if noyes field is yes then disable this menu item in your active method. That's it.

  • @rp@n Profile Picture
    @rp@n on at
    RE: Like to disabled original preview button

    Thanks Baharani

    I am little bit confused

    Let's assume Form A, Form B and Form C

    If suppose user open form A and click on Original preview , after generating the report the button get disabled. This is happened now.

    In the same time how I will disabled original preview button from From B and Form C?

    Is it possible to do?

    Pls give me more shed on this

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 on at
    RE: Like to disabled original preview button

    Hi, you can try the same approach how you did for the invoice level also. Otherwise you can try this.

    Create a new field in that table like NoYes and update that record once report is generated. Like once report is generated for invoice, means we will have a controller right. So write coc after next to update this noyes to yes and if it is yes then in the active method of this ds you can disable the original menu item.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,031 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,868 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans