pjohns
6th July 2010, 15:15
Hello,

I created a new layout in the purchase order print out that I only want printed when Delivery Country (tdpur042.ccty) = "ISR". I have put the code below into the report script.

before.orco.81:
before.layout:

pur.ccty = " "

select tdpur042.ccty
from tdpur042
where tdpur042.orno = :tdpur040.orno
selectdo
endselect

pur.ccty = tdpur042.ccty

if pur.ccty <> "ISR" then
lattr.print = false
endif


When I print a range of purchase orders everything is printed correctly until I reach my first PO that has a delivery country of "ISR" The first "ISR" PO will print the new layout correctly but then the next PO which does not have a delivery code of ISR also prints the new layout. It appears to be inhertiing the pur.ccty value from the previous PO. How do I stop this? I guess there is a simple way to reset the pur.ccty value each time but I'm just a novice when it comes to Baan development.

Thanks in advance.

PJ

manish_patel
6th July 2010, 15:30
Move below statement to selectdo part.
pur.ccty = tdpur042.ccty


Another option is to assign default value in selectempty part.
You can use db.set.to.default() to set the default values or simply assign like tdpur042.ccty=""

pjohns
6th July 2010, 15:58
Manish,

Thanks for your quick reply.

I moved the pur.ccty = tdpur042.ccty to the selectdo part and all was resolved.

Rgds

PJ