Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi Experts,
I am trying to add promotables to an Promotion Request which is already been persisted. Is there any API by which I can do so.
Thanks in advance.
Solved! Go to Solution.
The promotables should be added to the promotion request as well as to the baseline.
Following snippet of the code should help you.
1. Let the promotion request be pr.
2. Retrieve the maturity baseline => MaturityBaseline maturitybaseline = pr.getConfiguration();
3. Add all the promotables to a WTHashSet "wth"
4. MaturityHelper.service.savePromotionTargets(pr, wth);
5. BaselineHelper.service.addToBaseline(wth, maturitybaseline);
HTH.
Best Regards
Swamy Senthil
Swasen Inc.
Hi
I haven't tried it, but there is a method in the JavaDoc
static PromotionTarget | newPromotionTarget(PromotionNotice thePromotionNotice, Promotable thePromotable) |
Perhaps it works...
The promotables should be added to the promotion request as well as to the baseline.
Following snippet of the code should help you.
1. Let the promotion request be pr.
2. Retrieve the maturity baseline => MaturityBaseline maturitybaseline = pr.getConfiguration();
3. Add all the promotables to a WTHashSet "wth"
4. MaturityHelper.service.savePromotionTargets(pr, wth);
5. BaselineHelper.service.addToBaseline(wth, maturitybaseline);
HTH.
Best Regards
Swamy Senthil
Swasen Inc.
