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

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

Recommended Posts

Posted

Is there a way to import one file and have it write records to multiple files. I have an old flat file I'm converting that contains item information along with master information on the same record I.e. all of the costs and charges are the on the record along with customer info, shipping data etc...). I'm going to create relational data from this one import file. What I want to do os import the file and have it automatically create child records on the related files. For insatnce, I want to import the data and create the Master record and then have the import populate the cost file and the charges file at the same time.

How would I set the value of the of the related fields to the imported fields?

Thanks

The Mad Jammer cool.gif

Posted

You can also just import into the parent file the parent field data and delete duplicate records. Then import again into the child file(s) the child field data. Make sure you import the key field into both parent and child files so you have something to relate the files with.

  • 3 weeks later...
Posted

I tried the scripting Transpower described but it didn't work. I imported all the data into a master file and defined a relationship with a child file based on the record number of the master file. I also defined a relationship in the child file back to the master file using the master record number.

I then wrote a script in the master file that tests the field(s) I want to populate my child file with and if there is anything in the field, execute a script on the child file that creates a new record and populates the fields. The problem is that the fields weren't populated on the child file. Here is the script on the master file

If isEmpty("Cost1")

Exit Script

End If

Perform Script[sub-scripts, External:"cost.fp5"]

In the child file I have the called script

New Record/Request

Set Field ["rel_Rec_Num", "master::Rec_Num]

Set Field ["Cost_Type", "Cost 1"]

Set Field ["Cost_Amt", "master::Cost1"]

Needless to say, a record was created but the only field that was populated was the Cost_type field because it was hard coded text. Why didn't the other two fields get populated?

The Mad Jammer cool.gif

Posted

The other fields did not populate because you are referencing a relationship that does not yet exist between this record and the master file. Therefore, unless the fields are globals, related data cannot be passed.

Instead, try

If [isEmpty(Cost1)]

Exit Script

End If

Set Field [global_Rec_Num, Rec_Num]

Perform Script [External: "cost.fp5"]

New Record/Request

Set Field [rel_Rec_Num, master::global_Rec_Num] <- globals can be passed using even currently invalid relationships

Set Field [Cost_Type, "Cost 1"]

Set Field [Cost_Amt, master::Cost1] <- should work now, because the relationship was established when rel_Rec_Num was set with the global

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