cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Translate the entire conversation x

Add Promotables to an existing Promotion Notice?

hmungekar
12-Amethyst

Add Promotables to an existing Promotion Notice?

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.

ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

2 REPLIES 2

Hi

I haven't tried it, but there is a method in the JavaDoc

static PromotionTargetnewPromotionTarget(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.

Announcements
Top Tags