Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi,

In a solution, I need a technique to identify when all related records have moved from step 1 to step 2.

There are 3 tables involved: Projects, Invoice, Lines.

The relationship from Invoices to Projects is one to many, so it is from Projects to lines.

So, an invoice is composed of one or more lines, of one or more projects. The process is all done from the invoice table:

- The user creates an invoice

- The user selects from a portal of availabe projects. Only available projects are shown.

- For each project the user selects, only the available lines are shown

- The user selects one or more lines from the selected project. This lines are added to the invoice and marked as not available.

My problem is that I need a way to identify when the user selects the last available line in the project. When this happens, the script should also mark the project as not available. I have not managed to find an easy way. I would like to avoid complex calculations at all. I am sure somebody from the forum has found himself/herself confronted with this issue.

Any ideas?

Thank you very much

Posted

Make an extra TO and relate it with the opposite sortorder, first record will then be the last created...

--sd

Posted

Thank you Søren,

Just to make sure I understand your proposal: do you mean using that new TO for comparing the ID of the first record in that TO with the ID of the record being assigned by the user? Then, if both IDs are identical, then this record is the last record available.

Is that what you have in mind?

Posted (edited)

Try to investigate this - hopefuly isn't the download on the blink yet?:

Ah!!!! - It's still not working, So - dupe the TO for the portal, if necessary put a serial ID in the portal records and update the field with a Replace, if they aren't there. The new TO is the related as the old one but with a sort in descending order... set up in lower right corner of the relations def.

--sd

Edited by Guest
Posted

Hi,

I have had a go at the situation,

See attached (though from Soren's note I hope you can download - if not I will upload again if necessary)

I think it does what you described...

There are some really clever guys and girls on here who have masses more experience than me so they may well have some insight that invalidates my approach (comments invited)

HTH

Posted (edited)

Thank you Simon,

I am having a look at your sample file. It looks great at first glance. I will get back to the forum once I understand its logic.

Thanks again for your sample file and for your effort to upload it even when the link was not working.

PD: Thank Søren, but I was unable to download your file. I do not know what is wrong with the link. Some links seem to be working, others not. Strange. Maybe the forum administrator could take a look... B)

Edited by Guest
Posted

Hi Bluearrow,

Thanks for looking at the file, after posting it I had some further thoughts and have created a new topic to explore what might be "not the best practice in my demo file"

The issue appears to be whether you should script the creation (and subsequent editing of) the flag that marks a project as complete vs the management of the situation via relationships only.

(My demo is also slightly "flicky" which could well be a by product of the above)

The new topic is in Relationships forum under the heading "Scripted tagging - a big no-no???" and I think the link is at:

http://www.fmforums.com/forum/showtopic.php?tid/191906/post/275200/#275200

I am looking forward to improving my FM skills in what is obviously quite an important design area.

Simon

Posted

Try to investigate this - hopefuly isn't the download on the blink yet?B)

--sd

Søren,

In the light of the new thread, would it be too much to ask you to try to upload the file again? I think it might be useful to understand your reasoning in the new thread (at least for me)

Thank you

This topic is 6190 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.