Jump to content

This topic is 7884 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I want to have a field that show the last related record from a relationship:

The mysterious field [:] must contains [facture::no.facture] wich is the related field that containt serial number like F-128

I search but found not any kind of "show last related record" function

Posted

I don't think that the function that you describe does exist.

But what you might want to achieve has been described

here ,

here ,

and on numerous other places in this forum.

Regards,

Ernst

Posted

You can use the Last() function. The documentation only lists it as a function for repeating fields, but it works on related fields too:

Last(TheRelationship::TheField)

Posted

That was quick !!

But i discover that it's not what i want want exactly.

But it works great!!

Thanks

But can i do the same by confirming that the [facture::no.facture] is matching the date of my current record file

Posted

Hi Jofftan,

I think we can put this together for you. But the guys need some clarificaton:

"The mysterious field [:] must contains [facture::no.facture] "

Are you saying that Facture is the name of your dB? Or a field? Or does the field contain the words 'facture'? Or are you saying that it is the last record because it's not empty or last in a series of serial numbers?

To isolate the last 'facture' record for each UniqueID, we need these answers. We also need to know the data type of 'facture.'

You can go ahead and create a self-join on your UniqueID. Once we have answers to the above questions, we can give you a calculation for your 'mysterious field.' cool.gif

Hey Ugo! What's Invoice got to do with this? confused.gif You been into the whacky tabacky or is your mind still on Jason's post? grin.gif

Anyway, the calculation (data-type unknown at present) would be as Bob indicated, depending upon your answers to our questions.

LaRetta

Posted

Hmmmm, well I'd probably flunk this English lesson. But you know us Americans - we always do things a bit differently.

Worked in offices 35 years and haven't a clue what you're asking! Do you mean re-invoicing or grin.gif re-facturing grin.gif Or Outstanding Invoices? Everyone that owes a business money is known as Accounts Receivable or "Receivables"?

Nope, I don't know the answer. laugh.gif

Must be too many long FM hours lately!!

LaRetta

Posted

<< Are you saying that Facture is the name of your dB? Or a field? Or does the field contain the words 'facture'? Or are you saying that it is the last record because it's not empty or last in a series of serial numbers? >>

Facture(or invoice for it's translation) is the name of the DB. And last record is meant to get the last serial number.

To isolate the last 'facture' record for each UniqueID, we need these answers. We also need to know the data type of 'facture.'

It's a simple text data type

Posted

Hi Jofftan,

Okay, no self-join. You have a related file. smirk.gif

If these two dbs are currently joined on a FactureID (I neglected to ask how they were currently joined - mostly because I didn't know Facture was a db) and you have a field 'serial number' and want the last (largest number), you can use THAT existing relationship to get your calculation.

Last(Facture::SerialNumberFieldName)

If the existing relationship is based upon a FactureID, and you want to know the last FactureID in the whole facture db, you need a new relationship. Create a constant key calculation (number, index ON) = 1, join them, and create your calculation on that relationship as:

Last(NewRelationship::FactureID)

Last returns the same data type as the field. So if the 'serial number' field is text, the calc should be text. If the serial number is number, calc should be number, etc.

You can always help me out, guys!! grin.gif We're still missing a piece here!

LaRetta

Posted

Oh, I see it! "must contains [facture::no.facture]"

no.facture is the name of your serial number field which is text!

Okay, use your existing relationship.

Create a calculation (text, unstored):

Last(Facture::no.facture)

LaRetta

Posted

Another piece missing to that puzzle...

But can i do the same by confirming that the [facture::no.facture] is matching the date of my current record file

:?

Case(FactureN

Posted

No Ugo, I'm the one that got lost. crazy.gif

I didn't see the 'Date' part at all.

I guess I'm beyond tired. Time to back off FM for a few days and recover my wits. I hope I didn't confuse Jofftan too much.

LaRetta

Posted

Hi LaRetta,

RE: I guess I'm beyond tired. Time to back off FM for a few days and recover my wits.

You have been posting alot lately. I also at times spend to much time working on Filemaker databases. Sometimes it is good to just take a break for a few days. It is the 4th of July weekend. Enjoy yourself!!

Michael

Posted

Hi Michael,

Hey, thanks for the words. I'm on a deadline (beta due Monday) and then ... well, I see these posts, and I get side-tracked!!! I have to read and understand everything that is posted.

24-7 causes brain-death and lousy design. You are absolutely right. I'll try to not think about multikeys or Value Lists or x-plat problems or anything for at least ... maybe a day! grin.gif

LaRetta

Posted

I'll try one last shot

Facture db

with those fields

[delivery date]

[factureID]

Hosting db

with those fields

[active date]

[factureIDrel]

In Hosting db

Now i want the [factureIDrel] to show [facture::factureID] if [facture::delivery date] match [active date]

The 2 db are link in a relationship

Pretty schematic but i think it's more clear that way

Posted

Hi Jofftan,

I'm glad you came back and that you're trying again. Sorry for the confusion. I won't attempt to answer you though, wouldn't be good for you. smirk.gif

The guys will step you through this one!

All the best,

LaRetta

Posted

What do you call when you recall a customer that owes money (from my last answer to Jason) ?

Ugo, maybe you are referring to a "statement" which is usually issued monthly, and contains a summary of all invoices and payments (and of course, interest charges)?

Posted

Jofftan !

What on hell are you trying to say ?

Could you just summarize in "words" what you are attempting. I have no clue about what could your Hosting db do, nor what is about the delivery date.

Just put it like "I have a file for my deliveries, and a file for may invoices. They are linked from two fields, which are...

I want to be able to..."

Currently, it sounds like "Guess what I'm trying to do ! " crazy.gif

This topic is 7884 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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