Custom Search how to use 'Decimal Places'  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Custom Search how to use 'Decimal Places'

Postby 2can2 » Mon Sep 01, 2014 4:58 pm

Hi,
I can't seem to find how to format a custom search decimal column using the Jiwa 'Decimal places'. I have read it as the last field in the custom search :
"IN_Main.DecimalPlaces " & _
"FROM IN_Main LEFT JOIN

So I am using vbInteger temporarily as I don't want any decimals in this case.

Code I am using in the plugin is
.AddColumn("PartNo", vbString, "", 15, 2)
.AddColumn("Description", vbString, "", 30, 3)
.AddColumn("Avail.SOH.", vbInteger, "###.;\ ;\ ", 8, 4)
.AddColumn("Tot.SOH.", vbInteger, "###.;\ ;\ ",9, 5)
.AddColumn("Price", vbDecimal, "", 7, 6)

Basic query I know but I have tried most combinations with no success. Thanks
Doug
2can2
Frequent Contributor
Frequent Contributor
 
Posts: 171
Joined: Tue Feb 26, 2008 10:24 am
Topics Solved: 25

Re: Custom Search how to use 'Decimal Places'  Topic is solved

Postby Scott.Pearce » Tue Sep 02, 2014 8:59 am

The .AddColumn function accepts a parameter (among others) called "DecimalPlacesType". This has 2 possible values:

JiwaApplication.JiwaSearch.Column.DecimalPlacesTypes.AnotherColumn
JiwaApplication.JiwaSearch.Column.DecimalPlacesTypes.HardCoded

It sounds like you want the JiwaApplication.JiwaSearch.Column.DecimalPlacesTypes.AnotherColumn option. Now, when you pass this value, you also need to supply a value for another parameter - "DecimalPlacesColumnIndex". As the name implies, here is where you define the column number that contains the value that should be used for the number of decimal places.

So, assuming that your field for decimal places is column 7, you would change your calls to .AddColumn thus:

.AddColumn("Avail.SOH.", vbDecimal, " ", 8, 4, , , JiwaApplication.JiwaSearch.Column.DecimalPlacesTypes.AnotherColumn, , ,7)
.AddColumn("Tot.SOH.", vbDecimal, " ",9, 5, , , JiwaApplication.JiwaSearch.Column.DecimalPlacesTypes.AnotherColumn, , ,7)
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Custom Search how to use 'Decimal Places'

Postby 2can2 » Wed Sep 10, 2014 12:24 pm

Thanks Scott
2can2
Frequent Contributor
Frequent Contributor
 
Posts: 171
Joined: Tue Feb 26, 2008 10:24 am
Topics Solved: 25

Re: Custom Search how to use 'Decimal Places'

Postby JimmySu1402 » Wed Mar 22, 2017 4:23 am

Hi Scott,

Do you have a sample plugin to create a custom search or query for the inventory search screen.

Regards,
Jimmy Su
JimmySu1402
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Wed Sep 03, 2014 12:16 pm

Re: Custom Search how to use 'Decimal Places'

Postby Scott.Pearce » Wed Mar 22, 2017 9:08 am

Have a look at the sample here
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 14 guests