Page 1 of 1

Custom Search how to use 'Decimal Places'

PostPosted: Mon Sep 01, 2014 4:58 pm
by 2can2
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

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

PostPosted: Tue Sep 02, 2014 8:59 am
by Scott.Pearce
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)

Re: Custom Search how to use 'Decimal Places'

PostPosted: Wed Sep 10, 2014 12:24 pm
by 2can2
Thanks Scott

Re: Custom Search how to use 'Decimal Places'

PostPosted: Wed Mar 22, 2017 4:23 am
by JimmySu1402
Hi Scott,

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

Regards,
Jimmy Su

Re: Custom Search how to use 'Decimal Places'

PostPosted: Wed Mar 22, 2017 9:08 am
by Scott.Pearce
Have a look at the sample here