on 07-07-2015 7:49 AM
Hi Friends
I have a requirement like, Based on ItemType we need to display values like Product ID, Description and Quantity
My logic is like below
if(ItemType.equals("ZSPF")||ItemType.equals("ZSPI")||ItemType.equals("ZSPR")||ItemType.equals("ZSPN")){
log.info("ItemType is"+ItemType);
multiMap.put("Product ID", Product ID);
multiMap.put("Description ", Description );
multiMap.put("Quantity", Quantity);
}
Same thing i need to achieve using Rules,
Please help me
Based on ItemType we need to display values like Product ID, Description and Quantity
These values are in Item Collection under Service Order Object
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Bill,
I am trying to pass Item values to Java code as an Argument.
I have created a Edit item transaction with a rule
In the rule, i am using concatenate function to get item values such as
1. ItemType, Product ID, Product Description and Quantity
we have a logic to filter ProductId, Description and Quantiy based on ItemType
Please see the screenshot. I need a logic like this
if (itemType=ZSPF){
ProductId
Description
quantity
}
So it sounds like what you are looking to do is loop over a collection and if the values match your rule then execute the transaction.
So you need to define a looping subaction and write the rule to return true or false depending on if you want the current record included and if so the action steps would execute to populate the property.
--Bill
Bill, Exactly i needed like this
I am looping over item collection and fetch the values
IF
ItemType value matches ZLBF or ZSGM or ZKLF
then no need to fetch Product ID, Description and Quantity
for other ItemType values, i need Product Id, Desc and Quantity
I tried the condition IF, but after it is asking some condition1, But there am not able to select values like below
:>Current Object>"ItemType" Property = "ZLBF"
Can you please tell one example, How to write subrule for this condition ?
Bill I Tried like this
1. Created a Global Variable for condition like below
ItemType.equals("ZSPF") || ItemType.equals("ZSPI") || ItemType.equals("ZSPR")|| ItemType.equals("ZSPN")
2. Another Global Variable has boolean Value
3. Then in Concatenate Function, i added this sub rule like below
Concatenate
if
global variable
True
ProductID
desc
Quantity
But this is not working, am i missing anything ?
Vignesh,
Bill asked me to help with this. Since you are looping over Item objects, you don't need the "current object" syntax. You can't use the if condition that you wrote here: "ItemType.equals("ZSPF") || ItemType.equals("ZSPI") || ItemType.equals("ZSPR")|| ItemType.equals("ZSPN")". Agentry doesn't understand that syntax. You need to use Agentry functions to do the same thing:
IF
OR
EQSTR
ItemType Property
ZSPF
EQSTR
ItemType Property
ZSPI
EQSTR
ItemType Property
ZSPR
EQSTR
ItemType
ZSPN
CONCATENATE
ProductID Property
Description Property
Quantity Property
OR
EQSTR
ItemType Property
Something Else
CONCATENATE
Something Else
CONCATENATE
Neither is True
The above checks if Itemtype is ZSPF or ZSPI or ZSPR or ZSPN and returns a string with ProductID + Description + Quantity. Else if ItemType = "Something Else" then we return a string with "Something Else". Else if neither is true, we return a string with "Neither is True". All the hard coded string values are hand typed constants.
Jason Latko - Senior Product Developer at SAP
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.