Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Using a Variable in Script

Featured Replies

I'm having a rather difficult tiime with a script that i am going to try to do my best to explain. When setting up my database, i used the notes feature that is found in the Contact Management example database so that i could actually have a database of all the "Notes". Recently, i have tried to implement a new feature into our notes that lets the user enter in the amount of "hours" they had on a particular note.

The script that i wrote to add the note can be seen in Script.png image that is attached.

That part has worked fine and dandy. Now, i am trying to create a report that is based on the amount of hours a user has entered which is where i am coming into a snag. Since the hours are set into a variable, how can i extract them into a report?

Since i have the variable set to the Notes_Investigation::Hours field i though i would use that but am having an issue. It seems that if i look at the Notes_Investigation database, the hours i am entering are not on the same note. See the image labeled Notes.png

The text field that you see in the Notes.png file is a calculation to combine the date, time, user and hours of the user, along with any text they enter, but it seems that when the user enters their time, it places that time into the Hours field of the note before that. How can i get the time to go to the hours field for the same note?

I hope this make sense since it is driving me crazy lol. Any help would be appreciated

Script.png

Notes.png

The reason that your hours are appearing in the "previous note" is because your custom dialog is setup so that a user is entering the hours directly into the Notes_Investigation::Hours field.

So when they type in a number into the dialog and then hit ok you are actually allowing them to edit whatever note they are currently on.

What you could do instead is create the new note before you show the dialog and don't even bother with the variable. This way the user will actually be entering data directly into the new record.

  • Author

I will give that a try, thank you for your help.

  • Author

That worked great to get the hours to be on the correct note, unfortunately that created another problem.

On the note itself, I incorporate the time into the beginning of the note with this calculation:

TextColor ( TextStyleAdd ( TextSize ( Lower ( TimeStamp_Creation ) & "  by "   & UserName_Created & " - Time: " & $Hours ; 10 ) ; Bold )  ; RGB ( 0 ; 0 ; 0 ) )& TextSizeRemove ("¶"; 10 )




Note that before this change, i was using the $Hours variable to populate the hours. Since i am no longer using the variable, i changed the calculation to simply use the hours field:




TextColor ( TextStyleAdd ( TextSize ( Lower ( TimeStamp_Creation ) & "  by "   & UserName_Created & " - Time: " & Hours ; 10 ) ; Bold )  ; RGB ( 0 ; 0 ; 0 ) )& TextSizeRemove ("¶"; 10 )

The problem is, the hours no longer show up in the note. Is there any way to get that incorporated into the note without the variable?

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.