on 03-23-2010 1:25 PM
Hi Experts,
I would like to insert some code into the SP so that there is no mismatch between the first letter of the card code and the BP Type. Such that if they try to add the CardCode of c1001 to a vendor type, that a message appears stating that there is a mismatch.
thx,
Richard
Try this:
if @object_type = '2' and @transaction_type='A'
BEGIN
if exists
(Select p.CardCode from ocrd p
where p.CardCode=@list_of_cols_val_tab_del
and substring(p.CardCode,1,1) !=
case when p.CardType='S' then 'S'
else 'C' end )
begin
set @error =1
set @error_message = 'Partner code should begin with C or S !'
end
End
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Excellent post, tweeked it a bit and works great,
I have another validation that has to be performed. The client has different sequences of ItemCode, the first three digits are the same number that are entered at the begining of the ItmsGrpNam. I would like to have another SP that make sure that they both match.
thx
Richard
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.