Skip to Content
0

NEED TO BLOCK DOCUMENT GENERATION WIZARD WHEN

Feb 11, 2017 at 12:22 PM

82

avatar image

Dear Experts

Am using Document Generation Wizard to convert Delivery Note >> Ar Invoice

am having define Prefix as per my Branches

Supposes Branch A- Delivery Note is like this - DN-A (Base Document)

Branch A - AR invoice is like this - AR-A (Target Document)

if supposes my user selected different series for DN-A (Base Document) instead of

AR-A (Target Document) then it should be alerted and blocked from next step in wizard

how is it possible, is it possible via TP, if so pls provide me the TP

Regards

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Pradnya S Feb 11, 2017 at 12:28 PM
0

Hi,

You can assign the series login wise with the help of authorization group also in the numbering series set up.

Also you can not write SPTN on wizard. You can write it only at document level. After completing the wizard, the framed logic will validate the series before posting the document to the DB.

Regards

Pradnya

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Dear pradnya

Thanks for the Replay, could u pls provide me with the SPTN,

Regards

0
Pradnya S Feb 11, 2017 at 02:20 PM
0

Hi,

IF @object_type = '15' AND @transaction_type IN('A', 'U')

IF EXISTS(

SELECT t1.docentry FROM ODLN T1 INNER JOIN DLN1 T2

ON T1.DocEntry = T2.DocEntry WHERE @list_of_cols_val_tab_del = T1.DocEntry

AND (T1.Usersign = 10 or T1.UserSign2 = 10)

)

BEGIN

SET @error = -1

SET @error_message = 'You Cannot Add Goods Receipt PO without Purchase Order.'

END

Share
10 |10000 characters needed characters left characters exceeded
Pradnya S Feb 11, 2017 at 02:20 PM
0

Hi,

IF @object_type = '15' AND @transaction_type IN('A', 'U')

IF EXISTS(

SELECT t1.docentry FROM ODLN T1 INNER JOIN DLN1 T2

ON T1.DocEntry = T2.DocEntry WHERE @list_of_cols_val_tab_del = T1.DocEntry

AND (T1.Usersign = 10 or T1.UserSign2 = 10)

)

BEGIN

SET @error = -1

SET @error_message = 'You Cannot Add Goods Receipt PO without Purchase Order.'

END

Share
10 |10000 characters needed characters left characters exceeded
Pradnya S Feb 11, 2017 at 02:27 PM
0

Hi,

IF @object_type = '17' AND @transaction_type IN('A', 'U')

Begin

Declare @Series as Nvarchar(10)

select @Series = distinct t1.Series from nnm1 t1 inner join ORDR t2 on t1.series = t2.series

inner join rdr1 t3 on t2.docentry = t3.docentry where t2.docentry = @List_Of_Cols_Val_Tab_Del

And (T2.User = 10 or T2.UserSign2 = 10)

if @Series = 8

Begin

SET @error = -1

SET @error_message = 'Incorrect Document Series Chosen'

End

End

For sample, I have taken sales order. And assumed few things

User 10 is allowed to work only on series number 8. So this SPTN will fire when user 10 will try to add the sales order under any other series than 8.

Hope this will help you.

Regards

Pradnya

Share
10 |10000 characters needed characters left characters exceeded