Skip to main content
Solved

BPA Projection Workflow to add or replace a value

  • February 20, 2025
  • 7 replies
  • 254 views

Forum|alt.badge.img+2

I am trying to create a before workflow that will change or add a value for a custom field on Purchase Order Header entered by the user or left blank at the creation of a purchase order. 

I got the change part to work but is struggling with he ‘add value’ part.
If the custom field is left blank during the creation of the order, no value for the cf is passed to the workflow . Not even information that the value for the cf is null.

Does anyone know how to have the workflow to add a variable on the way to the original projection call?
I tried to just usign a workflow with script component to add the value and I can see the value in the observation but that isn’t added to the projection call.
I would like to avoid just to update the record after creation as the user then has to refresh the record every time a po is created to see the value in the cf.
The value for a cf is fetched from another place in the system and is not the same every time so a dafault value for the cf will not work.

 

We are in  Cloud 24r2

Best answer by kamnlk

hi ​@CurAnneaL 

From what you have described you could use a process enrichment task to get the behavior

first declare the variable as you are doing in the script task, then declare the variable in the IFS Process Enrichment task to make it export from the workflow 

 

ref: IFS Process Enrichment - Technical Documentation For IFS Cloud

7 replies

Forum|alt.badge.img+9
  • Hero (Employee)
  • Answer
  • February 20, 2025

hi ​@CurAnneaL 

From what you have described you could use a process enrichment task to get the behavior

first declare the variable as you are doing in the script task, then declare the variable in the IFS Process Enrichment task to make it export from the workflow 

 

ref: IFS Process Enrichment - Technical Documentation For IFS Cloud


Forum|alt.badge.img+2
  • Author
  • Do Gooder (Partner)
  • February 21, 2025

Thanks, 

I tried with a process enrichment element right after I made the post and it worked!


Forum|alt.badge.img
  • Do Gooder (Partner)
  • February 3, 2026

Hi ​@CurAnneaL and ​@kamnlk I ran into a similar problem 

I created a workflow that gets triggered after a user is adds an Expense Details from the dialog. It’s a user interaction workflow because we needed the user to enter a value for a custom attribute during the creation of the expense detail. The newly created row information does not get passed into the workflow so I cannot update the custom field in the same workflow. I get the “CFT rowkey cannot be null” error.

I have got to the point where my workflow1 has exported the Process Enrichment variable for the custom attribute value after the workflow is complete but now I want to use that variable to update the newly created flow.

How were you able to use the process enrichment variable to update the custom field attribute?

Thanks for your help!


Forum|alt.badge.img+9
  • Hero (Employee)
  • February 4, 2026

hi ​@jamie.maiquez 

its bit unclear on the requirement, can you explain more on what you are doing?  what is the projection you are using to trigger the workflow? 

if i am to guess from what i understand you could read in the newly created record inside the workflow and after the user form you can perform and update to the record.


Forum|alt.badge.img
  • Do Gooder (Partner)
  • February 4, 2026

Hi ​@kamnlk

The requirement is to force a user to enter a value for a custom attr before they can save an Expense line (for a specific expense code) from the Expense Sheet Detail page. Since we cannot add the cust attr through page configuration, we want to trigger a ‘user interaction’ workflow that will ask the user for the value right after they go through the assistant/dialog for adding/editing an expense line.

The workflow triggers on projection TravelExpensesManagerHandling on the call AddOtherExpense (this is the request made when the user enters a specific expense through the dialog).

Your solution works for editing an expense line but it does not for new lines. An “Index 0 out of range for length 0” error occurs before the Read shape because on a new row, the SeqNo is null and that is a key needed to search for an ExpenseDetail record to update.

I thought I could trigger the workflow on an ExpenseDetailEntity create call but it’s not an option when I search for it.


Forum|alt.badge.img+9
  • Hero (Employee)
  • February 5, 2026

@jamie.maiquez 

The tricky part is the seqno is not passed into the workflow as that is auto generated when creating the records. As a suggestion we could read in the ExpenseDetails records for the specific expense code inside the workflow and get the record with the latest sequence number (eg: sorting the records by seqno and getting the last one) then based on the information from the userform we can do the update

 

 


Forum|alt.badge.img
  • Do Gooder (Partner)
  • February 5, 2026

@jamie.maiquez 

The tricky part is the seqno is not passed into the workflow as that is auto generated when creating the records. As a suggestion we could read in the ExpenseDetails records for the specific expense code inside the workflow and get the record with the latest sequence number (eg: sorting the records by seqno and getting the last one) then based on the information from the userform we can do the update

 

 

Hi ​@kamnlk this worked perfectly on new lines. Thank you!