cancel
Showing results for 
Search instead for 
Did you mean: 

How to update Campaign in Sales Order

resmi_v
Participant
0 Kudos

Dear Experts,

While editing Salesorder based on some conditions, I want to create /Edit campaign to a specific value.

In event aftermodify of SO,Iam trying as below :

var campaign : elementsof SalesOrder.BusinessTransactionDocumentReference;
--campaign.BusinessTransactionDocumentRelationshipRoleCode -- Readonly
--campaign.BusinessTransactionDocumentReference -- Readoinly
currentSalesOrder.CampaignReference.Create(campaign);

But this is not allowing to create a campaign .Same issue in Edit also .

Plesae help in resolving

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183363
Active Contributor
0 Kudos

I suggest you look to see if there's already a pre-existing reference --- you might be able to follow the association chain to set the ID, e.g. currentSalesOrder.CampaignReference.BusinessTransactionDocumentReference.ID.content or something of the ilk.

resmi_v
Participant
0 Kudos

Dear Lewis,

Its not allowing to edit the campaign id from Sales order AfterModify event. It says it as read only.

Please suggest how to proceed on this.

former_member183363
Active Contributor
0 Kudos

Resmi,

Is your solution in the same namespace as the SalesOrder business object? If so, you might be out of luck. Is the campaign ID editable in the front end from the salels order?

Lewis