Making Items Inactive


J

jocelynp

v1.3

I would like to create a script that will turn store created items inactive,
however, I do not know the script numbers (if that is even proper
terminology...?) = inactive. Is there one?

I would like to do something to set all location's items to inactive where
the hqid = 0.
 
Ad

Advertisements

C

cod

jocelynp said:
v1.3

I would like to create a script that will turn store created items inactive,
however, I do not know the script numbers (if that is even proper
terminology...?) = inactive. Is there one?

I would like to do something to set all location's items to inactive where
the hqid = 0.
/* The field Inactive is disabled or Inactive?? */

UPDATE Item SET [FIELD] = 1 WHERE HQID = 0

and with trigger..

CREATE TRIGGER tr_Item ON ITEM AFTER INSERT, UPDATE
AS

UPDATE Item SET [FIELD] = 1 WHERE ID IN (SELECT ID FROM inserted)

cod
 
N

Nashat

cod,

your trigger will make all items inactive ever they were created in HQ, u
mist check the HQID in your trigger

cod said:
jocelynp said:
v1.3

I would like to create a script that will turn store created items
inactive, however, I do not know the script numbers (if that is even
proper terminology...?) = inactive. Is there one? I would like to do
something to set all location's items to inactive where the hqid = 0.
/* The field Inactive is disabled or Inactive?? */

UPDATE Item SET [FIELD] = 1 WHERE HQID = 0

and with trigger..

CREATE TRIGGER tr_Item ON ITEM AFTER INSERT, UPDATE
AS

UPDATE Item SET [FIELD] = 1 WHERE ID IN (SELECT ID FROM inserted)

cod
 
J

jocelynp

Nashat,
Can you clearly explain this to me? We need to issue a statement to make all
items that were created locally at the stores inactive. We will be pumping
them up with a new database from HQ. These locations got a little out of hand
and began creating their own items, now we need to bring them back to being
run solely from HQ. I get the SQL and the Ids, but; triggers, no idea.
--
Jocelyn


Nashat said:
cod,

your trigger will make all items inactive ever they were created in HQ, u
mist check the HQID in your trigger

cod said:
jocelynp said:
v1.3

I would like to create a script that will turn store created items
inactive, however, I do not know the script numbers (if that is even
proper terminology...?) = inactive. Is there one? I would like to do
something to set all location's items to inactive where the hqid = 0.
/* The field Inactive is disabled or Inactive?? */

UPDATE Item SET [FIELD] = 1 WHERE HQID = 0

and with trigger..

CREATE TRIGGER tr_Item ON ITEM AFTER INSERT, UPDATE
AS

UPDATE Item SET [FIELD] = 1 WHERE ID IN (SELECT ID FROM inserted)

cod
 
J

Jeff

Jocelyn,

You probably don't want to use the trigger, just run this in a 51 or manually;

UPDATE Item SET Inactive = 1, DoNotOrder = 1 WHERE HQID = 0

This will set ALL items that do not have an HQ ID number to Inactive and cannot be placed on a PO.

As always, BACKUP FIRST!!

Next, you should set security so that the stores cannot add items if you want to control this, otherwise keep this script handy! ;-)



Nashat,
Can you clearly explain this to me? We need to issue a statement to make all
items that were created locally at the stores inactive. We will be pumping
them up with a new database from HQ. These locations got a little out of hand
and began creating their own items, now we need to bring them back to being
run solely from HQ. I get the SQL and the Ids, but; triggers, no idea.
--
Jocelyn


Nashat said:
cod,

your trigger will make all items inactive ever they were created in HQ, u
mist check the HQID in your trigger

cod said:
jocelynp said:
v1.3

I would like to create a script that will turn store created items
inactive, however, I do not know the script numbers (if that is even
proper terminology...?) = inactive. Is there one? I would like to do
something to set all location's items to inactive where the hqid = 0.
/* The field Inactive is disabled or Inactive?? */

UPDATE Item SET [FIELD] = 1 WHERE HQID = 0

and with trigger..

CREATE TRIGGER tr_Item ON ITEM AFTER INSERT, UPDATE
AS

UPDATE Item SET [FIELD] = 1 WHERE ID IN (SELECT ID FROM inserted)

cod
 
N

Nashat

Completely agree with Jeff, much more better than using triggers is to block creating new items using security
Jocelyn,

You probably don't want to use the trigger, just run this in a 51 or manually;

UPDATE Item SET Inactive = 1, DoNotOrder = 1 WHERE HQID = 0

This will set ALL items that do not have an HQ ID number to Inactive and cannot be placed on a PO.

As always, BACKUP FIRST!!

Next, you should set security so that the stores cannot add items if you want to control this, otherwise keep this script handy! ;-)



Nashat,
Can you clearly explain this to me? We need to issue a statement to make all
items that were created locally at the stores inactive. We will be pumping
them up with a new database from HQ. These locations got a little out of hand
and began creating their own items, now we need to bring them back to being
run solely from HQ. I get the SQL and the Ids, but; triggers, no idea.
--
Jocelyn


Nashat said:
cod,

your trigger will make all items inactive ever they were created in HQ, u
mist check the HQID in your trigger

cod said:
jocelynp said:
v1.3

I would like to create a script that will turn store created items
inactive, however, I do not know the script numbers (if that is even
proper terminology...?) = inactive. Is there one? I would like to do
something to set all location's items to inactive where the hqid = 0.
/* The field Inactive is disabled or Inactive?? */

UPDATE Item SET [FIELD] = 1 WHERE HQID = 0

and with trigger..

CREATE TRIGGER tr_Item ON ITEM AFTER INSERT, UPDATE
AS

UPDATE Item SET [FIELD] = 1 WHERE ID IN (SELECT ID FROM inserted)

cod
 
Ad

Advertisements

J

jocelynp

Could not agree more with you guys here!!! Security is always the best
option. This is after all why I am here. To help my coworkers get this system
out of the mud.
--
Jocelyn


Jeff said:
Jocelyn,

You probably don't want to use the trigger, just run this in a 51 or manually;

UPDATE Item SET Inactive = 1, DoNotOrder = 1 WHERE HQID = 0

This will set ALL items that do not have an HQ ID number to Inactive and cannot be placed on a PO.

As always, BACKUP FIRST!!

Next, you should set security so that the stores cannot add items if you want to control this, otherwise keep this script handy! ;-)

--
*
Get Secure! - www.microsoft.com/security

You must be using Outlook Express or some other type of newsgroup reader to
see and download the file attachment. If you are not using a reader, follow
the link below to setup Outlook Express. Click on "Open with newsreader"
under the MS Retail Management System on the right.

http://tinyurl.com/75bgz

**********

Nashat,
Can you clearly explain this to me? We need to issue a statement to make all
items that were created locally at the stores inactive. We will be pumping
them up with a new database from HQ. These locations got a little out of hand
and began creating their own items, now we need to bring them back to being
run solely from HQ. I get the SQL and the Ids, but; triggers, no idea.
--
Jocelyn


Nashat said:
cod,

your trigger will make all items inactive ever they were created in HQ, u
mist check the HQID in your trigger

cod said:
jocelynp wrote:
v1.3

I would like to create a script that will turn store created items
inactive, however, I do not know the script numbers (if that is even
proper terminology...?) = inactive. Is there one? I would like to do
something to set all location's items to inactive where the hqid = 0.

/* The field Inactive is disabled or Inactive?? */

UPDATE Item SET [FIELD] = 1 WHERE HQID = 0

and with trigger..

CREATE TRIGGER tr_Item ON ITEM AFTER INSERT, UPDATE
AS

UPDATE Item SET [FIELD] = 1 WHERE ID IN (SELECT ID FROM inserted)

cod
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top