Hello,

I just tried to run the example code but it failed because of syntax error. 
It was a extra ")" on this line "Logger.log("Budget Order [" + 
budgetOrder.getName() + "] base spending limit: " + limitText));"


Here is a working piece of code:

function main() {
  getBaseSpendingLimit()
}

function getBaseSpendingLimit() {
  var budgetOrderIterator = AdWordsApp.budgetOrders().get();
  while (budgetOrderIterator.hasNext()) {
    var budgetOrder = budgetOrderIterator.next();
    var limitText = "";
    if (budgetOrder.getSpendingLimit() == null) {
      limitText = "unlimited";
    } else if (budgetOrder.getTotalAdjustments() == null) {
      limitText = budgetOrder.getSpendingLimit();
    } else {
      limitText = budgetOrder.getSpendingLimit() - 
budgetOrder.getTotalAdjustments();
    }
    Logger.log("Budget Order [" + budgetOrder.getName() + "] base spending 
limit: " + limitText);
  }
}


Den fredag 18 augusti 2017 kl. 11:19:20 UTC+2 skrev Александр Ризун:
>
> Hello. Sorry, for my bad english. I use translate.
>  I want use first BudgetOrders snippet here 
> <https://developers.google.com/adwords/scripts/docs/examples/budget-orders>. 
> But i get error: Failed to read from AdWords. Please wait a bit and try 
> again. (line 5). 
> Why? What am I doing wrong?
>
>
> <https://lh3.googleusercontent.com/-GIITpN71TNE/WZaqjYdeoSI/AAAAAAAANSA/Dqo3MrjsoQgQvA1C8GD-f8lIJnhIc4UsQCLcBGAs/s1600/2017-08-18-114811_1920x1080_scrot.jpg>
> Tnx for answers.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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+unsubscr...@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+unsubscr...@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/95abfb67-b434-44e7-ade2-42c508b72142%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Why erro... Александр Ризун
    • Re:... 'Sreelakshmi Sasidharan (AdWords API Team)' via AdWords API Forum
    • Re:... Mikael Wallgren

Reply via email to