cancel
Showing results for 
Search instead for 
Did you mean: 

createIf for Line Item

Former Member
0 Kudos

Hi experts,

I have a simple requirement whereby I need to suppress the Line Item output based on a condition.

For example, LineItemSource (1..unbounded) --> LineItemTarget (1..unbounded)

In my example, I use the createIf function as follows:

condition (if true) --> createIf --> LineItemTarget

Msg

     LineItemSource (true)

     LineItemSource (true)

     LineItemSource (false)

     LineItemSource (true)

     LineItemSource (true)

When testing with 5 line items (the 3rd record has a condition that returns false),  the display queue for LineItemTarget does contain "SUPPRESS" when the condition is true for the 3rd record.  However, when I start the transformation test, only the first record of LineItemSource is transformed to the LineItemTarget.

Does anyone know how I can output all 4 LineItemSource records when the condition is true and suppress the LineItemSource record when false?

Thanks,

Dave

Accepted Solutions (0)

Answers (5)

Answers (5)

justin_santhanam
Active Contributor
0 Kudos

I agree with Radek.. If there is only root node and the field you are checking for validation is child of that root node, then by all means you can use RemoveContext. But if you have deep structure then it depends on the context.

Thnx.

Former Member
0 Kudos

Hi David,

The issue is on your context handling. Try to verify the context you have to use on the field on the condition in this part "condition (if true)".

Hope this will help.

Thanks.

Rgrds,
Jo A.

former_member186851
Active Contributor
0 Kudos

Hello David,

Try like this

condition (if true) -->Remove contexts-> createIf --> LineItemTarget

radek_rucinski
Explorer
0 Kudos

One small remark from me I would not recommend using Remove context in such a case, usually context change for a specific field solves the issue, e.g.:

And there is no risk that the mapping will produce errors, for example in multimapping.

Regards,

Radek

justin_santhanam
Active Contributor
0 Kudos

I think there is context change between each of the below results.

     LineItemSource (true)

     LineItemSource (true)

     LineItemSource (false)

     LineItemSource (true)

     LineItemSource (true)

Try this

condition (if true) --> RemoveContext --> createIf --> LineItemTarget,



If doesn't work,please give the screenshot for better clarification.


Thanks!

radek_rucinski
Explorer
0 Kudos

Hi David,

Can you please share a screenshot with the queue when testing? You might need to change context of fields used in the condition to one level higher, otherwise it produces unwanted context changes.

Regards,

Radek