Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Simple (!) find query


doctored

Recommended Posts

Could someone give me a nudge in the right direction on this one please.

In an acupuncture database, I have two tables - one for 'Patients' which includes a field for 'treatment area' - the rough area of the body in which they have pain.

I have a separate table called 'Points' which lists all the acupuncture points, and also has a field called 'area' - the rough area of the body in which the needling point lies.

I want to do a simple script (I think) and place a button on the 'Patients' main layout which will switch to a layout displaying 'Points', but only those with the same 'area' field as the patient. So I get someone with a sore shoulder, and can bring up a list of points that are around the shoulder.

I'm sure this is too simple for words, but I'm getting bogged down in the script. So far I can go to the correct layout and enter the 'Find' mode, but then I get stuck.

Thanks!

Link to comment
Share on other sites

...and as a follow-on to this, when I do a 'Search' from a list of records, I can't seem to find the right button to hit to do anything useful with the results. So say I do a search for 'knee' on my list of 350 acupuncture points, I get a return of maybe 20 records. I know I can constrain or expand the 'found set', but I'm assuming I can also save the results as a search to do again, or save the records as a separate set somehow. Just can't figure out how to do it.

And I know I must be missing something fairly fundamental here, cos this is what databases are all about!

Link to comment
Share on other sites

Saving found sets is not a trivial matter. And it's entirely different from storing Find criteria.

 

The easy thing to do is store Find criteria in scripts. The general syntax for this is:

 

Enter Find Mode[]

Set Field[yourField; yourCriteria]

Perform Find[]

 

If you want to allow user-specified criteria in a Find Screen, then return to a Results List, the Find script might look something like:

 

Go to Layout [Find Screen]

Enter Find Mode[]

Set Field[yourField; defaultCriteria]

Pause Script[indefintely]

Perform Find[]

Go to Layout[Result List]

Link to comment
Share on other sites

Thanks.

I think I'm nearly there with this, but must be doing something stupid. The script I have throws back the search result of "1" which it pastes into the search field. Obviously nothing matches that.

The problem must be in the line of script to do with setting the field. At the moment I have:

Set Field [Points::InterestArea = PatientDetails::MainComplaintArea]

These are two identical and linked fields from two tables, Points and PatientDetails.

I've set this as a calculation, but not sure if this is right - obviously not!

Do I need to be doing something with portals here...?

Link to comment
Share on other sites

That was it!

I got the feeling I was over-complicating things greatly. All I needed was to set up a portal display of the related records from 'Points'.

I'm just getting used to the idea that you can have more than one copy of a table in the 'Relationships' graph too.

Anyway, thanks for the help.

Portals. Must remember that...

Opps!

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

Terms of Use