cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AlesonITC
Helper II
Helper II

Doing operations with table number and textimput number

Hi all, 

I want to substract a number from a table. This number is added by the user so I want to substract to my initial number of the table this user's number. This operation must be in a button with the submitform of more things to the table I've got.

I add an image to try to explain it.

Lots of thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @AlesonITC,

 

  • On your edit form, remove the lock from your quantity card. 
  • Change the name of the data key card label to "Quantity Remaining"
  • Add a slider control to the card and set its properties as follows: Default 0, Max ThisItem.Quantity, Min 0
  • Add another Label to the card and set the Text property to "Amount Purchased".  Add a second label and set its Text property to Slider1.Value. 
  • Have the Add Sale button On Select property be SubmitForm(Form1)
  • Now when you submit the form, the DataTable will reflect the post sale inventory quantity.

When new items come in, you can adjust the inventory by putting the correct quantity now in stock into the TextInput Control and click the button.  The new total will be reflected in the Datatable.

View solution in original post

7 REPLIES 7
AlesonITC
Helper II
Helper II

I am trying something like this:

 

SubmitForm(Form1);;UpdateContext(DataTable2.Selected.Quantity = DataTable2.Selected.Quantity - Value(TextInput1.Text));;ResetForm(Form1)

But it doesn't work

AlesonITC
Helper II
Helper II

No one can help me? Smiley Sad

v-monli-msft
Community Support
Community Support

Hi @AlesonITC,

 

Which part is the form that you are trying to submit? In below image, the blue part or the yellow part? It seems to me that the blue part is the edit form and yellow part is a data table control. Is that true?

 

Capture.PNG

 

If so, what is the data source of the data table? Is it the same one as the edit form? I assume that there should be 2 different data sources, since in your screenshot, both data table and form have the same column named Quantity, but the values are different.

 

Selecting Add Sale would update the records from edit form(DataSource1), but it won't change the data in data table(DataSource2). 

 

Please explain your situation more clearly so that we could help.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-monli-msft thanks for answer, the thing I'm trying to do is update the number which I select to make the insert of the sale and substract the quantity number  of the textImput (the blue part, the number 3) to the DataTable on the conection to SQL server, and then update this showTable (yellow part).

 

Doing this, I would get a number 7 on watermelon after a refresh of the datatable.

 

The app works:

1.- Tap or select an employee

2.- Tap or select a fruit

3.- Write the number of fruits that vendor sells to a client.

4.- Submit form, it saves on a SQL Table the vendor id, the fruit id, the date and the number of fruits sold.

5.- Update the table substracting the number of fruits to the old number.

 

It works all nice but the last point. I don't know what function use, tried with update, patch, updatecontext...

 

Lots of thanks

 

AlesonITC
Helper II
Helper II

Anyone can help me please? 

I will be very grateful.

Thanks.

Still need help please Smiley Sad

Hi @AlesonITC,

 

  • On your edit form, remove the lock from your quantity card. 
  • Change the name of the data key card label to "Quantity Remaining"
  • Add a slider control to the card and set its properties as follows: Default 0, Max ThisItem.Quantity, Min 0
  • Add another Label to the card and set the Text property to "Amount Purchased".  Add a second label and set its Text property to Slider1.Value. 
  • Have the Add Sale button On Select property be SubmitForm(Form1)
  • Now when you submit the form, the DataTable will reflect the post sale inventory quantity.

When new items come in, you can adjust the inventory by putting the correct quantity now in stock into the TextInput Control and click the button.  The new total will be reflected in the Datatable.

View solution in original post

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!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (64,438)