1

I am trying to write a script that will start (or stop) multiple programs in one go. I have stored a list of programs in a data extension (BUList) that has the columns BU and MID. The programs are named using the following pattern, where [MID] should be substituted with the corresponding value held in the DE: Dev - [MID] - Audience Builder Program. Each program is in the business unit of the corresponding MID. I have written the following script but it errors out each time. Is there a way to accomplish this task?

<script runat="server">
    var status = [null, null, null];
    var row;
    var i;
    var rows = Platform.Function.LookupOrderedRows('BUList', 0, 'MID desc',,);

for i = 1 to RowCount(rows) do
{
    row = Row(rows,i);

    var program = Platform.Function.CreateObject('Campaign');
    Platform.Function.SetObjectProperty(program, 'CustomerKey', 'Dev - ' + Field(row, 'MID') + ' - Audience Builder Program');
    Platform.Function.InvokePerform(program, 'start', status, null);
    next i;
}
</script>
1

I don't think you can initiate the program execution from one business unit if the program exists in another unfortunately. I did a workaround for that using landing pages. So in each BU I had a LP which initiates relevant automation(s), then I had a controlling page within the top level BU which will call all necessary URLs of the child landing pages and essentially kick off the process that way. A bit hacky but worked in the end.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.