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

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

Recommended Posts

Posted

Hi all,

In my solution for managing my clinic I made a single step script (that is triggered by a button in the portal) to import records from a portal row to another table portal row using import records step, all of a suddenit stopped working, I tried the script debugger, sometimes no error occurs but records are not imported, other times error 729 occur..any suggestions?

Posted

The best way to diagnose this is if you can post a pdf of the script or a screen shot of the script.

Posted (edited)

the script supposed to import some fields from this portal on the right side

2015-07-30_0-41-33.thumb.jpg.9ab42285b5b

to this portal in the same layout "semen analysis"

2015-07-30_0-42-17.thumb.jpg.f8294fa813f

the single step is

2015-07-30_0-42-51.thumb.jpg.3f73ce18861

I import from the same file without dialog, using matching records depending on the field occuring in the relationship and adding the rest of records as new records..It was working just fine till yesterday..I did nothing in the database except a couple of new scripts.

Edited by a7madmotaw3
Posted

Tough to say are any of the target fields have any validation (such as unique),

Also if you are importing from TableA - to TableB in the same file you need to establish a found set context otherwise you will import EVERYTHING or nothing.

Before the import you should do a GTRR for the portal who's data you wish to import going to a "utility layout" then you can import that found subset of record into TableB then return to your main layout.

Posted

I revised the validation and no unique values or something is there, regarding the importing of everything, I was only updating the atching records with the data I've just entered in the first record, so when using the same file to import from tableA to tableB depending on that, it was supposed to just add the new data which was exactly going well.

Would u plz give me an example of the script that can copy the fields in the portal row (on which the button triggring the script is pushed)

r.thumb.jpg.2bc57b484c9e0018a866ea6db6a7

to another portal going to a next record automatically

rr.thumb.jpg.a75b76af4449c347f537004293a

Posted

Hi

thanks a lot for your help but it still not working and I think am doing something wrong..I need to clarify to you that all the tables in my database are related through a unique field "pat no", my main table "androdatabase" (which is table c in ur example) is related to visits table (in ur example tableA) and to semen table (tableB in ur example).

I made a globale field in Androdatabae table (= tableC) and related it to visists table (=tableB) through the same field and named visits table in the new relation (visits_selected) and still not working?!2015-07-30_14-25-18.thumb.jpg.25ffcb2b652015-07-30_14-25-37.thumb.jpg.0a0e7cac01

Posted (edited)

Database 101 - every table should contain a Unique ID (serial number or UUID).

When you are on androdatabase and then click the button on a row in portal attached to visits the goal here is to set a global temp field of that row's unique ID or serial. 

This establishes a 1:1 relationship to visits_selected where the script then can isolate that one record and allow for the import of this record into the semen table

using your pat no will not work because every record in every child table is already assigned to this value.

alternatively you can also do this without a temp field or relationship by doing a find request for that unique record number in the visits table to isolate the record. (but we still need a unique value) 

Just looking at your graph, as a suggestion you may wish to take a moment and rename your primary key field and the foreign key fields for consistency and clarity, in each table and avoid the apostrophe in field names if you venture into using SQL or other technologies or plugins or web will be problematic. I don't think upper or lower case poses an issue but you having a unified nomenclature can save your sanity ;) 

I currently see:

  • pat id
  • Pat's ID
  • patients no
  • Patient's No
  • Pat's Id
  • pat's id
  • patients No
  • patient's ID
  • pat's ID
  • patients no

reference may be helpful http://filemakerstandards.org/display/cs/Field+naming

Edited by Ocean West
added alternative method
Posted (edited)

Am really grateful for ur help and patience..I went with ur valuable advice and renamed the fields with unique names and created the global field and the unique id field for the visits table and I think I did everything as it should be but still not working, am getting nuts so plz don't get bored1.thumb.jpg.2b1a3ed50ebb2940761aa5bd59082.thumb.jpg.eff145c85a75a2dc739c02f92f893.thumb.jpg.e2b7fec872cb1ab688adbeaa527b4.thumb.jpg.e7a1b833a800607c3fb82a7ac8c85.thumb.jpg.373af28bc590f3a39c3c198485416.thumb.jpg.7cc5ddb4c38342c6e4ba2b8b6fff

 

1.jpg

Edited by a7madmotaw3
Posted

when labeling the fields using the term "UNIQUE" in the name for a foreign key is a bit missleading - because the nature of a foreign key is that it is not necessarily unique.

Also remember field types between primary and foreign keys used in a relationship should be of the same type - text or number. 

In addition I added the alternative approach to using a FIND method,

And also yet another approach by just storing values in variables and setting field (no import) - this works but it depends on how many fields you need to set.

I revised the sample file using your table names and appropriate primary and foreign key labels. 

 importSample.fmp12.zip

Posted

I appreciate your effort but it seems there is something in the structure of the database that prevents the three scripts from working..if u please I could send you a clone copy of my solution to help me solve this out

Posted

i sent you you file backchannel.

the reason for the import error was one field had a validation for "REQUIRED" which had no data in it from the import, that caused it to fail.  

In the file I sent i went with the Set field option as it is most appropriate in this case as there is less that can go wrong. 

  • Like 1
Posted (edited)

thanks for ur great help in the previous issue.

I have a more simple one 

I have a repeat field with a value list that includes 2 values "1ry infertility and 2ry infertility" and other values, i need to hide a popover button depending on the absence of the world "infertility" from this repeat field,

 I used the calculation 

IsEmpty ( FilterValues ( patients::Complaint ; "infertility" ) ) to hide the button using hide object function in the inspector, but it didn't work

Edited by a7madmotaw3
Posted

when testing things against a repeating field you may need to use the Extend ( ) function 

PatternCount ( Extend ( patients::complaint ) ; "infertility" ) = 0 

(i haven't tested this one yet - and haven had my coffee either ) 

Posted

I found that with the above calc  the button appear only when "infertility" is present in the 1st repeat field but not when in the 2nd or 3rd..Is there a modification that could be done?

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