Comparing a formula field value with a string from within another formula field
Hello , hope you are well.
I am facing a simple but silly issue and I am stuck at this point. Thought you might be able to help me out with this one. I have tried everything, but maybe I am missing something out in this simple thing.
I am trying to compare the value of a formula field with another string from within another formula field, bit it does not recognise. Below is my code
let dueInMessage := "";
let numberOfDays := days(today(), 'Due Date');
if numberOfDays > 0 then
dueInMessage := numberOfDays + " D"
else
if numberOfDays < 0 and Status = "NOT PAID" then
alert(Status);
dueInMessage := "Overdue by " + abs(numberOfDays) + " D"
end
end;
dueInMessage
1. In the above code I want to be able to display the number of overdue days if the number of days < 0.
"Status" is a formula field in Bill table that has the value "PAID", "NOT PAID", "PART PAID" depending on the payment done for that particular bill.
Just to let you know that if the bill date is in the future, it correctly shows the number of days due as per the above script.
2. I want to be able to display the "Due In" formula field open the form only in two scenarios
i) When the due date is in he future so that I can track how many days left for making the pmt
ii) When the Status formula field is "NOT PAID"
In case the Status formula field has the value "PAID", there is no need to display the "Due In" formula field.
Snapshots attached below.
6 replies
-
Hi
Try taking the alert statement out as it doesn’t work in a formula field.
regards John
-
Try putting text() around Status?
What is the code for Status?
Or in a test formula field create an if statement for Status to see what happens:
if Status = "NOT PAID" then 1 else 0 end
-
Ninox should allow the following through their API
1. To change the styling of the form elements (text box, formula box etc) through the script
2. There should be a version of the styled function that can change the style properties of the physical elements on the form and not the text inside the elements. Not everyone wants to see the formatted/styled text in the grid view/table view.
3. Text formatted using the styled function should have full background cell color in table view instead of just the background of the text. It looks so weird. I don't understand what good does Ninox see in this. It is not at all pleasing from UI/UX point of view.
4. There should be a separate facility to style the text in the table view (if required to be done)
I hope Ninox is or can read this feedback and implement this in the future updates!!
Content aside
- Status Answered
- yesterdayLast active
- 6Replies
- 25Views
-
4
Following