0

I need to update SubscriberLists from different child Business Units. To do that I create Subscriber and put SubscriberLists inside of it. How can I specify ClientId of Business Unit for every SubscriberList?

UPDATE

I'm trying to update it with following code and I don't know how to set clientId for every SubscriberList in for loop:

SET @sub = CreateObject("Subscriber")
SetObjectProperty(@sub,"SubscriberKey", QUERYPARAMETER('key'))

FOR @d = 1 TO RowCount(@sublistArray) DO
    SET @listRow = Row(@sublistArray, @d)
    SET @listId = Field(@listRow, 1)

    SET @list = CreateObject("SubscriberList")
    SetObjectProperty(@list,"ID", @listId)
    SetObjectProperty(@list,"IDSpecified", "true")
    SetObjectProperty(@list,"Status", @listStatus)
    SetObjectProperty(@list,"StatusSpecified", "true")
    AddObjectArrayItem(@sub,"Lists", @list)
NEXT @d

Set @update_list_sub = InvokeUpdate(@sub, @update_sub_status, @update_sub_errorcode) 
2
  • How are you making these updates - you've tagged AMPscript so assuming this is with AMPscript on a landing page. Do you have any code to work from? Commented Nov 8, 2017 at 17:56
  • @AnonWonderer updated question Commented Nov 9, 2017 at 9:28

1 Answer 1

0

Your code seems fine - you will just need an additional statement to specify a child ID property and to populate that with the MID of the specific business unit. Try this within your code:

   SET @client = CreateObject("ClientID")
   SetObjectProperty(@client, "ID", [Insert MID of specific BU here])
   SetObjectProperty(@client, "IDSpecified", "true")
   SetObjectProperty(@sub, "Client", @client)
1
  • Yes, I did it, but that way I will need to create Subscriber for every clientId. I wanted to avoid it, specify clientId for every SubscriberList and update it with one query Commented Nov 11, 2017 at 17:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .