Set Field Not Working properly? 
Author Message
 Set Field Not Working properly?

Hello,

I'm having a bit of a problem with "set field".

I have 2 databases "Invoice.fp5" & "Clients.fp5" Match field
"customer id".

When a new invoice is created the user has the option of looking
up the customer in the clients database.

On the cleint database there's a button that says "Add this
customer to the invoice"
The script steps are as followed:

Set Field["Invoices::customer ID", "customer ID"]
Go to Related Record ["Invoices"]

Now this will work sometimes and sometimes I get nothing?
However when it does put the customer ID in the invoice, all the
other customer info is pulled up. Ex customer name, address etc.
But here's the kicker, when it pulls up the cutomer info on the
invoice it automatically pulls up an old invoice for that
customer? I just want to create a new invoice and have the
customer info pasted in there..

Any Idea what I'm doinf wrong?

TIA

Tricky

* Sent from RemarQ http://www.***.com/ The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Thu, 12 Sep 2002 03:00:00 GMT
 Set Field Not Working properly?

Quote:

> Hello,

> I'm having a bit of a problem with "set field".

> I have 2 databases "Invoice.fp5" & "Clients.fp5" Match field
> "customer id".

> When a new invoice is created the user has the option of looking
> up the customer in the clients database.

> On the cleint database there's a button that says "Add this
> customer to the invoice"
> The script steps are as followed:

> Set Field["Invoices::customer ID", "customer ID"]
> Go to Related Record ["Invoices"]

> Now this will work sometimes and sometimes I get nothing?
> However when it does put the customer ID in the invoice, all the
> other customer info is pulled up. Ex customer name, address etc.
> But here's the kicker, when it pulls up the cutomer info on the
> invoice it automatically pulls up an old invoice for that
> customer? I just want to create a new invoice and have the
> customer info pasted in there..

You are not creating a new record (invoice) each time.

When you are in the Client record, if you put the related ClientID from
the Invoice file on the layout you will see that for a new customer it
is initially blank, because there are no invoices for this person (so no
related record).
Note how many invoices you've got.
Now fill in the invoices::CustomerID field with the current customer ID.
You have created a related record by doing this (because there is a
direct link to the invoice file via this field). If you look at your
Invoices file, you will find you have one extra.
If you fill this field in again with the same ID, nothing happens.
Filling it in once created a new related record. It won't happen again.
In order to create multiple related records for the same client, the
related field needs to be in a portal from the relationship. Then every
line you fill in creates a new related record (related to the client you
are in).
This is why you find your script working sometimes, and sometimes not.
It works the first time for each client.

So, you need to create a new invoice each time. If you don't want to use
a portal, but go on the way you are going, you need to do this:
In  your invoice file create a script which has
New Record/Request
Paste[select, "customer ID"]

In your Client file create a script which has the steps
Copy[select, "Customer ID"]
Perform script[subscripts, External:"invoices"]

So you start off in your Client file by copying the custID, then you go
to the invoices file and perform the script you have prepared there
which creates a new invoice and pastes in the custID.
I presume you have a field with automatic entry to fill in a new invoice
number when a record is created.

When you perform this script, the cursor remains in the CustID field,
and none of the related fields you have pulled from the Client file will
fill in until you tab out of that field, so you could include a step 'Go
to next field' or something before halting the script. Then all your
related information such as name, address etc will show immediately.
Don't  include a 'go to related record' step because you are already
there. Anyway, it would just go to the first related record, not the
last, unless you included a few other instructions.

I hope I have made this clear and not further confused.
--
Mire Black



Thu, 12 Sep 2002 03:00:00 GMT
 Set Field Not Working properly?
Mire,

Thanks!! Worked like a charm! After reading your post 2 or three
times it finally sunk in:)

I read somewhere that copy/paste was bad....that's why I tried a
"set field", but then again copy/paste works like you suggested
and I'm sticking to it!!

Thanks again!

Tricky

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Thu, 12 Sep 2002 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. UPDATE / Multiple SET not working - fields being set to NULL

2. Setting not Null field to ""(empty string) does not work with CRecordset

3. Transferring of Database not working properly

4. XP_CMDSHELL not working properly when I run dtsrun

5. getBytes() not working properly

6. Maxlength property not working properly

7. Substring and Charindex not working properly

8. T-SQL debugger is not working properly!

9. RIGHT function not working properly

10. Stored procedure does not work properly after change

11. T-SQL Debugger is not working properly

12. T-SQL Debugger is not working properly


 
Powered by phpBB® Forum Software