How can I delete an asset from a product?

I'm trying to delete an asset from a product. I tried the code below but product.removeAsset("Product name")); always returns false and the asset doesn't get deleted.

 var products = oAssetMgr.findProductsByName( "My Product");        var product = products[0];        var assets = product.getAssets();                for(var i = 0; i < assets.length; i++)        {        	if(assets[i].assetName == "Product name")        	{               var removed = product.removeAsset("Product name"));               print("Removed asset = " + removed);           }        }

 

Comments

Sign In or Register to comment.