Options

what following code means?

mdsrmdsr Member Posts: 163
CASE CountryRegionCode OF
'',"Country/Region Code":
EXIT("Country/Region Code");
ELSE
EXIT(CountryRegionCode);
END;

Best Answer

Answers

  • Options
    mdsrmdsr Member Posts: 163
    edited 2019-05-16
    thanks sir,but what EXIT does here and what it mean?
    also can you explain what setrange actually deoes in following code
    SalesHeader."Document Type" := SalesHeader."Document Type"::"Credit Memo";
    SalesHeader.SETRANGE("Sell-to Customer No.","No.");
    SalesHeader.INSERT(TRUE);
    COMMIT;
    PAGE.RUNMODAL(PAGE::"Mini Sales Credit Memo",SalesHeader)
  • Options
    Jan87Jan87 Member Posts: 26
  • Options
    Jan87Jan87 Member Posts: 26
    @Duikmeester

    isn't the first code something like
    IF CountryRegionCode IN ['',"Country/Region Code"] THEN
      EXIT("Country/Region Code")
    ELSE
      EXIT(CountryRegionCode);
    

    @mdsr please use the code-tag to post code
  • Options
    mdsrmdsr Member Posts: 163
    thanks Jan87
  • Options
    DuikmeesterDuikmeester Member Posts: 304
    @Jan87 if you convert it exactly. But functionally my code is the same but simpler. With your code if the variable EQUALS the field return the field else the variable. Means both are the same so it does not mather returning the one or the other.
  • Options
    Jan87Jan87 Member Posts: 26
    @Duikmeester you are right, i missed that :)
Sign In or Register to comment.