KeyField and Updating Multiple Records in FM

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

KeyField and Updating Multiple Records in FM

Jeremy Reynolds-2
I have two questions about updating multiple records in FM.

1. Currently what I do is have a calculation field with the definition  
Get(RecordID) and use that as my KeyField
Any time I have tried to use a customized ID value, it fails to work.  
Am I correct in this belief that using a calculation is the only way  
to get it to work?

2. In the past, if I have wanted to update more than one record, I  
loop through my -Update block of code several times-- passing it the  
IDs for each record
to be updated.  Is this the only and most efficient way to do this?  
Or is there a way to write the code with an array where Lasso can  
update multiple records based
on an array of IDs??

Jeremy

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: KeyField and Updating Multiple Records in FM

Doug Gentry
Just a quick start - on question 1 at least.

If you are using a Lasso inline and retrieving FM records, you can get  
the record id directly, without having a special calculation field.  
Just use (recordid_value)

Like   inline: -search, ....;
                records;
                        (recordid_value);
                 /records;
          /inline;

I don't have a more efficient suggestion for #2, though I wouldn't be  
surprised if someone reminds us of some nifty Lasso 8.5 tag that could  
do this.

...Doug Gentry

On Oct 22, 2008, at 9:00 AM, Jeremy Reynolds wrote:

> I have two questions about updating multiple records in FM.
>
> 1. Currently what I do is have a calculation field with the  
> definition Get(RecordID) and use that as my KeyField
> Any time I have tried to use a customized ID value, it fails to  
> work.  Am I correct in this belief that using a calculation is the  
> only way to get it to work?
>
> 2. In the past, if I have wanted to update more than one record, I  
> loop through my -Update block of code several times-- passing it the  
> IDs for each record
> to be updated.  Is this the only and most efficient way to do this?  
> Or is there a way to write the code with an array where Lasso can  
> update multiple records based
> on an array of IDs??
>
> Jeremy
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>



---
Doug Gentry
Dynapolis & Southern Oregon University
p:  541-261-8501 / Toll Free: 866-890-6013
[hidden email]
www.dynapolis.com - blog: www.plain-sense.com



--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: KeyField and Updating Multiple Records in FM

maxwellk2
In reply to this post by Jeremy Reynolds-2
Hi Jeremy,

Regarding item #2, it has been a while since I used this method, but  
you could try using a FileMaker portal to update multiple records at  
the same time. At the moment I can't get to the Lasso code I used to  
do this, but starting on page 179 in the Lasso 8.5 Language Guide  
should give you some ideas.

Another piece to the method is to have a portal on a FileMaker layout  
that contains all the records you wanted to update. If I remember  
correctly, you have to have an input tag for EVERY portal row, even if  
the field(s) don't need to be updated. So if you have 100 rows in the  
portal, you'll need to have 100 <input> field tags inside your <form>  
tag.

This method is working on a form that has upward of 1000 rows with 10  
fields per row. It can take 5-15 seconds, sometimes longer, to process  
the whole form, but it has been working consistently the past 5+ years  
thru various versions of Lasso and FileMaker.

Hope that helps,
Max


On Oct 22, 2008, at 9:00 AM, Jeremy Reynolds wrote:

> I have two questions about updating multiple records in FM.
>
> 1. Currently what I do is have a calculation field with the  
> definition Get(RecordID) and use that as my KeyField
> Any time I have tried to use a customized ID value, it fails to  
> work.  Am I correct in this belief that using a calculation is the  
> only way to get it to work?
>
> 2. In the past, if I have wanted to update more than one record, I  
> loop through my -Update block of code several times-- passing it the  
> IDs for each record
> to be updated.  Is this the only and most efficient way to do this?  
> Or is there a way to write the code with an array where Lasso can  
> update multiple records based
> on an array of IDs??
>
> Jeremy

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/