Adding column to Work Order Inputs grid  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Re: Adding column to Work Order Inputs grid

Postby SBarnes » Wed Jul 08, 2020 11:12 pm

I just had a look at the code for the form in the routine DisplayInputs for example the rowcount gets set to zero and as the for loop goes over the input lines the rowcount gets incremented look at line 1194 to see what I means
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1621
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 176

Re: Adding column to Work Order Inputs grid

Postby DannyC » Thu Jul 09, 2020 12:19 am

Thx Stuart. Looking at the DisplayInputs routine now. Can't see how I can manipulate the plugin with that extra knowledge.
I think rather than beating my head against a brick wall for more unproductive hours, might just leave it for Mike to respond.
User avatar
DannyC
Senpai
Senpai
 
Posts: 638
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Adding column to Work Order Inputs grid

Postby Mike.Sheen » Thu Jul 09, 2020 11:51 am

DannyC wrote:It's definitely something with
Code: Select all
workOrderForm.InputsJiwaGrid.ActiveSheet.RowCount
.
Whenever a work order is edited and saved, the RowCount is 0. Even when scrolling to another work order.


This is caused by some fairly recent changes we made to the Work Order form to try and improve performance.

It's caused by the form removing all its handlers when the status combo selection changes, setting the business logic property status, and then adding back the handlers again. This was done to prevent the form responding to events whilst the business logic was busy getting and setting quantities for each input item in each stage which was causing the form to display the same item multiple times.

By removing the handlers and re-adding them it's causing your handler to now be fired before the forms handlers - so the active row, rowcount and other properties of various grids isn't what you would expect in the ReadEnd event anymore.

If we had an event from the form which is raised whenever an input item has been displayed, this would make this a lot easier - so I've added that improvement DEV-8318 for you.

In the meantime, there might be something we can do to work around this - I'll have to come back to this later and try a few things out.
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: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Adding column to Work Order Inputs grid

Postby SBarnes » Thu Jul 09, 2020 1:03 pm

Hi Mike,

I had suggested to Danny to add code to the last, previous, next and last button clicks as a possible way around it, could that work if the handlers were removed and readded?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1621
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 176

Re: Adding column to Work Order Inputs grid

Postby Scott.Pearce » Thu Jul 09, 2020 1:14 pm

I was thinking Danny could try removing and re-adding his handlers when the status combo selection changes - this would ensure all handlers were in the desired order.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 743
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Adding column to Work Order Inputs grid  Topic is solved

Postby Mike.Sheen » Thu Jul 09, 2020 1:15 pm

Here's a solution that solves the problem.

It simply removes and re-adds the handlers when the status combo selection changes (that's where the work order form removes and re-adds it's own handlers).
Attachments
Plugin Add Total Cost to Work Order inputs.xml
(40.08 KiB) Downloaded 59 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: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Adding column to Work Order Inputs grid

Postby Mike.Sheen » Thu Jul 09, 2020 1:16 pm

"Just add a total to the inputs grid" they said. "It'll only take 10 minutes, surely!" they said.

4 people and 12 hours later...
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: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Adding column to Work Order Inputs grid

Postby Scott.Pearce » Thu Jul 09, 2020 1:16 pm

Scott says, but Mike does....

:-)
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 743
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Adding column to Work Order Inputs grid

Postby SBarnes » Thu Jul 09, 2020 1:30 pm

Do you know when programming is easy?

When you are not a programmer. :lol:
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1621
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 176

Re: Adding column to Work Order Inputs grid

Postby DannyC » Thu Jul 09, 2020 2:32 pm

"Just add a total to the inputs grid" they said. "It'll only take 10 minutes, surely!" they said.

And that's almost the same conversation I had with the client!

Once again Mike, really appreciate your assistance.
User avatar
DannyC
Senpai
Senpai
 
Posts: 638
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Previous

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 7 guests