Adding/removing columns in Purchase Order Generation  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Adding/removing columns in Purchase Order Generation

Postby DannyC » Tue Mar 14, 2017 9:07 am

Hi,

I have a client who wants to have a customised Purchase Order Generation screen grid, stuff like columns for the past 6 months of sales plus a total column, and several other custom columns which are not currently in the standard screen.
I know how to modify the underlying stored procedure to pull the data I need.
How complicated is it to change the columns displayed in the grid?

This client is on 7.0.157.
And my preferred language is VB.net

Thanks

Danny
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Adding/removing columns in Purchase Order Generation  Topic is solved

Postby Mike.Sheen » Thu Mar 16, 2017 10:43 am

Hi Danny,

It's a bit clunky because we don't have the right events in place in the business logic.

Adding the columns is easy - just in form setup you add them:

Code: Select all
poGenForm.ProductsJiwaGrid.AddColumn("Test", New JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType, "Test", 5, False, , False, True, 50)


Then add a handler for the button to fetch the results to populate the grid:

Code: Select all
AddHandler poGenForm.GetCandidatesUltraButton.Click, AddressOf GetCandidatesUltraButton_Click


The inefficient part is what comes next - you have to call the stored proc used again, after the business logic has and iterate the results, looking for the row and match that up with the row in the grid, then set the value.

Attached is a plugin which does all this - note: I only added one column "Test" to the grid, and I modified my stored procedure (based on usp_JIWA_Batch_PurchaseOrder_ReplenishToMinimum) to return a column "Test" as well.

Mike
Attachments
Plugin Add column to PO Generation.xml
Sample plugin
(41.12 KiB) Downloaded 140 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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Adding/removing columns in Purchase Order Generation

Postby DannyC » Tue Mar 28, 2017 10:52 am

That's a fantastic help Mike.
I have been able to add in half a dozen or so extra columns which are great - until saved.
Once saved, all the custom col data disappears. Columns are still there, just empty.

EDIT: 99.9% sure it's because the data isn't getting saved away to PO_BatchPurchaseOrderLines.
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Adding/removing columns in Purchase Order Generation

Postby Mike.Sheen » Tue Mar 28, 2017 12:17 pm

DannyC wrote:Once saved, all the custom col data disappears. Columns are still there, just empty.

EDIT: 99.9% sure it's because the data isn't getting saved away to PO_BatchPurchaseOrderLines.


Correct. If you want to persist that data, best bet is to create a new table with a link to PO_BatchPurchaseOrderLines.RecID - and write away the values on save, and read them back in on read.
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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756


Return to Technical and or Programming

Who is online

Users browsing this forum: Google [Bot] and 16 guests

cron