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.

Featured Replies

Greetings, 

 

Your expert advice and solution would be greatly appreciated. 

 

Based on the Invoice Starter Solution, is it possible to have a script that will automatically add all products from a specific category into an invoice?Of course not everything in one line item but each product in its own line item? The trigger will be set by checking a check box. 

The process should also not duplicate the item if it already exists. 

 

Many thanks for your support. 

Kunal

Yes, you could script some logic like:

  1. get a list of product IDs for selected category
  2. get a list of existing line item product IDs
  3. use a custom function like AntiFilterValues to get the product IDs that don't already exist
  4. Loop through the IDs to create the records

Does that make sense?

  • Author

Thank you! it does make sense. I just need a pointer as to how to create the loop and creation of those record.

 

Edited by Kunal Oogorah

Off the top of my head, assuming you have the product ID list and you're on the Invoice:

Set Variable[$invoiceID;Invoice ID]
Set Variable[$IDcount;ValueCount($idList)]
Set Variable[$i;0]
Go to Layout( some layout based on Invoice Data table )  // aka Line Items
Loop
 Set Variable[$i;$i+1]
 Exit Loop If[$i>$IDcount]
 New Record
 // hate their field names
 Set Field[PRODUCT ID MATCH FIELD; GetValue($idList;$i) ] 
 Set Field[INVOICE ID MATCH FIELD;$invoiceID]
End Loop
Go to Layout(original)

 

  • Author

Thanks!!

  • Author

How did you get the variable $idlist? IDlist would be the list of all items with category "X" right? How did you get this value?

  • Author

Ok, I am really struggling with this. Can someone help me please??

You said earlier you needed help with the loop (step 4). Now you're saying you need help with the whole thing.

I will help, but first tell me, how do YOU think you'd do it? What have you tried?

Create an account or sign in to comment

Important Information

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

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.