Hello,
I am new to Baan/ Infor LN extension development.
I try to create a price book entry like this:
Code:
error.found = dal.new.object("tdpcg031")
if error.found
then
dal.set.error.message("@Cannot update tdpcg031 for item %1$s.", i.item)
return(DALHOOKERROR)
else
dal.set.field("tdpcg031.prbk", pb)
dal.set.field("tdpcg031.item", i.item)
dal.set.field("tdpcg031.curn", cur)
dal.set.field("tdpcg031.qtun", cuni)
dal.set.field("tdpcg031.bapr", pr)
dal.set.field("tdpcg031.prty", tp)
dal.set.field("tdpcg031.migt", thres)
dal.set.field("tdpcg031.brty", tdpcg.brty.min)
dal.set.field("tdpcg031.prun", "pcs")
error.found = dal.save.object("tdpcg031")
if error.found then
dal.set.error.message("@Cannot update tdpcg031 for item %1$s.", i.item)
return(DALHOOKERROR)
endif
endif
When running this code dal.save.object raises an error:
The field "quantity unit" has an invalid value for "price book position".
Unit "pcs" in unit set "" not exisistant.
The standard unit set in our system is "100". The variable cuni hast the value "pcs".
I think I should tell the system that it must take the "pcs" of unit set "100".
What do you think? I just want to create a price book entry.
Thanks
Martin