on 06-24-2010 11:25 AM
Hi,
I am trying to load a Ship address based using combined fields, ONLY if the customer isin a Select Group (in this case 106).
If not in the group I want the default shipping address to load.
My code is loading the new address OK but when the customer is not in group 106 the address is left BLANK. I want the original default ship address to load .
Could someome help on this point.
Version 8.8 Patch 11 SQL Server 2005.
Current Code
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Declare @OrigAdd as Varchar (508)
Declare @Group as int
Declare @PCode as int
---Load copy of original address
Select @OrigAdd = $[$92.0.0]
Set @PCode = 106
select @Group = (select OCRD.GroupCode from OCRD where OCRD.CardCode = $[$4.0.0])
SELECT CASE
WHEN @PCode = @Group
THEN
(Select 'Customer: 'RTRIM($[$54.0.0])char(13)'Deliver To: 'RTRIM($[ORDR.U_ProjName])char(13)RTRIM($[ORDR.U_ProjAdd])char(13)'Contact: 'RTRIM($[ORDR.U_ProjConName])char(13)'Contact Ph. :'RTRIM($[ORDR.U_ProjConPh])CHAR(13)'Delivery Date: '+RTRIM($[$12.0.0]))
WHEN NOT(@PCode = @Group)
THEN (Select @OrigAdd)
END
++++++++++++++
Kind Regards,
Eric
Hi Eric,
Just add to your CASE statement:
WHEN @Group <> 106
THEN ..... SELECT default ship-to-address......
Regards
Carin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Carin,
Thank you for the response.
When the group = 106 the new address is loading OK.
My problem is when the Group ISNOT = 106. I want the ship address normally loaded by the system.
In fact I'm not sure if the FMS triggers before the system first load the default address, if it does, I will need a new approach. That is I may need to load the standard address using the same script the system uses.
Any ideas.
Kind Regards,
Eric
User | Count |
---|---|
98 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
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.