Jump to content

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

Recommended Posts

Posted

Hi,

I'm having a problem with the following line. I have a file sales, which has a relationship to data_5 (sorry for the name), data_5 stores all the individual items. What I do on my command to print an invoice is:

Go To Related Record, Show Only Related Records, Match Found Set, From Table data_5, external, using layout :P current layout.

Right when I do this (going in debug mode) it adds an extra blank record in data_5.

I don't know why it does that or how I can get rid of it? Does anyone maybe have an idea?

Thanks

Robin

Posted

Umm, whats your relationship based on and are you 100% sure your blank record isn't related?

Posted

Hi,

The relationship is based on the salesnumber, and the blank record indeed has the same salesnumber (so an extra line gets added in data_5 with the same salesnumber as the record I was working in. The thing is that I don't understand WHY it would make a new record, I'm not telling it to, right?

Thanks for your help.

Robin

Posted

Well, the record won't just generate it self -- you must have created it somewhere and not noticed it?

Try deleting the "blank" record and see what happens.

Posted

Hi,

Yes, I can indeed delete the record, but I can see in the scriptstep that it gets added right when I do the scriptstep go to related record (I can see it coming in in debug mode). That's really weird I think.

Robin

Posted

Go To Related Record, Show Only Related Records, Match Found Set, From Table data_5, external, using layout :P current layout.

Are you 100% sure there's nothing in your script but that one GTRR step?

Posted

I'm pretty sure, but it doesn't make sense, I'm going to look at the process again then, maybe I can see some other bug..

Thanks for your help, and I'll post back within an hour.

Robin

Posted

Now it's making more sense, that was not the problem. Sorry, that was my mistake, it was doing it before, the problem is that it's not going out of the record. So I only see it when it's out of the record.

The problem that I have that I first make a new row in data_5, then I do some processing and at the end I say go to portal row 1 (which is supposed go to the first one I created and put the info in there), but because the row in data_5 is still active, it creates a new line automatically. Is there a way to still stay in the correct row in data_5 but not make it active so that it's still possible to write in there?

Where it really goes wrong is:

Go to Field :P Data_5_Invoice no::Stock_SellPrice

Go to Portal Row : No dialog; Sales::-Temp (a global that I use to store the number, I'm monitoring it, and it's 1.

Set Field Data_5_Invoice no::Stock_Code; Home_Constant 1::-Temp3

With this last step it adds the new record instead of writing in the record that has been created before. Anyone knows a solution for that?

I'm sorry for the bad names of the files, I didn't do it, it was a consultant who I guess didn't want anyone to understand his code :-)

Thanks

Robin

Posted

A relationship can be defined to have a sort order and a portal for the same relationship can have another sort order - neither of which need to be the order of creation.

Consequently the target portal row you are chasing will change from the original entry as the relationship (or the portal) will re-sort before you "Go to portal row" next time.

I hope your working with a copy of the files.

Posted

Yes, I'm totally offline now working with a copy.. So you suggest changing the relationship, because the -Temp value is changing all the time, from 1-2-3 in the right order, and it's creating everything right (except for the first time where it adds an extra line).

Robin

Posted (edited)

Oh and I'm not sorting in the relationship itself, should I change that? The current relationships look like this:

http://robin.saestudent.com/Sales.png

http://robin.saestudent.com/Data_5.png

Thanks

Robin

Edited by Guest
Posted

I see that the relationship is not sorted however don't forget that the PORTAL may also be defined to have a sort order - check the definition.

Use the script debugger to watch what happens very closely - use F6 to step through every line.

Posted

I did that a few times, I'll write down what happens.. I'm watching both sales (where the portal is and where I create the new record) and data_5 where the records will get added.

First I check if it's the first record for that invoice (first item). If it is the first, I do:

- New Record/Request

- Then I fill it with the invoice number and name of client (set fields)

- The I go to Portal Row First (goes to the new record I just created)

- Then I open a new window to specify the item to go in the invoice and put this in a global field

- I select my sales window again, go to Portal Row (1), and then use a Set Field to put in the data.

Right when I do the set field, instead of putting it into the record I created before, it creates a new record to put it in.. I don't know why..

Robin

Posted

Oh I see, no problem :P-) I even changed it to go to portal row first and even then it creates a new one. Is there anyone who wants to take a look at the code (offline please)?

Thanks

Robin

Posted (edited)

Hi Robin,

I noticed something which might cause you problems in the future:

Go to Portal Row :P No dialog; Sales::[color:red]-Temp

If you have indeed started your field name with a dash, FileMaker will change it (within the script-step) to Sales::${-Temp}. It still jumps to the correct portal row (which surprised me) but it can cause you problems in the future (when referenced within calculations).

I simply can't envision what you are doing (or why). If you send me a private message and attach the files, I'll take a look for you.

LaRetta :wink2:

Edited by Guest
Posted (edited)

Hi Robin,

If you want Mark (IdealData) to take a look at the file (and i'm sure he'd be happy to help, though he does seem pretty shifty : jk jk ) just private topic him (click his name and then choose start private topic).

Let us know if you work out the solution.

EDIT: Lol, LaRetta's pretty shift too :

EDIT, EDIT: Just to make sure you understand that was a joke, despite the various tongue smiley's -- they are both very trust worthy, If any one's shifty, it's me :P

Edited by Guest
Posted

Thanks, I couldn't upload the files (I'm using JobPro Central), but I've upload screenshots of the script where it's happening :P robin.saestudent.com/FM.zip

I'm not really using a -, I'm actually using a tilda, but I'm using a dutch keyboard which doesn't have a tilda hear, I know the naming is not perfect, I wasn't the one who first created it :-) Thanks for all your help and I hope somebody can find his way through the screenshots..

Thanks

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