cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Corissandageri
Helper V
Helper V

Increment number with button

Hi all

I have done a search on this but the variants I came across vary slightly on what I want.

I have a text box where I enter a purchase order number e.g 350223. Often I enter consecutive orders. How would I have a button that would add one to the order number that I manually entered?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User III
Super User III

@Corissandageri 

Use this code in the OnSelect property of your button

Set(myPurchaseOrderNum, Value(TextInput1.Text) + 1);
Set(myPurchaseOrderReset, true);
Set(myPurchaseOrderReset, false);

 

Put this code in the Default property of your text input

myPurchaseOrderNum

 

And also this code in the Reset property of the text input.

myPurchaseOrderReset

 

Now when you click the button it will increment the number you input automatically.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

6 REPLIES 6
eka24
Super User III
Super User III

Watch this auto increment by Shane Young
https://youtu.be/plKw_xfVfwY?t=450

 

 

mdevaney
Super User III
Super User III

@Corissandageri 

Use this code in the OnSelect property of your button

Set(myPurchaseOrderNum, Value(TextInput1.Text) + 1);
Set(myPurchaseOrderReset, true);
Set(myPurchaseOrderReset, false);

 

Put this code in the Default property of your text input

myPurchaseOrderNum

 

And also this code in the Reset property of the text input.

myPurchaseOrderReset

 

Now when you click the button it will increment the number you input automatically.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

TheRobRush
Resolver III
Resolver III

in the onselect of the button

Set(orderval,value(textinput1.text)); ///textinput1 is name of wherever you type an order number.
Set(orderval, orderval+1);
reset(textinput1)

Then in the default of textinput1 make the value orderval, and in onstart of app add Set(orderval,0) so that starts as 0

Thank you

This works great, I understand the Set(myPurchaseOrderNum, Value(TextInput1.Text) + 1);

But don't really understand the resets. 

@Corissandgeri
Once you have types a value into the Text Input it no longer shows the Default value. By resetting the control we clear the value you wrote in and replace it with the default value (previous value + 1)

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

Thank for that explanation

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (84,935)