Want to Validate the Code on Sales Return Form on Function button at Copy Document menu
IF HideValidationDialog OR NOT GUIALLOWED THEN
Confirmed := TRUE
ELSE
Confirmed := CONFIRM('Is it Cancel Invoice ?',FALSE);
IF Confirmed = TRUE THEN BEGIN
"Cancel Invoice" := TRUE;
"Posting No. Series" := 'CINV SALE';
END;
IF Confirmed = FALSE THEN BEGIN
"Cancel Invoice" := FALSE;
END;
recently this code is working on Posting No Series field....
can someone help me out....?????
Thanks & Regards,
Stivan D'souza
0
Comments
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
if YES then Cancel Invoice field should be check marked and Posting No series should come as 'CINV SALE'.
IF NO then Cancel Invoice field should not be check marked.
Stivan D'souza
I understood your requirement..
Whaat do u mean by
and how can we help you?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
now they want to block it and do it on Copy Document of sales return order.
Stivan D'souza
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
IF TODAY <> "Applies to Document date" THEN
BEGIN
IF HideValidationDialog OR NOT GUIALLOWED THEN
Confirmed := TRUE
ELSE
Confirmed := CONFIRM('Is it Cancel Invoice ?',FALSE);
IF Confirmed = TRUE THEN
BEGIN
"Cancel Invoice" := TRUE;
MESSAGE('%1',"Cancel Invoice"); in Message its showing correct value but not showing at form level
"Posting No. Series" := 'CINV SALE';
MESSAGE('%1',"Posting No. Series"); in Message its showing correct value but not showing at form level
END;
END;
Stivan D'souza
IF Confirmed THEN
and
IF NOT Confirmed THEN
The hair in my neck raises everytime I see Booleans used otherwise.
Stivan D'souza
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
The above suggestion given by Duikmeester is not related to your problem..
Its regarding coding standards..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
for the information.....
Stivan D'souza
:thumbsup:
Some people just refuse to do it the Navision way.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Add to your code to
Remarks:- Your code is in a Menu Item. How do you get at it when GUIALLOWED = FALSE?
- What does this have to do with today's date? If that first condition makes any sense at all it most likely ought to be WORKDATE instead of TODAY.
- You should not hardcode code values. You should create a field in some setup table to hold the value of your Cancel Invoice No. Series and use that field instead.
- Earlier on you used the following
Do this only when you modify the condition in the first IF statement and need to consider that change in the second. Otherwise use
It's clearer, it's shorter, it's faster, it's safer.