Thursday, 22 September 2016

Can't delete budget

    Public Function RemoveBudget(ByVal budget As Budget) As Budget

        Dim Locations As New Dictionary(Of Int64, Location)
        Dim service As BudgetService = CType(User.GetService(AdWordsService.v201607.BudgetService), BudgetService)

        Dim operation As BudgetOperation = New BudgetOperation()
        budget.status = BudgetBudgetStatus.REMOVED
        operation.operand = budget
        operation.operator = [Operator].REMOVE

        Dim operations(0) As BudgetOperation

        operations(0) = operation
        Try
            service.mutate(operations)

        Catch e As Exception
            Throw New System.ApplicationException("Failed to get location for ad.", e)
        End Try
        Return Nothing
    End Function


the budget object passed to this function is returned from the BudgetService via a get.  The code runs smoothly without an error, yet my next Get request finds the same budget with same Id like my Remove operation was just ignored.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/131e80b6-cffc-43e8-bfcd-94cc60b00db7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment