Plugin to fire the Send To Freight System button  Topic is solved

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

Plugin to fire the Send To Freight System button

Postby DannyC » Wed Dec 15, 2021 10:55 am

I've got a plugin which populates the freight grid (the one in the Freight tab, not grdCartage) based on the items, weights, cubic etc.
As part of the plugin, I want it to automatically send the details to the freight system.

I've worked out how to change the status to Ready To Send but I can't work out if I can programmatically Send To Freight System.

How would I do this?
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Plugin to fire the Send To Freight System button

Postby Mike.Sheen » Wed Dec 15, 2021 2:41 pm

That button on the sales order form does nothing without a plugin handling the button click and then doing something with it.

We ship with a sample plugin, "IFS Smartfreight" which does that - it adds a handler for the SendToFreightSystemUltraButton.Click and in there it sends some information to the configured IFS SmartFreight web service.

Are you wanting to invoke the same code that this plugin executes when that button is clicked?
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: Plugin to fire the Send To Freight System button

Postby DannyC » Wed Dec 15, 2021 2:47 pm

Are you wanting to invoke the same code that this plugin executes when that button is clicked?

Yep.

Pretty sure the IFS Smartfreight plugin is already enabled. So I'd need to somehow invoke the code in that plugin.
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Plugin to fire the Send To Freight System button

Postby Mike.Sheen » Wed Dec 15, 2021 2:58 pm

The easiest way is to automate the clicking of the button - that's assuming you have a form and are not trying to do this with only the business logic available.

You can do that using the PerformClick method.

Code: Select all
salesOrderForm.SendToFreightSystemUltraButton.PerformClick();
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: Plugin to fire the Send To Freight System button

Postby DannyC » Thu Dec 16, 2021 9:03 am

that's assuming you have a form and are not trying to do this with only the business logic available
.

Bugger. Not via another Jiwa form. But would the same technique be possible using
Code: Select all
salesOrder.Client.SendToFreightSystemUltraButton.PerformClick();

or would that only work if the Client isn't null? i.e. that there's a sales order form?
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Plugin to fire the Send To Freight System button  Topic is solved

Postby Mike.Sheen » Thu Dec 16, 2021 11:21 am

DannyC wrote:Bugger. Not via another Jiwa form. But would the same technique be possible using
Code: Select all
salesOrder.Client.SendToFreightSystemUltraButton.PerformClick();

or would that only work if the Client isn't null? i.e. that there's a sales order form?


Yes, only if the Client is not null is there a form - and if you look at the code in the IFS plugin, you'll see it only adds a button click handler on the sales order form setup method.

It's beginning to sound like you need to copy the code in that IFS plugin into your plugin.
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


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 5 guests