eric.dizon
22nd August 2014, 22:51
I have session that I have attached in this thread that does a mass update of Lot number information against a table I have created as well.
I am currently validating if the Lot number exists in inventory or not through DAL of the table. But when I do that it throws out DALHOOKERROR and voids all the entry. What is the best way to allow the user to save lines that are valid and discard lines that are not and report an error against it?
case DAL_UPDATE:
|db.set.to.default(tcxcsb010)
if cxcsb010.stat = cxctl.status.ctl.outbound then
dal.set.error.message("@" & cxcsb010.orno & " Line : " & str$(cxcsb010.pono) & " is already Outbounded.")
abort.transaction()
return(DALHOOKERROR)
endif
if not isspace(cxcsb010.wono) and not isspace(cxcsb010.mser) and cxcsb010.mtmk > 0 then
|Validate if Lot number exists in Inventory
if not isspace(cxcsb010.mser) then
select count(whltc100.orno):l.ctr
from whltc100
where whltc100._index1 = {:cxcsb010.item, :cxcsb010.mser}
selectdo
endselect
if l.ctr = 0 then
dal.set.error.message("@" & cxcsb010.mser & "not found on valid Lot Number list...")
return(DALHOOKERROR)
endif
I am currently validating if the Lot number exists in inventory or not through DAL of the table. But when I do that it throws out DALHOOKERROR and voids all the entry. What is the best way to allow the user to save lines that are valid and discard lines that are not and report an error against it?
case DAL_UPDATE:
|db.set.to.default(tcxcsb010)
if cxcsb010.stat = cxctl.status.ctl.outbound then
dal.set.error.message("@" & cxcsb010.orno & " Line : " & str$(cxcsb010.pono) & " is already Outbounded.")
abort.transaction()
return(DALHOOKERROR)
endif
if not isspace(cxcsb010.wono) and not isspace(cxcsb010.mser) and cxcsb010.mtmk > 0 then
|Validate if Lot number exists in Inventory
if not isspace(cxcsb010.mser) then
select count(whltc100.orno):l.ctr
from whltc100
where whltc100._index1 = {:cxcsb010.item, :cxcsb010.mser}
selectdo
endselect
if l.ctr = 0 then
dal.set.error.message("@" & cxcsb010.mser & "not found on valid Lot Number list...")
return(DALHOOKERROR)
endif