//TRResKostplaatsToObj #Define cKostPlaats ##class(Prod.GAMeta.BT.KostPlaats) #Include %occInclude New Status Set Status=$$$cKostPlaats.%DeleteExtent() If $$$ISOK(Status) Do . w "Delete all success.",! Else Do . w "Delete all error: "_$$ParseStatus^vhLib(Status)_".",! New IDLoop,Obj,Rec Set IDLoop="" For Set IDLoop=$O(^RES("PRBS","PI","KOSTPLAATS","D",IDLoop)) Quit:(IDLoop="") Do . Set Obj=$$$cKostPlaats.%New() . // D-NODE . Set Rec=^RES("PRBS","PI","KOSTPLAATS","D",IDLoop) . Set Obj.ItemID=IDLoop . Set Obj.VolgNr=$P(Rec,"`",1) . Set Obj.Omschrijving=$P(Rec,"`",2) . Set Obj.BasisKost=$P(Rec,"`",3) . Set Obj.ToeslagGrootVerlet=$P(Rec,"`",4) . Set Obj.ToeslagKleinVerlet=$P(Rec,"`",5) . Set Obj.Groep=$P(Rec,"`",6) . // S-NODE . If $D(^RES("PRBS","PI","KOSTPLAATS","S",IDLoop)) Do .. Set Rec=^RES("PRBS","PI","KOSTPLAATS","S",IDLoop) .. Set Obj.BasisKostSchaduw=$P(Rec,"`",3) .. Set:(Obj.BasisKostSchaduw=Obj.BasisKost) Obj.BasisKostSchaduw="" .. Set Obj.ToeslagGrootVerletSchaduw=$P(Rec,"`",4) .. Set:(Obj.ToeslagGrootVerletSchaduw=Obj.ToeslagGrootVerlet) Obj.ToeslagGrootVerletSchaduw="" .. Set Obj.ToeslagKleinVerletSchaduw=$P(Rec,"`",5) .. Set:(Obj.ToeslagKleinVerletSchaduw=Obj.ToeslagKleinVerlet) Obj.ToeslagKleinVerletSchaduw="" . //Save! . Set Status=Obj.%Save() . If $$$ISOK(Status) Do .. w "Save ok: "_IDLoop,! . Else Do .. w "Save error: "_IDLoop_", "_$$ParseStatus^vhLib(Status),! Quit