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.

Script refuses to enter field

Featured Replies

There's probably some rookie mistake that I'm missing here...

My invoice layout contains a couple fields for entering discounts. The DiscountPercent Field is just a plain number field, while DiscountValue is a number field with a calculation (Auto-enter Calculation replaces existing value). The calculation is:


If( IsEmpty( DiscountPercent ) ; DiscountValue ; SubTotal * (DiscountPercent / 100 ) )

This basically says that if there in a number in the DiscountPercent field, fill DiscountValue with that percentage of the SubTotal. If there's no number in the percent field, use whatever number is sitting in the value field. The grand total then subtracts this from the sub total.

I want a script that, when the DiscountValue field is clicked, it first clears out the DiscountPercent field, so that the user can enter a fixed amount in the value field. But for some reason, the scripts refuse to enter the DiscountValue field. I've tried both Set Selection[header::DiscountValue] and Go To Field[header::DiscountValue], and neither will enter it. I have other fields that are set up basically identically to this field, and the script can enter them just fine. Also, if I just click on the field, I can enter it without problem (but I would like the script so that the Percent field can be cleared first)

I would greatly appreciate if someone could let me know what I'm doing wrong here. Thanks.

See if you can get the idea here:

http://edoshin.skeletonkey.com/2006/06/linked_fields.html#more

Since my take on it is that it hardly deserves to be scripted at all!

--sd

  • Author

Thanks a lot for the help. I had to change their calculations a little, but it's working great now.

Since my take on it is that it hardly deserves to be scripted at all!

My thoughts exactly! But I never thought to do it this way. Thanks again!

Still, even though I'm going to be using this method, do you have any ideas why that script wouldn't be able to enter the field? Now I'm curious.

Edited by Guest

Still, even though I'm going to be using this method, do you have any ideas why that script wouldn't be able to enter the field? Now I'm curious.

Well I can't copy here ... what am I missing in my template attached below?

--sd

Quaterkoen.zip

"I've tried both Set Selection[header::DiscountValue] and Go To Field[header::DiscountValue]"

Why not Set Field? Are you on a layout based on "header"?

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.