Skip to Content

How to update Campaign in Sales Order

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 15, 2018 at 02:39 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded