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

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

Recommended Posts

  • Newbies
Posted

I would really appreciate help on this, any questions - please ask!

database...#########################################

table 1

id client

joining date [e.g. 25/03/2001]

table 2

id client

statement date

status

relationships

table1::id client = table2::id client

#######################################################

We need a script to find all records in table2 which are related to the current record in table1

and

whose statement date is before last occurance of the joining date [e.g. if joining date was 20/01/2003, then the last occurance of 20th January]

and

whose status is blank

Cheers,

Matt

Posted

I would guess that deciphering this script makes you grasp the idea, instead of me trying to explain it:


If [ Count ( theRelated::BelongsTo ) ] 

          If [ IsEmpty ( Get ( ScriptParameter ) ) ] 

                    Perform Script [ "TheWorks"; Parameter: theMain::aSearchValue ] 

          Else 

                   Go to Related Record [ From table: "theRelated"; Using layout: "theRelated" (theRelated) ] [ Show only related records ] 

                   Enter Find Mode [  ] 

                   Set Field [ theRelated::aValue; Get ( ScriptParameter ) ] 

                   Constrain Found Set [  ] 

          End If 

End If 

--sd

  • Newbies
Posted

hey.. many thanks for that Dyhr..

As I'm not quite following the scripts, could you possibly give me a brief idea as to which bit does what?

Many, many thanks...

Matthew

Posted

Alright there is a considerable amount of socratic noise in the script, the gist of it is only GTRR(SO) and Constrain Found Set ...but if you take a look at outmost condition, if it weren't there at all will a search jump to a record in which one of the portal records matches.

The noise is the recursion in the script that picks a value to seach for, and it's so that first looping is the parameter empty ...you could have plucked the value instead over the relation since the bidirectionality would work. But I've just for teasing thrown in the recursion.

--sd

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