Showing posts with label product. Show all posts
Showing posts with label product. Show all posts

Friday, March 23, 2012

Help with a Trigger.

from example a do this in Vb.
scColor.CommandText = "Update Product Set Color" & WColor.Trim & "=" &
WcolorValue & " Where Product='" & VarPubProduct & "'"
In a Trigger how can I know wich column is update Color01 or Color02 or
color03?
thanksUse the UPDATE() function [available in triggers]. This only lets you
know that the column indicated in the function was updated in at least
one row of the update. Then you'll need to compare the inserted and
deleted virtual tables to get the rows that were actually updated.
e.g.
IF UPDATE(Color01)
insert into LogTable (product, color01_old, color01_new)
select d.product, d.color01, i.color01
from deleted d
join inserted i on d.product = i.product
where d.color01 <> i.color01
Miguel Arenas wrote:
> from example a do this in Vb.
> scColor.CommandText = "Update Product Set Color" & WColor.Trim & "=" &
> WcolorValue & " Where Product='" & VarPubProduct & "'"
> In a Trigger how can I know wich column is update Color01 or Color02 or
> color03?
> thanks
>|||Thank you. This was very helpful.
"Trey Walpole" wrote:

> Use the UPDATE() function [available in triggers]. This only lets you
> know that the column indicated in the function was updated in at least
> one row of the update. Then you'll need to compare the inserted and
> deleted virtual tables to get the rows that were actually updated.
> e.g.
> IF UPDATE(Color01)
> insert into LogTable (product, color01_old, color01_new)
> select d.product, d.color01, i.color01
> from deleted d
> join inserted i on d.product = i.product
> where d.color01 <> i.color01
>
> Miguel Arenas wrote:
>

Sunday, February 26, 2012

Help suppress

I am trying to suppress some details, what I have is 3 columns 1st is order number, 2nd is product, 3rd stock status ie allocated/back ordered. It prints a line per product and the status. What I am trying to do is if the order has one line on back order then I want to suppress the whole order.

Thanks

RichardHi,
Can you post the expected result with some sample data?

Madhivanan|||What version on Crystal are you using? I use 8.5, so you may need to modify the following to work with your version.

You can use a conditional suppress. I will assume that you have each order appearing in the Details section. Go into the Format of the details section. Find where you can check to Suppress that section. You should see a button that looks like 'x-2'. Click the button and enter a formula. The Detail section will be supressed each time the formula evaluates to True.

Example, put this in the Formula box when you click 'x-2':
{StockStatus} = "BackOrdered"