Jump to content
sal88

Safely replenish related Stock and edit parent record

Recommended Posts

sal88    0

Hi all

Using the Geist Database transactions method I am restoring stock levels of a single stock line, and then removing the stock ID from the Line Item (which is the parent record). The idea is that I am replenishing the stock, it being no longer assigned to the Line Item.

I am not using a portal, it is just a single related record ('Recurring_Services_Stock'), and the editing of the primary record ('Recurring_Services') must occur after the editing of the stock level (otherwise there is no relationship). For these reasons I believe my script is slightly different to examples Todd gives. Therefore I'm interested to know whether my script is excessive, or insufficient:

transaction.png.c77831fe55a26b2dd2ed0b84e5692de0.png

Share this post


Link to post
Share on other sites
Fitch    148

It looks OK, although I think for clarity I'd move line 7 below line 10 to nest that 'if' section.

Share this post


Link to post
Share on other sites
sal88    0

Thanks Fitch. I take it the below is OK then for adding stock? I think I'm unsure about (and I'm really splitting hairs here) is whether I should apply line 54 at the beginning, followed by 55-58, then change the stock levels but based on the 'recurring_services_stock' relationship and not the 'recurring_services_preview' relationship. The latter being based on the recurring_services::RS_Temp_Stock_IDF field.

image.png.2f09aaa40a299ef2eec38e1e3a9b4b49.png

Share this post


Link to post
Share on other sites
Fitch    148

Not sure it matters or what Todd recommends, but I'd probably attempt to update the parent record first and then the child records. If speed is a concern, do whichever one would fail fastest.

Share this post


Link to post
Share on other sites
sal88    0

Thanks Fitch. One more thing I've wondered about is why, in the case of performing multiple set fields (upon the same instance, e.g. lines 54-58), you don't need to set the $error variable after each set field, is it not possible that line 54 could produce an error but not line 58 (in which case it would not record the error).

Share this post


Link to post
Share on other sites
Fitch    148

Depends how paranoid you are. If the error you're concerned about is record lock, you only need one Set Field to tell you if it's locked. Alternatively, you could use the Open Record script step to test for the lock.

Keep in mind that it's possible to get different errors for different fields, e.g., someone has access privileges to one field but not another. If you have those kinds of concerns, you'd probably need to test each field.

Share this post


Link to post
Share on other sites
sal88    0

Brilliant. The number of users accessing such records is very low (if not 1), even if privileges are in place, so I'll leave it as it is for the moment.

Cheers!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Who Viewed the Topic

    9 members have viewed this topic:
    Jesse Barnum  fishtech  NLR  Ron Cates  Junior360Works  doughemi  Lee Smith  SarahS  Amber360Works 
  • Similar Content

    • By Neil879
      Hi All,
       
       
      I'm fairly new to filemaker and have been developing a database for maintenance parts.
       
      I have a re-order amount for items  and when the re-order amount is reached, the in stock field is highlighted red. 
       
      So here is the  task;  I would like to implement an automated email function where when an items quantity reaches the re-order level an email is automatically sent detailing the product needing re-ordered and it's details (from a product layout). 
       
      I've been looking for examples but can't find details of a conditional email kind of set up.
      Can this be done ?
      And
      Could anyone give me some pointers/advice on making a start on this ?
       
       
      Thanks in advance for any help/advice
       
       
      Neil
    • By Neil879
      Hi all,
       
      Hopefully I 've posted this in the right place
       
      I'm new to filemaker and have been developing a maintenance inventory database.
       
      I have a 'stock transactions' portal where I can add and remove stock. I am having trouble figuring out how to put a condition on the amount in stock where there can't be a negative amount. So if there is a quantity of 2 items in stock, only 2 can be removed. (if someone trys to take 3 out of stock at the moment, the stock amount would go to -1 for example).
       
      Thanks in advance for any help/advice on this issue, I'm still learning so any feedback is greatly appreciated.
       
       
      Thanks
       
       
       
      Neil
    • By FMTom
      Hello - I've hired an idiot.
       
      I mean - I hired this guy to manage our stock control and ensure that when a customer orders a product, the product is popped in a box and despatched out to the right address. Unfortunately the person I hired to complete this task was an idiot. 
       
      We already have a neat FileMaker CRM solution for customers - so I figured I'd build a neat little stock control FileMaker database to help our new employee. 
       
      I admit - I took it a little far. I drew some lines and made some calculations that would rotate and expand the lines to emulate code 39 barcodes so that I could run the filemaker database without having to install fonts. I drew some neat little layouts with photographs of the products, and when manufacturing finished a production run you could enter the number of products produced and the database would create the equivalent number of labels with the barcode on them, format them to print on a standard label sheet, and print the number of labels equivalent to the amount of stock produced. Even if you you printed say 5 labels from an avery label sheet of 8 - you could tell the stock control system to start at the 6th label in and it would work perfectly. 
       
      We then took an old original iPad, popped a barcode reader into an iPad to USB adapter and let our idiot scan the barcodes as stock was despatched or brought in to update the system. I though it worked really well allowing all the folks that used the database to keep track of the amount of stock we had. The whole thing ran wireless, seamlessly integrated, it was beautiful.
       
      I mean - it was almost idiot proof.
       
      Only - as the old saying goes "A database is only as useful as the information in it), and it turns out the idiot wasn't using this iPad and scanning solution and instead filled his days looking at the internet on the iPad.
       
      So while idiot boy is browsing the internet on company time it was decided to upgrade our CRM solution from FileMaker 11 to FileMaker 12. This was for a totally separate reason relating to our CRM database. All the files were essentially updated from FP7 files to FMP12 files. Everything was working from a front office perspective (apart from our storeman who was reading the internet on company time). 
       
      Anyway - roll forwards a few months, it turns out idiot boy is having extramarital affairs with another employee, he's been getting her to do his work, so she's been manually adjusting the stock on her computer, in a slightly related sense, our customers weren't receiving the products they had ordered, it was all being covered up, but thankfully the problem has now gone, and we are free from idiot boy.
       
      In his absence I decided I'd complete a full stock check.
       
      The problem I have is that the iPad and scanner combo still works great. The problem is that as he wasn't using the system, so the iPad still has FileMaker 11 Go installed on it, which won't allow us to open FMP12 files.
       
      I mean seriously - if the guy was even pretending to work he'd have at least updated the software so he could look busy! 
       
      So - I need to install FileMaker Go 12 on the iPad.
       
      Which isn't available on the app store.
       
      But - I could install FileMaker Go 13 which will open FMP12 files on the iPad. 
       
      But - it won't work on iOS 5.1.1.
       
      So I could ask for a copy of FileMaker Go 12 from FileMaker but they tell me that they can't supply this to me.
       
      So… I'm wondering if there is another way? 
       
      I'm currently thinking about asking a friend if they have an original FileMaker Go.app file and seeing if they would send me a copy of this to try and install onto the company iPad. I feel fairly justified in this as the original software was distributed free on the app store and I paid for FileMaker Go 11.
       
      Alternatively - I'm thinking of buying a cheap iPad 2 / 3 on Ebay which will solve the problem but will set me back a fair chunk of cash which could probably be better spent. 
       
      Anyway - if anyone has any thoughts that they would like to share I would be very grateful. Also - please don't hire idiots, you spend so much time trying to clean up afterwards you're better off holding out for an intelligent and considerate person to work alongside. 
       
       
       
    • By Hoopster
      Greetings,
       
      Please don't shoot a first-timer like me...
       
      Here is the thing:
       
      I run a shop of sporting goods and I would like to create an inventory tracking system. Here are some details:
       
      - There are 4 categories:
      1. Shoes, Different brands, different styles, different sizes, different colors.
      2. Apparel, Different brands, different styles, different sizes, different colors.
      3. Balls, Different brands, different styles, different sizes, different colors.
      4. Accessories, various items, Different brands, different styles, different sizes, different colors.
       
      I would like to keep track of the invetory after each operation (entry or sale).
       
      Where do I start?
       
      Many thanks for your help.
×

Important Information

By using this site, you agree to our Terms of Use.