Click on “execute” and then give it the ID of the order. Let me show you what it will look like if we take away two bike helmets from a warehouse’s stock. This becomes very inefficient if we had 50 different warehouses and each warehouse had 500 products, but for the purpose of our little demo, it will work. Like I said earlier, this is not really an optimal way to do it. Once we’ve found the relevant warehouse that has the item in stock, we decrement the quantity in stock. It might be that one of the products in the order is in Warehouse A, and the second product is in Warehouse B. To summarise the code, we scan through the order, and then we try and find where we can fulfill that particular product from. We’ll just have one check that the inventory line item actually has stock left. Of course, you probably need to worry about which warehouse was closest and several other factors as well. You could certainly optimise this but I’m going with a simple approach to find the inventory item by looping over all the items in the warehouse. We then need to find the relevant item in the warehouse. We’ll start with this code to iterate over each line item in the order: It will accept an order and it will scan through each of the line items in the order, find them in the warehouse, and detriment the quantity in stock for the warehouse based on that. I’m going to make a custom function called “process order.” What we want to happen is that when the customer makes an order, we should move the item from the warehouse, and reduce the quantity in stock by one. We will have “order line items,” we will have the “item name,” and we will have the “quantity purchased.” We would probably also have the amount that you paid for it, but in the interest of time, I’m going to skip that. I just want to be able to show you how you would transfer data from one subform to another using Deluge script. I’m doing a very limited sample subset of what the real app would be. While I’m waiting for that to happen, I will create another form for my order.I will add in a field called “customer name” and, of course, this should really be a look-up field to your customer form. I will add a field, which will be the “item name,” I will add another field that I will call “inventory items,” and I will add a number for the number in stock. I will give it a name, and I will give it some warehouse items using a subform. For that reason, I’m going to start by creating a form for the warehouse. The scenario I have is I’m building an inventory management system where I need to keep track of the moving of items from warehouses to customer orders. In this post, I’m going to go over how to use Deluge script with subforms and Zoho Creator.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |