Page 1 of 1

Prevent adding serialized items ro SO lines

PostPosted: Wed Dec 02, 2020 12:32 am
by Riyaz
Hi There

We need to prevent adding serialized items to sales orders if it doesnt satisfy a condition, that all works well, except that it still allows the items to be added. Have tried throwing the exception too, but doesn't work.

Have attached the plugin, can you pls kindly check and advise.

Re: Prevent adding serialized items ro SO lines

PostPosted: Wed Dec 02, 2020 10:10 am
by Scott.Pearce
Need custom stored proc "usp_GetSOHComments"

Re: Prevent adding serialized items ro SO lines

PostPosted: Wed Dec 02, 2020 3:00 pm
by Riyaz
Hi Scott

Pls find it attached

Re: Prevent adding serialized items ro SO lines  Topic is solved

PostPosted: Wed Dec 02, 2020 3:48 pm
by Scott.Pearce
It's actually a bit tricky because the line is added, THEN serials are asked for. I can cancel my way out of the serial dialog by adding the line:

Code: Select all
serialDialog.DialogResult = System.Windows.Forms.DialogResult.Cancel;


Just before your exception throw line:

Code: Select all
throw new JiwaFinancials.Jiwa.JiwaApplication.Exceptions.ClientCancelledException();


Here is the modified plugin:



HOWEVER this has the affect of keeping the line, but putting the quantity on back order. Because remember, we have already added the line, it is the setting of the Quantity Ordered which triggers the serial selection dialog to display.

I think a better approach might be to LOCK the "Unit Quantity" cell on the serial dialog for rows which are not allowed to be selected. If you need to explain to the user why the cell is locked, use an error provider on the cell. Let me know if you need help doing this.

Re: Prevent adding serialized items ro SO lines

PostPosted: Wed Dec 02, 2020 3:58 pm
by Mike.Sheen
Riyaz wrote:Hi Scott

Pls find it attached


That's going to cause you problems if you have the same serial number of an item multiple times - I think you should just accept the LinkID as a parameter and use that.

Re: Prevent adding serialized items ro SO lines

PostPosted: Mon Dec 07, 2020 8:29 pm
by Riyaz
Thanks Mike and Scott