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

Scripting a new invoice to auto-populate line items with certain data- best method


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

Recommended Posts

Posted

Hello,

 

Solution background: company has 3  specific invoices types that are used very frequently in the course of their business (equipment inspection/repair service). When the user invokes a new invoice, based on the invoice type chosen, I'd like the invoice line items to auto-populate with data that are always associated with this particular type of invoice i.e. part xxx is always used, labor associated with installing part xxx is always the same etc. The only variance is the quantity of parts used and in turn, the time to install said parts. *note- the invoice is not just limited to the auto-entered parts/labor... add'l  relevant line items can be added.

 

Creating the scripting to provide the invoice type choices is not an issue, however getting the respective invoice type chosen to auto enter the data that is always associated with the invoice type is problematic. I Imagine that some sort of a  "new invoice line item" & "set field" steps are required. The question is...is this  the best way to tackle this (what would this script look like?) or is there a better method that I might be overlooking?

 

Any feedback is muchly appreciated. TIA.

 

Jack

 

 

 

 

 

Posted

The method you're thinking of, looping through each of the required line items and creating them one-by-one, is a perfectly reasonable approach. Another possibility is to have separate tables for TemplateInvoice (one for each of your invoice types) and TemplateInvoiceLineItem; when you create a new invoice of a particular type, the line items for the new invoice would be created by importing the appropriate records from the TemplateInvoiceLineItem table.

  • 2 weeks later...
Posted

Jbante,

 

Thanks for your response- your alternative idea is just what I had hoped for. I often find that there is more than 1 way to tackle a problem

in FM. Now the challenge is to determine which method is easiest to implement.

=)

 

Jack

Posted (edited)

Another possibility is to have separate tables for TemplateInvoice (one for each of your invoice types) and TemplateInvoiceLineItem; when you create a new invoice of a particular type, the line items for the new invoice would be created by importing the appropriate records from the TemplateInvoiceLineItem table.

 

Alternatively, you could use only one table - TemplateInvoices - and place the line items in repeating fields. Then import the template record into LineItems with the option to break repeating fields into individual records selected. Or script the creation of line items - it's six of one or half a dozen of the other.  You just need to make sure the process is not "too automatic", i.e. it should be unambiguously initiated by the user - not run when the user accidentally selects the wrong  template.

Edited by comment
  • Like 1
  • 1 month later...
Posted

Jbante & Comment, 

 

Thank you both for your input. Comment, I'm sorry to say that you have completely lost me; would a sample file with your ideas (or more information) be asking to much so that I can grasp what you suggesting?

 

I have another issue- this may sound odd-is it possible to have an invoice with 2 portals sourcing data from 2 different line items table? The individual who performs data entry has a set workflow that she likes- it encompasses having a parts portal on the left hand side for selecting appropriate part numbers etc. and another portal for adding the associated labour components for the invoice. How would one incorporate this into a solution? Please see the attached picture for further clarification.

 

As always, thank you for support.

 

Jack

 


post-88128-0-49722600-1390884835_thumb.p

 

Not certain if the picture attached properly so trying again.

Posted

Here's a very simple demo.

 

InvoiceTemplates.fp7.zip

 

 

is it possible to have an invoice with 2 portals sourcing data from 2 different line items table?

 

Yes, but you will have some issues with printing the invoice. Normally, you'd want to print from the line items table.

 

 

 

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