If condition in view

Hi All,

Is there a way to filter using the IF condition in view? I have a requirement where i have to display packageid in the form.i have a view which joins RBOTransactionSalesTrans and RBOMixAndMatchTable.I need to execute this condition in the view:

if(RBOTransactionSalesTrans.periodicDiscType == RBOPeriodicDiscType::mixandmatch)

{

return RBOMixAndMatchTable.PackageId;

}

Can this filter be achieved in the view? Or is there some other way to do this in the form itself? Kindly advise.

Thanks and Regards,

Gaya3

Hi ,

Display method is Best way to return those value. So you can Use display method in View level and also you can inherit the display method through the datasource level.

Hi,

Will the filter work if we put the display method? My client wants filter too :frowning:

Thanks,

Gaya3

Do you want to show only RBOPeriodicDiscType::mixandmatch record in Form ?

no…i want the package id of RBOMixAndMatchTable only for the records where RBOTransactionSalesTrans.periodicdisctype == RBOPeriodicDiscType::mixandmatch

Hi,

I hope you have added periodicDiscType and PackageId field in View Fields, if so you are using that particular View in that Form Datasource you can use the below display method in the datasource level itself,

Let us consider the Name of the View is RBOTransView

///////

display str packageId()
{
;
if (RBOTransView.periodicDiscType == RBOPeriodicDiscType::mixandmatch)
{
return RBOTransView.PackageId;
}
}

Hope it will work …

display str packageId()
{

str empty=" ";
;
if (RBOTransView.periodicDiscType == RBOPeriodicDiscType::mixandmatch)
{
return RBOTransView.PackageId;
}

else

{

return empty;

}

}

This should work in your case.

Thanks

Mr.Sufian,

Display method will return only the available datas we no need to create a variable for null datas, By default it will show the Null in the case of record not found… So try your own logic, Dont do CopyCat

Hi,

If we use the display method, we can’t filter by grid or do advanced filter right? my client needs the filter option too…

Thanks and Regards,

Gaya3

Hey,

You create a view and add range to the corresponding table with range value.

Regards,

Raghavendra.

Hi Gaya3,

Really you are confusing us , You have mentioned the Word View , is it DataDictionary View or to show ( view ) ?. Please Explain your requirement Briefly…

I had faced the same issue where it was not returning null value so had to create a variable.Dont do CopyCat [:^)] . Join online English classes will help u a lot.