Prevent adding serialized items ro SO lines  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Prevent adding serialized items ro SO lines

Postby Riyaz » Wed Dec 02, 2020 12:32 am

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.
Attachments
Plugin Inventory Serial plugin.xml
(36.48 KiB) Downloaded 430 times
Riyaz
Kohai
Kohai
 
Posts: 254
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Prevent adding serialized items ro SO lines

Postby Scott.Pearce » Wed Dec 02, 2020 10:10 am

Need custom stored proc "usp_GetSOHComments"
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Prevent adding serialized items ro SO lines

Postby Riyaz » Wed Dec 02, 2020 3:00 pm

Hi Scott

Pls find it attached
Attachments
usp_GetSOHComments.sql
(339 Bytes) Downloaded 719 times
Riyaz
Kohai
Kohai
 
Posts: 254
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

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

Postby Scott.Pearce » Wed Dec 02, 2020 3:48 pm

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.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Prevent adding serialized items ro SO lines

Postby Mike.Sheen » Wed Dec 02, 2020 3:58 pm

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Prevent adding serialized items ro SO lines

Postby Riyaz » Mon Dec 07, 2020 8:29 pm

Thanks Mike and Scott
Riyaz
Kohai
Kohai
 
Posts: 254
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 1 guest