Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi All, I'm a bit of a newbie.

Here's my problem...

I have a one to many relationship between 2 tables, client and clients invoices.

There is an 'invoice type' field in the invoices table with drop down choices of 'Deposit' or 'Remainder'.

I also have a 'paid in full?' field with a drop down "yes / no" value list in the invoices table.

In the client table I have a 'deposit paid?' and 'Remainder paid?' fields both on a 'yes / no' value list

What I am trying to do is make an If statement script that says, If the invoice type is 'Deposit' then copy the 'paid in full' and paste it into the deposit paid field in the client table.

This is my script which works, but only if the invoice type is 'deposit', I need it to recognize the invoice type which is 'remainder' and do the same for the remainder paid field in the client table.

Link

Basically it's a set variable / set field script which checks the invoice type before replacing the field in the client table.

Is this the best way to do this? or is there an easier or more straight forward way to do it?

Any help much appreciated!

Posted

Why not use 'else', or write another If statement:

If [invoices::Invoice Type = " - package Remainder"]

etc. 

Posted

Is this the best way to do this?

Probably not. This:

If the invoice type is 'Deposit' then copy the 'paid in full' and paste it into the deposit paid field in the client table.

doesn't go too well with this:

I have a one to many relationship between 2 tables, client and clients invoices.

What you are saying is that if some invoice happens to be of type "Deposit", then this single invoice is going to determine the contents of the Deposit Paid field in the Clients table.

Also, if you do:

Commit Records

Go to Related Record […]

you will be taken to the FIRST related record in the Invoices table. If that invoice is not a deposit, then nothing happens. If it is, then other deposits are ignored.

I am not sure what exactly are you trying to accomplish here, but it seems like it would be better to use relationships and calculations to summarize the client's invoices, rather than a script.

Posted

I would add further that 'Deposit' and 'Remainder' suggests that you aren't utilizing a LineItems table. Payments, credits and refunds on an invoice should be held here. It sounds like you might be man-handling your solution when it could be more automatic with a few shifts in your structure.

There should be no need for script here at all. Would you be willing to post a clone of your file or provide a demo of the key components of it so we could get a better vision? :wink2:

Posted

Hi all,

Thanks for your responses, the reason I need to do this is for a 'monitoring' portal so I can see a list of all the unpaid deposits and remainders.

I am using a line items table with each invoice and have a separate pricelist table for creating new line sale items.

All I need is a fail safe way of marking certain invoices as a 'deposit' or 'remainder'. Purely for monitoring.

Currently I just have a text field within the invoice table which I use to mark any new invoice with the appropriate 'Deposit or 'remainder'

I could use calcs to determine the sale value and auto enter the deposit/remainder tags as my deposit amounts are nearly always around the £250 mark, the remainders always a greater monetary value than this.

But I feel it's not fail safe enough, which is why on creation of a new client record I had the field in there which auto enters as deposit and remainder unpaid until I mark it as paid.

Monitoring fields in the invoice table means they dont show up as unpaid until I create the invoice, but I need this info to show before I even create the invoice...

Any ideas?

Posted

Would you mind explaining how to write an if statement with two caveats?

ie: If Invoice type is 'Deposit, does one thing, if not do nothing

but if invoice is 'remainder' do this instead...

hope that makes sense!

I dont use if statements much!

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