Sales - Post (Yes /No)

dimitrisdimitris Member Posts: 17
Hallo,
I have a couple of small problems.
When a user posts an invoice (Shift + F11), a dialog window appears asking for Yes / No , and the default value is "No" . How I can I change this value to yes (to make a dummy's user life less complicated :D ) ?

The second question is : I have added a command button. How can I associate this button with a F key (e.g F11) without having to create a menu item?

Thanks in advance!

Comments

  • DenSterDenSter Member Posts: 8,305
    Question 1:
    Find the following code in the "Post yes/no" codeunit
            IF NOT
               CONFIRM(
                 Text001,FALSE,
                 "Document Type")
            THEN
              EXIT;
    
    Change FALSE to TRUE and you should be all set.

    Question 2:
    You can't. You can only associate a function key to a selection on a menu button. You could put a very small menu button on your form and hide it behind another control though, and program it to do the same thing as your command button.
  • dimitrisdimitris Member Posts: 17
    Thanks A lot. Nice workaround!
  • DenSterDenSter Member Posts: 8,305
    That's not a workaround, that is a solution :mrgreen:
  • vanrofivanrofi Member Posts: 272
    And what if the code is like this (on item available check Codeunit 311):

    (function)SalesLineCheck(SalesLine : Record "Sales Line")
    IF CheckItemAvail.SalesLineShowWarning(SalesLine) THEN BEGIN
    OK := CheckItemAvail.RUNMODAL = ACTION::Yes;
    CLEAR(CheckItemAvail);
    IF NOT OK THEN
    ERROR(Text000);
    END;

    How can I then send a default yes to the Checkitemavail report?
  • BBlueBBlue Member Posts: 90
    Hello vanrofi,

    The default "No" in the Check Availability form is set in its OnOpenForm trigger. So if you want to default the highligthing of the "Yes" button just add a name for the "Yes" button and change the code to:
    CurrForm.YesButtonName.ACTIVATE;
    

    Regards
    //Bogdan
Sign In or Register to comment.