what following code means?

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

Best Answer

Answers

  • mdsrmdsr Posts: 29Member
    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)
  • Jan87Jan87 Posts: 24Member
    @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
  • mdsrmdsr Posts: 29Member
    thanks Jan87
  • DuikmeesterDuikmeester Hoorn, The NetherlandsPosts: 266Member
    @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.
  • Jan87Jan87 Posts: 24Member
    @Duikmeester you are right, i missed that :)
Sign In or Register to comment.