Does anyone have a sample or guide on how to creat...
# suitescript
j
Does anyone have a sample or guide on how to create a form/app where you enter in a PO, it loads all the items in the PO, and you can select some or all of the items and submit for an action to be completed? -- It does not have to be for Purchase Orders, it can be for any record, I just need to see how the logic works and how it is structured. (Like the Mass Create Work Orders Page)
j
I believe you are looking at adding search results to a sublist. There is a great article here that walks you through the suitelet process. Part 3 and 4 show you how to add the sublist and the search results. You just need to then add the checkboxes to the sublist. I believe this will accomplish what you are looking for?
🙌 1
j
Yes, amazing. Thank you, I have been looking for something like this.
n
You can add a field of type "CHECKBOX" and then in your POST iterate the sublist and check if the checkbox is set for the latter part of you're requirement. Be aware a SuiteLet has a governance of 1k, you may need to make use of other processes to carry out the logic at this point in the process. (scheduled script / map/reduce / call a SuiteLet multiple times / CSV task etc etc)
j
How can I modify the search that is created based on a value entered into a created field? Example: I have a field "Enter PO" which a user will enter the document number of the PO, once they click the button "Load PO", it will refresh the sublist with the entered PO's items.
b
the most basic answer is using the submit button to make the form post to the suitelet and then write a new form that has your new sublist
the other answer is to use client script to change the sublists, though this can be slower and more noticeable than you would want
j
So I have it working as a post to create a new form, but how can I have an action being done with the data from the form? I want to create records for each selected line
b
same thing usually, submit button to do the work in the suitelet
or client script to process each line
j
I am not sure how to setup the client script to be called, I have a client script but the button does nothing, does it have to be a submit?
Could I somehow just pass the values to be worked on to a scheduled script?
b
you would need to share how your scripts for more help on the client script approach
using a scheduled (or map/reduce) is a variation of doing the work in a suitelet
where you use N/task to create a task and a script parameter to pass data