Change database values dynamically
Application Type
Reactive
Service Studio Version
11.10.12 (Build 39151)

I am creating a store management application which stores the details of the stock and customers. I want to change the value of the database dynamically. 

Suppose the stock of a medicine is 20 and the customer buys 5 packets, the value of stock should change from 20 to 15.

Could you please help me with this?

Thanks,

Anubhuti

Hi Anubhuti, 

For updating the Stock value at backend you can simply just substract the buy value from stock and use create and update of stock entity.

It will update the remaining stock value.

Hope this will help,

Regards,

Komal

I'm doing same problem now.I tried  according by Komal's instruction & achieved this.I think Komal's comment is solution.

It helped me. 

Thanks Komal,

Hayasaka 

You are welcome, Hayasaka. I am glad that it helped :)

mvp_badge
MVP

Hi Anubhuti,

You need to store stock of a medicine  in one entity.

On front end side you need to check how many stock of you have ten what customer buy from in stock you need to update this stock in entity.

You need to put logic for or you can create process for it.

Hope this will help you.

Regards

Rahul

Hi Anubhuti,

As Per Stock count it should be store in Invetory stock table when any buyer get any stock iteam .we update stock  via logic in action 


(a). StockId StockName   StockCount

       1          ST1       20


(b) When buyer buy put vaule stock of 5 .first we select stockcount based on Stockid and after update stock


Ex  :button click we get vaule of  5  we sustract  this value to old vaule

20-5=15  and finally update stock based on StockId   stock count update

Hi Anubhuti, 

For updating the Stock value at backend you can simply just substract the buy value from stock and use create and update of stock entity.

It will update the remaining stock value.

Hope this will help,

Regards,

Komal

I'm doing same problem now.I tried  according by Komal's instruction & achieved this.I think Komal's comment is solution.

It helped me. 

Thanks Komal,

Hayasaka 

You are welcome, Hayasaka. I am glad that it helped :)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.