Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Save search history for invoice control

Featured Replies

Hello there, I am building a invoice layout that get the records to display and calculate total from this method, I select the records then send the result to a printable layout. Ok.

 

What I want is to be able to save that result, that invoice, inside the db, probably on a separated table, that would track the generated find result as a new record, as a new invoice.

So, everytime I do a search and print, it will generate a new record on the affiliated table, give it a serial number and save the info from the records that I had selected (I need RecordID and AmountDue from the records), the thing is, how do I get the said record ID to save the find result on the other table using that solution? It saves the records I select on a global field, so all the records are inside a field, how do I relate that to the RecordID and then save on the other table?

 

Thanks!

I would suggest you do it this way:

 

1. Find the items you want to include in the new invoice;

2. Go to a layout of Invoices and create a new record; store the InvoiceID value (an auto-entered serial number) in a variable;

3. Go back to the layout of the Items table, and populate the InvoiceID field in all found records with the value of the variable.

 

This is assuming an item can belong to one invoice only.

  • Author

WIll work on with the direction you gave thank you very much once again!

  • Author

Is it possible to get the text from the RecordID field from all the records found, then copy it, insert to, a field on another table.

The script could run like

 

Get content from RecordID field on all found records

Create a new record with a auto generated serial number (payment ID) on another table ("Payment ID log/archive" table)

Insert into PaymentReport field the that table

Save the record.

 

That second table would have these fields, Payment ID, Payment Date, RecordIDs (Service Order numbers that were paid on that invoice), total paid.

 

Not sure how to get the info from all the RecordID fields and merge into a single one, well formated.

Thanks!

 

Edit: A record could be in more than one invoice.

A record could be in more than one invoice.

 

In such case you need to do something like you described (and you already should have known how to do it from your other question, since the script I described there is very similar to the one needed here):

Go to Record [ First ]
Loop
  Set Variable [ $ids; Value: List ( $ids; Items::RecordID) ]
  Go to Record/Request/Page [ Next; Exit after last ]
End Loop
Go to Layout [ Payments ]
New Record
Set Field [ Payments::RecordIDs; $ids ]

Note:

This enables you to create a many-to-many relationship between Payments and Items, without creating a join table. This type of relationship has limited functionality: for example, you won't be able to create a report listing Items by Payment.

  • Author

It is just to print, great help thanks!

  • Author

Newbie question, can I set a formating for the value inserted from the variable? It will set the text one under the other, can I set it to be separated by commas and stuff?

Got it to show the comma by adding & "," to the var, now need to have it in the same line without breaking to column! ><

Edited by Morenomdz

IMHO, best practice would be to have a relationship between the individual items and the wrapper payment record. This would enable you to easily see which items are included in which payment and vice versa.  For this to work, you must have a return-separated list of the related items RecordID values in a field of the Payments table, to be used as the matchfield in the relationship.

 

If you want to show a comma-separated list of other values from the related items, you can use a calculation field =

Substitute ( List ( Items::Somefield ) ; ¶ ; ", " )

Note that this will work for building a list from values in a single field. As I said in your other thread, printing multiple values from multiple records as contiguous text is not a simple task.

  • Author

Will try it out, was attempting with the TrimAll but it didnt work for what I needed. Thanks again.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.