Jump to content
Server Maintenance This Week. ×

Getting a value from previous portal row


freecheese

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

Recommended Posts

This should be simple but I can't find it: this is what I want:

if the value of a field in a portal row (eg. project) is the same as in the previous portalrow then don't display it (using conditional format). Ok how do I grab the previous value?

Pref. without adding fields and stuff, just want to solve it in cond. form.

Link to comment
Share on other sites

Either use a selfjoin based on the foreign key, and GetNth( or a reverse sortorder....

I've just made a template in another thread doing exactly this:

http://www.fmforums.com/forum/showtopic.php?tid/189977/post/266345/#266345

Alternatively, scrutinize this:

http://www.databasepros.com/FMPro?-DB=resources.fp5&-lay=cgi&-format=list.html&-FIND=+&resource_id=DBPros000738

--sd

Link to comment
Share on other sites

Well I took it for granted that this was a developers question, not just the spectator?? If you are the developer why are you baffled from the structural issues??

If you use the separationmodel could you customize the relational structure, further will it allow you to place a button in each portalrow that fires this script:

GTRR(SO)

GetNth( ... ; Get(CurrentRecordNumber)-1)

etc....

--sd

Link to comment
Share on other sites

Thanks for that. Thing is, I'm desperately trying to keep my fields and relationships to a minimum, like most of us I assume. This issue is for the sake of beauty. I want it to look like a summary.

If I had FM9 adv I reckon I could solve it with a custom function. We'll see

Link to comment
Share on other sites

I'm desperately trying to keep my fields and relationships to a minimum, like most of us I assume

Lets establish something here, they are not arbitrarily thrown in ... it's always a weighting against substantial scripting ... a propper normalized system tries to put a lid on excessive scripting, since the goal is to prevent any kind of syncronization as such. You kind of makes the utilized relations something like this:

http://www.ovalbooks.com/bluff/Relationships.html

Take a look at Harris text here - he of all have a balanced view on datamodeling - and knows when take things with a grain of salt!

http://www.digfm.org/ref/FM7_key_concepts.pdf

But as such, should we use just enough TO's to facilitate a functionality ... instead of a deliberate gynecologist approach!

--sd

Link to comment
Share on other sites

If I had FM9 adv I reckon I could solve it with a custom function.

I don't think so. You could, however, do this with a single calculation field (at least, in version 8.5 you could - it might not work in version 8).

The trick here is that an unstored calculation field using GetNthRecord(), when placed in a portal, is evaluated from the point-of-view of the portal (including the portal's sort order).

GetNthInPortal.fp7.zip

  • Like 1
Link to comment
Share on other sites

at least, in version 8.5 you could - it might not work in version 8

It's working but not properly. Going to check right now. This is definitely a nice one!!

Think I can do it with custom and listfunction.

Work out where I am (this portal carries no more than 50 records on average), go one back in the list, get that value and give it to my cond. format friend.

Otherwise, there's this solution which I reckon is better than using a custom function. But it's in my head so got to ty it... got to find FM9adv first though

Thanks

Link to comment
Share on other sites

btw I'll read those Key Concepts. Been a FM user for a long time but never did any reading on it. Self taught, and mainly working from (own) experience. The tricks I pulled to work around FM's interface shortcomings are numerous but they have mainly taught me to not do it. Accept FM as it comes... or don't use it. Now with FM9 I'm amazed with the fact that I'm still using System 7 checkboxes and scrollbars. To be honest I can't fargin believe it!!!!!!!!

Who remembers Hypercard? In Hypercard you'd have external functions and commands. This gave a lot of control over interface issues. You had all the sliders, faders, switches and buttons you'd wish. I could make a gantt chart in Hypercard. Now in FM9 I'm finally able to do a simple gantt chart thanks to my new conditional format friend.

What I'm trying to say here (-sd) is that I've got a hate/love relationship with FM (and that's a AND relationship, not an OR). Maybe I should try Xcode? So as I said, let me ll read into the 'proper' use of FM first....

Link to comment
Share on other sites

In Hypercard you'd have external functions and commands

Well it kind of still exists...

http://www.runrev.com/newsletter/april/issue24/newsletter1.php

http://www.runrev.com/newsletter/may/issue25/newsletter3.php

http://www.runrev.com/newsletter/may/issue26/newsletter3.php

...with filemaker as backbone.

Maybe I should try Xcode?

Should you?? The issue was to optain OR relations, Xcode is a very different beast ...you must buy libraries like say:

http://www.paradigmasoft.com/en/products/developer/adk/VSDK

Just to make, what the compiler spits out, behave like a database in the first place!!!!

--sd

Link to comment
Share on other sites

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