Make code to press OK button ?

LBinDENMARKLBinDENMARK Member Posts: 33
Even if i set ship and invoice to true, i have to press the OK button, is it possible to do this by code ?
"Sales Header".Ship := TRUE ;
"Sales Header".Invoice := TRUE ;
IF UdskrivFaktura = 2 THEN BEGIN
CODEUNIT.RUN(CODEUNIT::"Sales-Post + Print","Sales Header") ;
END ;

Regards

Answers

  • krikikriki Member, Moderator Posts: 9,118
    Try this:
    Global variable cduSalesPostPrint Codeunit "Sales-Post + Print":
    "Sales Header".Ship := TRUE ;
    "Sales Header".Invoice := TRUE ;
    IF UdskrivFaktura = 2 THEN BEGIN
      CODEUNIT.RUN(CODEUNIT::"Sales-Post","Sales Header") ;
      cduSalesPostPrint.GetReport("Sales Header");
    END;
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • LBinDENMARKLBinDENMARK Member Posts: 33
    kriki wrote:
    Try this:
    Global variable cduSalesPostPrint Codeunit "Sales-Post + Print":
    "Sales Header".Ship := TRUE ;
    "Sales Header".Invoice := TRUE ;
    IF UdskrivFaktura = 2 THEN BEGIN
      CODEUNIT.RUN(CODEUNIT::"Sales-Post","Sales Header") ;
      cduSalesPostPrint.GetReport("Sales Header");
    END;
    

    GetReport := Sales Haeder missing !
    Run := Still have to press OK button ](*,)
  • krikikriki Member, Moderator Posts: 9,118
    GetReport := Sales Haeder missing !
    Check out where the error is put. And put this part of the code on the forum so I can check.

    Run := Still have to press OK button ]
    Are you sure you use codeunit 80 and not codeunit 81? 81 let's you press the OK-button, 80 should let you post without confirmation (if you don't have some customiziation in it).
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • LBinDENMARKLBinDENMARK Member Posts: 33
    Run := Still have to press OK button ]
    Are you sure you use codeunit 80 and not codeunit 81? 81 let's you press the OK-button, 80 should let you post without confirmation (if you don't have some customiziation in it).[/quote]

    I use codeunit 81, but now i skip the confirmation in the codeunit and i'ts working
  • krikikriki Member, Moderator Posts: 9,118
    Run := Still have to press OK button ]
    Are you sure you use codeunit 80 and not codeunit 81? 81 let's you press the OK-button, 80 should let you post without confirmation (if you don't have some customiziation in it).

    I use codeunit 81, but now i skip the confirmation in the codeunit and i'ts working[/quote]
    You can better use codeunit 80.
    Codeunit 81 is for asking confirmation and then it just calls codeunit 80.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.