My version is 2020.4.2.
I have a rich text with some calls to different fields.
One of these statement is :
Code: Select all
{(DateToStr(SaleDocumentLine.xx_Date_Livraison)==null) ? "" : "Livraison prévue le : " + Format("{0:dd/MM/yyyy}", SaleDocumentLine.xx_Date_Livraison)}
However, when "xx_Date_Livraison" field is null, nothing is displayed in my rich text box : I mean all the other statements displayed in my rich text disapear, such as if my "== null" test above was not executed.
The field xx_Date_Livraison is a date time. In the above code, I try to convert the date in string and then test if "==null" could work. It doesn't work.
I have also tried "IIF" syntax.
I have also tried "==DBNull.Vale" instead of "==null" : it displays an error message "operator == can't be applied to type System.DateTime and System.DBNull"
Thank you for your help