Stop the dialog makeSupplierTheDefaultDialog  Topic is solved

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

Stop the dialog makeSupplierTheDefaultDialog

Postby DannyC » Thu Jun 04, 2026 3:13 pm

Purchase Orders when a line is added I want to stop the makeSupplierTheDefaultDialog from showing and default to No.

I've fiddled about with the attached plugin but the dialog still displays.

Can you give me a bit of assistance?

Cheers

v 7.2.1 SP20
Attachments
Plugin Attkey Purchase Orders stop Default Supplier msg.xml
(30.52 KiB) Downloaded 3 times
User avatar
DannyC
Senpai
Senpai
 
Posts: 733
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 32

Re: Stop the dialog makeSupplierTheDefaultDialog

Postby Mike.Sheen » Thu Jun 04, 2026 3:42 pm

DannyC wrote:Purchase Orders when a line is added I want to stop the makeSupplierTheDefaultDialog from showing and default to No.

I've fiddled about with the attached plugin but the dialog still displays.

Can you give me a bit of assistance?

Cheers

v 7.2.1 SP20


Just remove your throwing of the ClientCancelledException inside your Cancel_makeSupplierTheDefaultDialog method handler. You're setting the byref cancel parameter to true in there, and that's all you need to do. I did that, and the dialog does not appear.
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: 2591
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 817

Re: Stop the dialog makeSupplierTheDefaultDialog

Postby DannyC » Thu Jun 04, 2026 4:22 pm

Hmmm, not sure what I'm doing different but I still get the prompt but only the first time after a Jiwa restart.

remmed out the ClientCancelledException. Restarted Jiwa.

The behaviour is like this:
1. Restart Jiwa.
2. Create new purchase order
3. Add line
4. Get the prompt "This item has not been ordered from this supplier before". Click Yes to keep adding this line
5. Get the prompt "Do you want to set this supplier as the default supplier?"

Click No.
Cancel the purchase order. Jiwa reloads the old PO.
1. Create new purchase order
2. Add line
3. Get the prompt "This item has not been ordered from this supplier before". Click Yes to keep adding this line
4. Then the line is added without the "Do you want to set this supplier as the default supplier?"
User avatar
DannyC
Senpai
Senpai
 
Posts: 733
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 32

Re: Stop the dialog makeSupplierTheDefaultDialog  Topic is solved

Postby Mike.Sheen » Thu Jun 04, 2026 4:34 pm

That's on me - I wasn't paying close enough attention and when debugging I assumed the first part I added was already the default supplier - your plugin only starts working after one line has been added - from that point onwards it suppresses that dialog - but also I should have noticed this but you were adding a handler inside the Lines.Added handler and never removing it - so I'm pretty sure every time a line was added, another handler would be queued up so after adding 10 lines, the Cancel_makeSupplierTheDefaultDialog would be called 10 times repeatedly when a line is added, called 11 times when the 11 line is added and so on.

I've modified your plugin and changed it so it works all the time now - attached.
Attachments
Plugin Attkey Purchase Orders stop Default Supplier msg - 7..02.01.02.xml
(31.38 KiB) Downloaded 3 times
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: 2591
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 817

Re: Stop the dialog makeSupplierTheDefaultDialog

Postby DannyC » Thu Jun 04, 2026 5:01 pm

Making a forum post is my last resort.
Man, I was so close :)

Seems so simple now I've got a working plugin :oops:

Thanks for the speedy fix Mike.
User avatar
DannyC
Senpai
Senpai
 
Posts: 733
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 32


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 16 guests