filter

hi fnds,

i have a base enum in my table.base enums(gender) contains 3 elements like male,female,others

my table contains all the records based on the baseenum

actual my requirement is

when i open a form ,the form should contain only male and female records. i dont want display others records

please help

thanks,

murali

Hello Murali,

Write the code in the form - init() method to filter the records based on the enum(Gender) - [male,female].

public void init()
{
super();

Tablename_ds.query().dataSourceTable(tableNum(TableName)).addRange(fieldNum(TableName,Gender)).value(queryValue(Gender::Male));
Tablename_ds.query().dataSourceTable(tableNum(TableName)).addRange(fieldNum(TableName,Gender)).value(queryValue(Gender::Female));

}

hi Naresh,

Thanks for reply

i wrote that code in my init() but i got error like “Argument value is incompatible with the required type”.

thanks,

murali

hi naresh,

i wrote that code in mu init() but i got the following error

in infobox,

rror executing code: object not initialized.

Stack trace:

(C) \Classes<unknown>\dataSourceTable

(C) \Forms\eisCustPdc\Methods\init - line 5

(C) \Classes\SysSetupFormRun\init - line 3

(C) \Classes\FormFunctionButtonControl\Clicked

thanks

Hello Murali…

Can you post the code what you have wriiten in the init() method.

hi,

eiscustpdc_ds.query().dataSourceTable(tableNum(eiscustpdc)).addRange(fieldNum(eiscustpdc,ChequeStatus)).value(queryValue(ChequeStatus::Bounced));

eiscustpdc_ds.query().dataSourceTable(tableNum(eiscustpdc)).addRange(fieldNum(eiscustpdc,ChequeStatus)).value(queryValue(ChequeStatus::Live));

eiscustpdc_ds.query().dataSourceTable(tableNum(eiscustpdc)).addRange(fieldNum(eiscustpdc,ChequeStatus)).value(queryValue(ChequeStatus::Realised));

Thanks,

Hello Murali,

Try to compile the form and check it…Because the code which you have writen is fine…
Did you write the code in the init() method after the super().

hi,

i written the code in the Init() method after super() but still i am getting the error

actually my requirement is

i have 2 forms,in 1st form i have a button.when i click that button ,second form will open

here i want to filter the data based on the base enums

Thanks,

Hello Murali,

In the 2nd form, what are the tables under the datasources node. The table ‘eiscustpdc’ is under the datasource of the 2nd form or not.