we've found some of our records currently have a blank field which we need to populate using the values from a different custom field, because this will be a one time thing im writing a script in the anonymous debug window which will do this, so far i have written :
List<producto__c> prodOrdersIDs = [SELECT id, name, prod2__c, project__c, Quote__c from producto__c where prod2__c = null and Quote__c != null];
for(producto__c po: prodOrdersIDs ){
List<producto__c> QLIproduct2Id = [SELECT Quote__r.product2id from producto__c];
if(po.prod2__c = null){
po.prod2__c = po.Quote.product2id;
}
update po.prod2__c;
}
however this bring through the error : condition expression must be of type Boolean.
any idea where this is occurring would be greatly appreciated cheers
UPDATE:
this will now run but now comes through says theres too many future calls: 11
List<productorder__c> prodOrdersIDs = [SELECT id, name, product2__c, project__c, Quote_line_item__r.product2id, Quote_Line_Item__c from productorder__c where product2__c = null and Quote_Line_Item__c != null];
List<productorder__c> QLIproduct2Id = [SELECT Quote_line_item__r.product2id from productorder__c];
for(productorder__c po: prodOrdersIDs ){
if(po.product2__c == null){
po.product2__c = po.Quote_line_item__r.product2id;
}
update po;
}