Hi Team,
I have a product table which contains four columns
Id Name Start date End date
1 Abc Nov 23 Dec 23
So my question is when the end date is lesser than the current date i need to Grey out all the fields in the respective row.
If end date is Dec 23 and the current date is Jan 24 i need to grey out all the fields of the respective row.
Can u guys help me out!
Hii @surya v,
You can achieve this by adding style class in row cell, you will have to add condition If(GetProducts.List.Current.Product.Enddate<CurrDate(),"grey","") in every row cell inside row
then you can achieve the desire result.
here below table second row is grey becaue end date is less than current date
For your help i have also attached the OML file.
hope this will help you
Kind regards,Sanjay Kushwah
I have added the same condition but for me ‘ Boolean data type required instead of none’
This error is showing in expression editor.
@Sanjay Kushwah
I have edited my question accordingly pls check once
As @Sanjay Kushwah mentioned we need to do the same but also we need to add the style sheet in css
.grey{
background-color: grey!important;
color: black;
}.
and if your date was saved in only Months and year, you need to convert the text month into the month order by a client action and ned to add the function in the expression.
so the expression looks like
If(GetInProduct.List.Current.Product.EndYear <= Year(CurrDateTime()) and GetMonthNumberbyNameGetInProduct.List.Current.Product.EndMonth ) < Month(CurrDateTime()), "Grey", "") .
use this in a row cell style sheet.
@surya v,
Please change value of end date in condition by your aggregate.
if not solved then please attach your OML file.
Yeah i have replaced the end date in my aggregate even though its showing like boolean data type needed i have attached image pls check once
In the condition you are putting End month not EndDate, please confirm you are saving only month or whole endDate ?
Thanks. Here i have end month in a seperate attribute and end year in a seperate attribute we are not using the date here.
Now i have to check both the end month and end year for greying out.
I mean NOV is end month And 23 is end date so i need to check both ‘Nov 2023’ is lesser than curr date and grey out if it is less.
It is not good practice to keep month and year in different - different attributes in table while you can save whole date in single attribute/column with Date data type, and if you want to show only month and year on UI then you can use Month() and Year() inbuilt function.
Month(currDate) _--> will fetch/return current month from the whole date.
Year(currDate) ----> will fetch/return current year from the whole date.
thanks & regards,
Sanjay kushwah
Hi
If your data structure use separate day month and year, you can use NewDate from built in function and check the condition by current date, so it will check the whole date
Hi @Sanjay Kushwah
i have attached sample oml file pls look and help me on this.