February 21, 200619 yr Hey, Is there anyway to do searches or anything that looks like searches in a custom function? What i want to do is to have a custom function that calculates availability for an article between and startdate and an enddate. Available(ArticleNumber, StartDate, EndDate) Right now i do this in a script and therefore have to "push a button" everytime i want to run that script. It's done by going thru the ArticlesOut table where an article is saved with ArticleNumber, StartDate, EndDate and NumberOut. This probably doesn't make any sense but hopfully someone can answer.
February 21, 200619 yr Via a relationship you can make it automatically "find" something in a portal. But no, there is no actual "Find" in a Custom Function. If you post your file, or try to explain a little bit more, I'm sure we can help you more. A few things you might want to answer: 1. What criteria is your "find" based on? 2. You said calculates availiablity, what is this based on? Just the start date / end date, or is there more.
February 21, 200619 yr Author Im sory but i can't post the file. I'll try to describe it better. Three tables. Articles - ArtNr - Quantity Bookings - BookingID - BookingStartDate - BookingEndDate BookedArticles - BookingID - ArtNr - BookingStatDate - BookingEndDate - BookedQuantity There is a relationship between Bookings and BookedArticles (BookingID = BookingID). What i do in the file now is that when a user try to book an article (say artnr is ABC and Quantity is 10 of that article) i perform a script that searches thru BookedArticles to find any recrds of ArtNr that are within the dates that the user is trying to book the article. Then i calculate the BookedQuantity and substracts that from Articles:Quantity and have the quantity of articles available. If i somehow could have a custom function to do this the i could add that do a calculation field and then have the user see this calculation before they push the button and try to add it to a booking.
Create an account or sign in to comment