on 01-29-2010 1:18 PM
Hi,
My source field is not mandatory at target side and the value for this field comes only rarely in the message.
My mapping is-->
source field>exist----/
segment-useoneasmany->target field
segment--\
If i dont use exist function it throws error "Too few values in first queue in function useoneasmany".
When i use exist function after source field it is sending true or false at the target.
My requrement is when source field comes the value should be passed to target otherwise nothing to pass.
How to handle this?
Pls help !!
> My requrement is when source field comes the value should be passed to target otherwise nothing to pass.
Why are you using UseOneAsMany function? Do you want when your souce field comes then it should be mapped to target field for it's all occurrence. If your ans is yes then do your mapping like this..
source --> exists --> ifWithoutElse --> Then --> Source --> CopyValue(0) -->Target
Douple click on CopyValue function and enter zero, by this way your source field will be mapped to target field for it's all occurrences.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks to everyone for the information !!
I have to use useoneasmany function because i have to generate multiple idocs based on condition.
I am doing almost similar kind of mapping for the whole structure.
source field>exist----/
segment-useoneasmany->target field
segment--\
Whenever the value doesn't come in source field, no such field should be generated at target side, not even empty field.
Please help me !!
Regards,
Suresh.
Hi suresh,
please try a udf with similar logic as useoneamany ,give it a try ..lets see if it solves ur problem.
udf with two inputs 1. Soure field 2. segment take as string array.
inside udf :
if source="";
{
result.addSuppress();
}
else
{
for (i=0;i<segment.length;i++)
{
result.addValue(segement<i>);
}
}
Please make some correction if required in udf ...not very good at this:)
Regards,
Srnivas
Hi Suresh,
Please try using a simple udf with same logic instead of use one as many function.You can code the logic in udf easily . Sometime its the best working option.
Regards,
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If i dont use exist function it throws error "Too few values in first queue in function useoneasmany".
Thats because the first context of your source node doesn't have a value for the source field.
My requrement is when source field comes the value should be passed to target otherwise nothing to pass.
Just use a mapByDefault.
source field>mapByDefault(blank constant)>Target field.
This way when there's no value for source field a blank constant would be passed...
Hope this helps...
Regards
Soumen...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My requrement is when source field comes the value should be passed to target otherwise nothing to pass.
Why use useOneAsMany for above requirement? The error will be thrown as your source field is 0..1.....it should be ideally 1..1
Use the below logic:
Source --> Exists --> ifWithElse (then Source) --> Target
Else(map Blank Constant)
Use ifWithElse in case you want to have a empty target node created when the source node does not exist.
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use an IF before the useoneasmany or set a default value in case the field comes empty
regards,
Pablo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.