the data but set field  doesn't set the field.
Your script works as presented (I just created an identical file and script) although I suggest that you use Set Field for Saldos::Fecha Facturacion and Saldos::Detalle as well. If those two fields aren't on the layout then both 'Insert' steps will fail (that is one of their shortcomings) whereas Set Field is always the best choice (when possible). Even so, if those two fields remain empty because they throw a 102 error (field is missing), I show that your Saldos::Tenencia would still inherit the $$TENENCIA_FA variable. Even if you have invalid data type on Tenencia (between your two tables), it still would properly set the field in the newly created record.
When you perform your find, are you sure you have found records? If you have no records in your found set when you start, it will go ahead and create a new record in Saldos and even insert date and text but it won't set it with Tenencia because no records are displayed in your loop. The other possibility is that you are starting your script from the wrong layout (while testing). Sometimes when we fire a script from ScriptMaker we don't make sure we are on proper layout to start, particularly when your script says 'go to original layout' instead of specifying the specific layout ... this can get you in trouble when testing.
So I would suggest the following changes:
Set Error Capture [ On ]
Perform FInd [restore]
If [ not Get ( LastError ) and Get ( FoundCount ) ]
Go to Record/Request/Page [first]
Set Variable [$$TENENCIA_FA; Value:Tenencias::Tenencia]
Go to Layout ["Saldos" (Saldos)]
Set Field [ Saldos::Fecha Facturacion ; Get ( CurrentDate ) ]
Set Field [ Saldos::Detalle; "CUOTA ADMINISTRACION"]
Set Field [Saldos::Tenencia;$$TENENCIA_FA]
Go To Layout [ 'layout holding this original found set' ; Tenencias ]
Go To Record/Request/Page [Next; Exit after last]
Also, there is probably no need to use a global variable. A script variable will persist only while within this script (use single $ instead of two) and that will be fine. I only use global variables if the value must persist after a script ends. If this doesn't work, it would help to see your file.:smileyhappy:
Hey thanks for the quick answer. I made the suggested modifications and it is still not working. As far as I know the find function is throwing results. When I was using the Copy function it worked as spected.
Do you mind taking a look at the DB?
The script is called "Facturar Administracion"
It requires my credit card information first even for free trial and before it will allow a download. I don't mind a site requiring my email but requiring a credit card to verify that I am eligible to pay the bill should they decide to charge after the free trial ... nope, sorry.
If you wish to upload your file to any of the other truly 'free' sites, such as 4share, I would be most happy to take a look. :smileyhappy:
Thanks for the new link ... I didn't mind providing my email but I didn't want to provide my debit card (I've been bitten by that in the past).
In your Facturar Administracion script, there is an extra space in your Set Variable step: $$TENENCIA _FA (right before the underline). If you remove that space, it will then match your Set Field  script-step instance of the variable and it properly sets the field. It was not easy to spot. And yes, it would be nice if FMI could warn us when (within a script) we are defining a script variable which isn't correct but I understand why it would be difficult to catch. :smileyhappy:
I hope the rest of your weekend goes well!
LaRetta thank you very very much for your help, this forum is excellent, Super Contributors should get paid for that or at least get discount on Filemaker :smileywink: . It is very weird that protectlinks.com ask you for a credit card, maybe is thanks to the fact that you are in the USA because I'm in Colombia and when I click the link it just take me to the download page.
I hope you weekend goes well too.