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)
@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.
Answers
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)
hier you can find information about c/al (here are the ones that could help you):
https://docs.microsoft.com/en-us/dynamics-nav/setrange-function--record-
https://docs.microsoft.com/en-us/dynamics-nav/c-al-repetitive-statements#exit-statement
isn't the first code something like
@mdsr please use the code-tag to post code