Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

Searches in custom functions?

Featured Replies

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.

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.

  • 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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.