Please help me... I have a problem with SERVER TRIGGERS and Store Procedure Example I have 2 tables as follows: 1. STOCK - StockCode - Name - Units - QTYStock 2. SELLING - StockCode - QTYSelling On Table SELLING with Server Trigger AFTER DELETE, I create procedure Stock.QtyStock = Stock.QtyStock + Selling.QtySelling HModify (STOCK) and it run ok and Stock.QtyStock result true On Table SELLING with Server Trigger AFTER ADD, I create procedure Stock.QtyStock = Stock.QtyStock - Selling.QtySelling HModify (STOCK) and it run ok and Stock.QtyStock result true On Table SELLING with Server Trigger BEFORE MODIFY, I create procedure Stock.QtyStock = Stock.QtyStock - Selling.QtySelling On Table SELLING with Server Trigger AFTER MODIFY, I create procedure Stock.QtyStock = Stock.QtyStock + Selling.QtySelling HModify (STOCK) but the result is wrong. example: Stock.QtyStock = 10 (beginning balance) Process Update/Modify) Selling.QtySelling = 5 (before being Modify) Selling.QtySelling = 8 (after being Modify)) should be Stock.QtyStock = 10 - 5 + 8 = 13, but the result is not correct Please help ..... thank you.
exemple de recuperation de valeur Code (Text): //creation d'un alias pour acceder aux valeurs de l'enregistrement avant modification SI PAS HAlias(occPiece,occPieceAvant) ALORS Erreur("Erreur à la création de l'alias occPièceAvant",HErreur()) FinProgramme() FIN //changement de nom physique pour que le nom logique de l'alias soit sur le fichier physique occPiece SI PAS HChangeNom(occPieceAvant,"occPiece") ALORS Erreur("Erreur au changement du nom de l'alias occPièceAvant",HErreur()) FinProgramme() FIN //lecture de la piece pour calcul du nombre de pieces terminees HLitRecherchePremier(occPieceAvant,"idoccpiece",OccPiece.IDoccPiece)