0

Find event in the same date

Hi, I have this formula that allows me to see if there is already an event for the same date when I create a new lead and enter the date of the new event. I would also like to have a nearby field that automatically writes me what the event is (with the name and date, for example). Is there any possibility? Thanks!

 

let myField := ‘Event Date’;

if cnt(select Jobs where Date = myField) then

styled("There is already an Event for the same date!", "Red")

end

4 replies

null
    • Fred
    • 4 mths ago
    • Reported - view
     said:
    Is there any possibility?

     Most things are possible in Ninox.

    One that is not possible is for a formula field to modify other fields. Only buttons or triggers can modify other fields. So you could put the following in the Trigger after update for you 'Event Date' field.

    let t := this;
    let jobCheck := (select Jobs where Date = t.myField);
    if count(jobCheck) then
        let jobRec := first(jobCheck)
        otherField := jobRec.name + " - " + jobRec.date
    end
    

    Another option is to create a view element and put the first two lines in the formula section. Then the view will show you any job records that match.

      • giuseppe
      • 4 mths ago
      • Reported - view

       Hi Fred, thanks for the formula! I am very interested in the second scenario, which is to have a view field that shows me the events already taken on the same date as the lead. I tried creating one and adding the first two lines of your formula but it doesn't work, unfortunately. The field does not return anything

      • Fred
      • 4 mths ago
      • Reported - view

       Is there a void at the end of the code in the view element?

      If so, you can either remove the ‘let jobCheck’ part of line 2, or put ‘jobCheck’ at the end.

      • giuseppe
      • 4 mths ago
      • Reported - view

       Thank you, works perfectly!

Content aside

  • Status Answered
  • 4 mths agoLast active
  • 4Replies
  • 31Views
  • 2 Following