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.

Insert data in field

Featured Replies

Hi,

I have a layout used to enter products in a invoice table. I have put a portal on the layout that lista all the products that we sell. (Not to many) I have put a button on the portal rows that when clicked it will insert the product key into a repition field as if it was selected from a dropdown list in that field. I think that it is a Case step but can't get the syntax correct.

Basicly it needs to do the following:

1) Click the product button

2) Insert the Product id into the first available empty repetition field (1 through 10)

3) the rest of the fields(name, description, price) auto enter through relationship.

The reason it needs to be this way is because a dropdown list is too complicated for the salesperson to figure out. (Needs to be idiotproof)

All ideas greatly appreciated.

Is there any reason specifically that you are using the field repetition field??? If you really need it, write a script that does somthing along the lines of:

$counter = 1

loop

if( isempty(myfield[repetition: $counter]) )

set field [ myfield[repeitions: $counter ; Product::ID ]

end if

exit loop if[ isempty(myfield[repetition: $counter] or $counter = 10)

$counter = $counter + 1

end Loop

  • Author

Thanks for the reply.

Still having a little trouble. New to scripting

$counter = 1I assume this is a set variable step?

loop

if( isempty(myfield[repetitio n: $counter]) ) I can put the rep number in but what is :)$Counter, Scriptmaker doesn't let me enter that.

set field [ myfield[repeitions: $counter ; Product::ID ] Same Problem

end if

exit loop if[ isempty(myfield[repetitio n: $counter] or $counter = 10)

$counter = $counter + 1end Loop

This is my first use of the loop step. As I said new to all this. Still having problems with syntax.

Thanks

Hmm, in script maker words:


Set Variable[$counter ; Value: 1]



Loop



If[ IsEmpty(myfield[$counter]) ]

Set Field [myfield ; Product::ID ]

/* 

NOTE: When you choose this script step, you will

have to first specify myField, down the bottom 

you will see a little blank space labeled 

repetition - set it to $counter.

*/

End If



Exit Loop If[ IsEmpty(myfield[$counter]) or $counter = 10)]

Set Variable[ $counter ; Value: $counter + 1]

End Loop 

HTH

That was much more succinct . :) Thanks Genx.

Succinct is my moddle name... well not really, its actually something kind of dodgey.

You know, its so much easier to hand write the code than it is to construct the script with ScriptMaker. I wish FM would let us do it if we wanted... oh well.

Alex, aren't you missing a Go To Record [ Next ] ?

Possibly - I just blindly translated the script without actually reading anything...

But from what I can gather, the script is designed to loop through the repetitions (to achieve what I'll leave Geoff or Jesse to explain - which one of you is it that hangs out around here more anyway... if it's both of you, I'm just gonna call you Geosse from now on :) )

Edit: But no, after reading the op's post, I don't think a Go To Next is required here -- its just meant to fill the next available empty rep.

Edited by Guest

Ah, reps ... never mind. :wink2:

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.