We have added two custom fields on RMA Line
form in Syteline(9.00.03) ERP
.
The first field is Reason Type
and the Second is Return Reason
. We have five different custom tables for Return Reason
.
When we select a Reason Type
, based on Reason Type
data will populate in the Return Reason
drop-down list from a different table.
Data can come directly from a table or the joining of two tables.
We should write a Stored procedure having one input parameter called Reason Type.
CREATE PROC GetReturnReason ( @ReturnType NVARCHAR(10) -- Value can be A,B,C,D,E )
AS
IF @ReturnType = 'A'
ELSE IF @ReturnType = 'B'
ELSE IF @ReturnType = 'C'
ELSE IF @ReturnType = 'D'
SELECT T1.ReturnReason AS ReturnReason FROM Table1 T1 INNER JOIN TABLE2 T2 ON T1.item = T2.item
ELSE IF @ReturnType = 'E'