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

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

Recommended Posts

Posted

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

Posted

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?

Posted

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)

 

  • Like 1
Posted

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?

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