December 6, 200619 yr Newbies Been lurking here for a while, and have learned quite a lot from the knowledgeable people here. It's credit to the programmers at FM and the people here that I've never found a question I couldn't find an answer for - until now! I have an application to automate a repair shop. On the printed invoice that it generates, there is a portal for the parts/supplies that are used in the repair. Some of the parts the customer pays for, but some are simply included in the cost of the repair. The problem is that on the invoice, the customer doesn't need to see a whole list of parts that were used - just the ones that he will be paying for. The rest are there for the internal use of the shop - inventory control, etc. On any given repair there might be 4 or 5 parts that the customer will pay for, and more than a half-dozen they won't. I've been wracking my brain trying to figure out a way to keep those non-billable parts from printing in that portal. They don't have a price associated with them, so the problem isn't differentiating - it's just in getting the app to NOT print those items. Any ideas? -=[ Grant ]=-
December 6, 200619 yr Greetings Grant, This would be a good place to have the portal use another relationship to the line items where the relationship is filtered by some condition. You might have a specific part number that could be used to indicate those items that are shop supplies, or you might just use the condition where only Price > 0 are shown. In either case, you'll need some field on the parent (Invoice) side to hold that filter. A filter field like this is usually a globally stored field, that's populated with the correct value. The relationship then might look like: Invoice <=> Line Items to Print = Invoice::Invoice# = Line Items to Print::Invoice# AND Invoice::gZero < Line Items to Print::Price Where gZero is a global number field populated with a '0'. Notice however, that if your system handles returns with a negative Price, this would fail to show those returns. If this could happen in your environment, you might try a filter on a certain Part Number, or Part Category instead.
December 6, 200619 yr Author Newbies Thanks for the idea! I've done that, and it works - but I've run into a problem and I can't see the cause. Let's say the invoice has 4 billable items. It's showing 4 items, but they're all the same, and are the value in the first found item. For instance: Line 1 in the portal is for Product 1 - and so is Line 2, and Line 3, and Line 4! What'd I do wrong? -=[ Grant ]=-
December 6, 200619 yr Author Newbies Whoops - figured out that I needed to make the fields in the portal come from the new occurrence of the table, not the old one. Silly me! -=[ Grant ]=-
Create an account or sign in to comment