Skip to content

Instantly share code, notes, and snippets.

@chadhutchins
Created July 30, 2013 12:13
Show Gist options
  • Save chadhutchins/6112401 to your computer and use it in GitHub Desktop.
Save chadhutchins/6112401 to your computer and use it in GitHub Desktop.
Loop through each Product (Quote line items) in SugarCRM and save it. You can use something like this to update SugarLogic/Calculated fields for a module.
<?php
$sql = "SELECT id FROM products WHERE deleted=0";
$result = $GLOBALS["db"]->query($sql);
while ($product = $GLOBALS["db"]->fetchByAssoc($result))
{
$product = BeanFactory::getBean("Products",$product["id"]);
$product->save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment