0

Fx Field to Display Date or Text Depending on If Statement

Hi,

 

In the standard view (all) for record entries, I would like a column that displays either a date that was recorded as a field or text if that date field was not completed.

 

So far I have..

 

let wavDep := Orders.'Waver Deposit';
if wavDep = text("Yes") then
text("N/A")
else
if wavDep = text("No") then
Orders.'Date Deposit Paid'
else
if wavDep = false then text("Incomplete") end
end
end

 

and it returns the following error - return type mismatch

 

I get that one is a date and one is text but I dont know quite how to overcome this.

 

Any help is appreciated.

 

Craig

5replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Try this:

    let wavDep := text(Orders.'Waver Deposit');
    if wavDep =  "Yes" then
    "N/A"
    else
    if wavDep = "No" then
    text(Orders.'Date Deposit Paid')
    else
    if wavDep = null then "Incomplete" end
    end
    end

    Steven

    Like
    • Craig
    • Craig
    • 1 yr ago
    • Reported - view

    Hi Steven,

     

    Thank you for your reply.

     

    That has work in most instances other than displaying the date. Incomplete or N/A displays but it is just a blank field whenever a date should be displayed.

     

    I am wondering if it to do with formatting so I will keep trying but if you have an idea what may have caused it feel free to let me know, it would be greatly appreciated.

     

    Craig

    Like
    • Craig
    • Craig
    • 1 yr ago
    • Reported - view

    Ok so, this is taking a lot more figuring out that I would have expected.

     

    I can only ever get one of the outputs to show, either the date the deposit was paid or the text, I cant get both to show up when they are relevent.

     

    let dateAsTxt := format(date(Orders.'Date Deposit Paid'), "DD/MM/YYYY");
    if Orders.'Waver Deposit' = true then
    "No Dep. Paid"
    else
    dateAsTxt
    end

     

    This is what I have now, and basically I get the date or a black field not the text I want.

    Like
  • let dateAsTxt := text(format(date(Orders.'Date Deposit Paid'), "DD/MM/YYYY"));

    Like
      • Craig
      • Craig
      • 4 mths ago
      • Reported - view

      RoSoft_Steven Rooryck Sorry it has taken so long to get back to you on this, I have just seen the reply as I had notifications off.

      Works a charm!

      Thank you!

      Like
Like Follow
  • Status Answered
  • 4 mths agoLast active
  • 5Replies
  • 570Views
  • 1 Following