Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Illegal recursion in rule evaluation
Message
From
03/01/2005 11:42:47
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
03/01/2005 11:28:05
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00973840
Message ID:
00973848
Views:
29
It seems that in a trigger on a specific table, you can't update that same table. If you need to do adjustments, you might transfer that to code on the manipulating form, for instance.

>HI,
>
>I've got a field rule on Items.iQtyOnHand:
>
>iqtyonhand=>0
>
>
>I've also got a trigger on SalesDetails:
>
>vmp_ri("INSERT").AND.adjustqtyonhand(iitemid,iqty*-1)
>
>
>My trigger procedure is:
>
>PROCEDURE AdjustQtyOnHand
>LPARAMETERS tiItemId, tiQty
>
>UPDATE Items;
>	SET iQtyOnHand = iQtyOnHand + m.tiQty ;
>	WHERE iItemId = m.tiItemId ;
>		AND cType # "Service"
>
>
>If I enter a sale of an item that results in a negative stock value, when running the exe in runtime, I get an error: "Illegal recursion in rule evaluation" (after I get my "Not enough stock available" MsgSvc message).
>
>The error is #1887 and the help suggests checking my rule and trigger code.
>
>Can anybody see what's wrong?
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform