I currently have a workflow that takes the sale amount of a customer order line and places that value in the customsvalue field automatically. We do this because customsvalue is the only field with prices that moves over to shipment proforma invoice.
I am fully aware that IFS wants the order taker to define this field manually, but it is a requirement that we handle this automatically.
The workflow that we currently have works fine, as it goes off of the event when a customer order line is created, but the only issue is when a sales quotation is converted to a customer order. I get the error message
“Error occurred while processing the request: Unknown property used in expression, ${LineItemNo} Cause: Cannot resolve Identifier ‘LineItemNo’”
How do I get around this issue so even the customer orders that are created from sales quotations work, and their customsvalue field gets populated?
Any and all advise would be greatly appreciated
Thanks, Bryan
Page 1 / 1
Some additional information:
This is the setup for the event action
This is the setup for the event
And this is the setup for the workflow
Maybe that the LineItemNo is only prepared during insert, so it's not yet available when CO is generated from SalesQuotation.
What if you build in a check if LineItemNo is avaiable and if not use a counter to generate it? The counter could be in a loop until no more Quotation lines to read.
Hi @eqbstal
Thank you for the reply, I was considering doing that, but I’m not 100% sure how to handle a list of those lines. Are those values stored in an array or an object? If I’m not mistaken, workflows use Java objects while they have executions and commands that use javascript. Javascript has objects, not arrays, and Java has both.
I’m going to assume it would be a javascript object, that is set up to act like an array, but is there a location in documentation where I can read more about their setup? I’ve been sort of assuming a bunch and testing what works/doesnt work based off of some examples I’ve been given.
Also concerning me generating a value for LineItemNo, do LineItemNo’s start at 0 or 1? I will attempt to try this and update you on the results.
As always, thank you for the reply, I appreciate it immensely, Bryan
Found some base material for loop functionality. Is the following helpful:
Perfect, thank you for the documentation. I appreciate it.
-Bryan
Hi @eqbstal
I have a quick question about workflows if you don't mind (I tried to directly message you but for some reason, the message wouldnt send, so I’m asking it here). I checked the document you sent me, but it didnt seem to mention lists.
I have a projection task call this function "GetFileExtList(DocType):String" but I am not sure how to format it to handle the output. This is what my workflow looks like.
In that "get document list" section, I am calling that function. I want to read from that but how do I recognize the output in my script function inside the loop?
Any input would be appreciated.
Thanks,
Bryan
Hi @bdoucette
Please include the workflow image.
I'm unaware of any GetFileExtList situations, so you have to give a lot of details to understand the question and/or what you try to achieve.
Hi @eqbstal
Sorry about that, I attached the image to the message but I guess it didn’t load correctly.
Thanks, Bryan
@bdoucette While looking at the workflow image, I saw there is no ‘identifier’ icon at the bottom of the sub process.
Select it and use the wrench to select the, I call it the hamburger, icon. Once selecting it, it will loop though the data as you started it with in the task that is before the sub process.
The Collection in your example will contain: GetFileExtList
Data is just a variable name for an array that will contain all the data found. Best to use Inspect to see what happens.
Hi @eqbstal sorry about that, the image I uploaded before was an outdated workflow I created. I have functional workflows that handle collections. That list I was grabbing wasn’t the best list to work with either, as the proper projection call should be ‘DocReferenceObjectSet’ from the projection ‘DocumentObjectConnectionsHandling’ with the parameters for keyref.
This is what my more recent workflow looks like
Sadly, you cannot invoke Aurena agent calls via a workflow, so I could not print these attachments out, so I ended up creating a different workflow that displays a user task to prompt the user to print off the documents attached to this shipment/customer order.
Thank you for your input though!
@bdoucette I noticed the Script Task 'Prepare condition for gateway’.
Are you ok with sharing what the script looks like as I'm struggling with looping thru a subset as I want to have the status of the lowest approval step that is not Approved/Rejected.
I tried the use of a subset, but didn't get the loop to work. When there is no value for a field, the field is not there at all, so only available values are considered in the loop. In my loop I need the first step (out of the attached approval steps) that is not yet either Approved or Rejected.
No problem if you share it via a private message.
Hi @eqbstal
Of course, I’m happy to help.
Before that task, for the “Get attached document list” task, I am using a read projection task on the Projection “DocumentObjectConnectionsHandling” and the entityset “DocReferenceObjectSet” while setting the “read collection - Collection variable name” as DocReferenceObjectSet_Set (Bad naming convention)
For that “Prepare condition for gateway” script task, I’m using JavaScript. The code is this
var documentList = execution.getVariable('DocReferenceObjectSet_Set'); var documentsRemaining = false;
Then for the arrow of “Are there more documents to loop through” I have a default arrow pointing to the end for “no” and the “yes” arrow is another javascript bit. Here’s the code for that
lastly, just define the collection in the subProcess, and define the element, in this case I set this to “document” but truth be told, I’m not entirely sure if that element variable matters too much in my case, as I’m not using it.
If you need help with anything else, please feel free to ask. I’m not the most experienced with workflows, but I’m definitely getting better at creating them.
Thanks, Bryan
@bdoucette I think I owe you one (or more). This works very good in my situation (working on automatic generation of approval steps based upon DocMan approval template).
Thank you so much,
Steve
@eqbstal I’m glad you found that helpful! Good luck in future development.
My pleasure,
Bryan
Hi @eqbstal,
I’m going to try to cash in that favor haha. Would you happen to know how to send an email via a workflow? I see some projection calls that deal with emails but none that I can trigger without the aurena agent/ in workflows.
Thanks, Bryan
@bdoucette I have only environments to my availability that have either no mail server connected or it has been turned down as the environments are Dev/Test only. More to the point: never had a request to do that, so can't help you now.
Hi @eqbstal
I see, well thanks for your quick reply anyways. I appreciate it nevertheless.