dbTalk Databases Forums  

Helpful Harry

comp.databases.filemaker comp.databases.filemaker


Discuss Helpful Harry in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
D
 
Posts: n/a

Default Helpful Harry - 08-03-2005 , 08:45 AM






Hi Helpful Harry

Just return from my summerholidays :-)

I tried to implement the If sentence to avoid the empty records, however I
cannot get it to work.

E.g. in case of a portal with 3 rows, it copies all 3 rows to
Fakturaer::Varenr1, Fakturaer::Antal1, Fakturaer::Varenr2,
Fakturaer::Antal2, Fakturaer::Varenr3, Fakturaer::Antal3.
However all of the rest from Fakturaer::Varenr4 to Fakturaer::Antal20 are
filling in with the contents of the last row in the portal, which in this
case corresponds to Fakturaer::Varenr3, Fakturaer::Antal3.

It seems that the If sentence only tests the first Portal row by testing
Linier:Varenr. Can Linier::Varenr be tested row by row in the portal - in
the form of Linier::Varenr[2] or ..?

Quote:
It will still go through all 20 rows looking for data before going on
to the next record, but itīs really not worth complicating the script
to avoid that ... unless itīs going to be run often and most of the
records only use a few portal rows.
That is the case. Maybe it would be an idea to test how many rows the portal
contains, if that is possible? And then only transfer the number of rows to
the table (Fakturaer), which are available.

Go To Record / Request / Page [First]
Loop
Go To Portal Row [No dialog; 1]
If [not(IsEmpty(Linier::Varenr))]
Set Field [Fakturaer::Varenr1; Linier::Varenr]
Set Field [Fakturaer::Antal1; Linier::Antal]
End if
Go To Portal Row [No dialog; 2]
If [not(IsEmpty(Linier::Varenr))]
Set Field [Fakturaer::Varenr1; Linier::Varenr]
Set Field [Fakturaer::Antal1; Linier::Antal]
End if
Go To Portal Row [No dialog; 3]
If [not(IsEmpty(Linier::Varenr))]
Set Field [Fakturaer::Varenr1; Linier::Varenr]
Set Field [Fakturaer::Antal1; Linier::Antal]
End if

...

Go To Portal Row [No dialog; 20]
If [not(IsEmpty(Linier::Varenr))]
Set Field [Fakturaer::Varenr1; Linier::Varenr]
Set Field [Fakturaer::Antal1; Linier::Antal]
End if
Go To Record / Request / Page [Next, Exit After Last]
End Loop

Thanks

Daniel





Reply With Quote
  #2  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Helpful Harry - 08-04-2005 , 01:59 AM






In article <42f0ca93$0$189$edfadb0f (AT) dread11 (DOT) news.tele.dk>, "D"
<d (AT) msn (DOT) com> wrote:

Quote:
Hi Helpful Harry

Just return from my summerholidays :-)

I tried to implement the If sentence to avoid the empty records, however I
cannot get it to work.

E.g. in case of a portal with 3 rows, it copies all 3 rows to
Fakturaer::Varenr1, Fakturaer::Antal1, Fakturaer::Varenr2,
Fakturaer::Antal2, Fakturaer::Varenr3, Fakturaer::Antal3.
However all of the rest from Fakturaer::Varenr4 to Fakturaer::Antal20 are
filling in with the contents of the last row in the portal, which in this
case corresponds to Fakturaer::Varenr3, Fakturaer::Antal3.

It seems that the If sentence only tests the first Portal row by testing
Linier:Varenr. Can Linier::Varenr be tested row by row in the portal - in
the form of Linier::Varenr[2] or ..?

It will still go through all 20 rows looking for data before going on
to the next record, but itīs really not worth complicating the script
to avoid that ... unless itīs going to be run often and most of the
records only use a few portal rows.

That is the case. Maybe it would be an idea to test how many rows the portal
contains, if that is possible? And then only transfer the number of rows to
the table (Fakturaer), which are available.

Go To Record / Request / Page [First]
Loop
Go To Portal Row [No dialog; 1]
If [not(IsEmpty(Linier::Varenr))]
Set Field [Fakturaer::Varenr1; Linier::Varenr]
Set Field [Fakturaer::Antal1; Linier::Antal]
End if
Go To Portal Row [No dialog; 2]
If [not(IsEmpty(Linier::Varenr))]
Set Field [Fakturaer::Varenr1; Linier::Varenr]
Set Field [Fakturaer::Antal1; Linier::Antal]
End if
Go To Portal Row [No dialog; 3]
If [not(IsEmpty(Linier::Varenr))]
Set Field [Fakturaer::Varenr1; Linier::Varenr]
Set Field [Fakturaer::Antal1; Linier::Antal]
End if

...

Go To Portal Row [No dialog; 20]
If [not(IsEmpty(Linier::Varenr))]
Set Field [Fakturaer::Varenr1; Linier::Varenr]
Set Field [Fakturaer::Antal1; Linier::Antal]
End if
Go To Record / Request / Page [Next, Exit After Last]
End Loop

Try this one instead:

Go To Record / Request / Page [First]
Loop
Loop
Go To Portal Row [First]
Set Field [Fakturaer::Varenr1; Linier::Varenr]
Set Field [Fakturaer::Antal1; Linier::Antal]

Go To Portal Row [Next, Exit After Last]
Set Field [Fakturaer::Varenr2; Linier::Varenr]
Set Field [Fakturaer::Antal2; Linier::Antal]

Go To Portal Row [Next, Exit After Last]
Set Field [Fakturaer::Varenr3; Linier::Varenr]
Set Field [Fakturaer::Antal3; Linier::Antal]

...

Go To Portal Row [Next, Exit After Last]
Set Field [Fakturaer::VarenrX; Linier::Varenr]
Set Field [Fakturaer::AntalX; Linier::Antal]

End Loop
Go To Record / Request / Page [Next, Exit After Last]
End Loop


The "Exit After Last" option will automatically cause the script to
jump out of the inner loop once it hits an empty portal row (or ther
are no more portal rows).



Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #3  
Old   
Daniel
 
Posts: n/a

Default Re: Helpful Harry - 08-04-2005 , 03:21 PM




Quote:
The "Exit After Last" option will automatically cause the script to
jump out of the inner loop once it hits an empty portal row (or ther
are no more portal rows).

Hi Helpful Harry

Thanks a lot for your help.

It worked and merged 5162 invoices from an ERP system to a Filemaker
database!

/Daniel




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.