Sample Plugin for a custom field with a drop down menu  Topic is solved

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

Sample Plugin for a custom field with a drop down menu

Postby Atronics » Fri Jun 05, 2015 11:34 am

Mike, for a novice, it is no problem to import the XML file and run the plugin. However, I need to install a combo box custom field into a form other than debtors, which requires some code to be changed. In this case I need the field in Work Order. Could you point me to what parts of the code need to be changed. e.g. the issue seems to be between line 30 and 40

Private _DebtorObject As JiwaDebtors.Debtor

Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function

Public Sub Setup(ByVal JiwaBusinessLogic As JiwaApplication.IJiwaBusinessLogic, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaBusinessLogicPlugin.Setup
_DebtorObject = DirectCast(JiwaBusinessLogic, JiwaDebtors.Debtor)
AddHandler _DebtorObject.CustomFieldValues.Changed, AddressOf CustomFieldValues_Changed
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Sample Plugin for a custom field with a drop down menu  Topic is solved

Postby Mike.Sheen » Wed Jun 24, 2015 5:38 pm

Atronics wrote:Could you point me to what parts of the code need to be changed.


No code actually needs to be changed to make the field appear - just Add a field to the Custom Fields tab on the plugin maintenance for the Work Orders form. Some code is needed to specify which values the user can select, however.

I've re-done the sample to work for work-orders - see attached.

Mike

Plugin Add Combobox custom field to work orders.xml
Sample Plugin
(30.59 KiB) Downloaded 903 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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Sample Plugin for a custom field with a drop down menu

Postby perry » Thu Jun 25, 2015 6:16 pm

Hi Mike,

Jiwa 7.0.117,

My test plugin as attached, it throws an error at
Code: Select all
DirectCast(GridObject.ActiveSheet.Cells(Row, Col).CellType, FarPoint.Win.Spread.CellType.ComboBoxCellType).EditorValue = FarPoint.Win.Spread.CellType.EditorValue.ItemData

That GridObject.ActiveSheet.Cells(Row, Col).CellType is nothing.

I'm not sure its a coding problem or a bug.


Regards
Attachments
Plugin __test.xml
(31.49 KiB) Downloaded 864 times
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 173
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 15

Re: Sample Plugin for a custom field with a drop down menu

Postby Mike.Sheen » Thu Jun 25, 2015 6:39 pm

perry wrote:Hi Mike,

Jiwa 7.0.117,

My test plugin as attached, it throws an error at
Code: Select all
DirectCast(GridObject.ActiveSheet.Cells(Row, Col).CellType, FarPoint.Win.Spread.CellType.ComboBoxCellType).EditorValue = FarPoint.Win.Spread.CellType.EditorValue.ItemData

That GridObject.ActiveSheet.Cells(Row, Col).CellType is nothing.

I'm not sure its a coding problem or a bug.


Regards


Hi Perry,

The first problem is that the cell type you defined on the "Custom Fields" tab of the plugin is type checkbox - it needs to be a ComboBox.
The next problem is that the cell type is nothing - I'm pretty sure we make an effort to set that for you - so it should not be null, but fortunately it's easy to work around that - try the attached.

Plugin __test.xml
Revised plugin
(31.93 KiB) Downloaded 770 times


Mike
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: Sample Plugin for a custom field with a drop down menu

Postby perry » Fri Jun 26, 2015 10:18 am

Hi Mike,

Thanks,

I forgot to switch the cell type before I export the plugin, was trying to see if cell type was causing issue.

I found in my case all columns' celltype after Col 14 are nothing. Anyway, tested your plugin and all works now.

Regards,
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 173
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 15


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests

cron