• AnthonyB
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies

We have a (non Salesforce/force.com) application used by employees and now want to sprinkle a bit of "Social" all over it. So the decision to add Chatter was an easy one as they are all familiar with its capabilities. My question is, has anyone attempted to recreate the "Share box" used to update status info?

 

In particular, the challenge appears to be supporting @-mentions with its autocomplete picklist of employees. Is there a jQuery widget or other javascript codes available to duplicate its functionality?

 

Regards

Background, I want to update Account owner when user updates custom object (Budget__c) owner.

 

When user updates Budget__c owner, an after update trigger fires and updates related Account owner. When SysAdmin is logged in everything works fine else it fails validation rule.

 

Administrator set following validation rule on Account to prevent users updating ownerid directly (00e30000000mDYz is Sys Admin profile id)

 

AND(ischanged(OwnerId), $Profile.Id <> '00e30000000mDYz')

 

I was under impression Trigger runs as System Admin so why does this fail??

 

TIA  :robotfrustrated:

Background, I want to update Account owner when user updates custom object (Budget__c) owner.

 

When user updates Budget__c owner, an after update trigger fires and updates related Account owner. When SysAdmin is logged in everything works fine else it fails validation rule.

 

Administrator set following validation rule on Account to prevent users updating ownerid directly (00e30000000mDYz is Sys Admin profile id)

 

AND(ischanged(OwnerId), $Profile.Id <> '00e30000000mDYz')

 

I was under impression Trigger runs as System Admin so why does this fail??

 

TIA  :robotfrustrated:

Hi All,

 

Has anyone ever expierenced this error when using Javascript Remoting?

 

Visualforce Remoting Exception: Method 'updateMerchantProduct' not found on controller ManageLeadsRemote. Check spelling, method exists, and/or method is RemoteAction annotated.

 

Serialzed Code:



global with sharing class ManageLeadsRemote {
   
    @RemoteAction
    global static sObject[] searchMerchants(String divisionName, string MerchantType) 
        {    
            //This Function Works 
        }
    
    
    @RemoteAction
    global static boolean updateMerchantProduct(String MerchantType, String recordID, String ProductLine) 
        {
        system.debug('------------------------DEBUG---if you can read this we got in to this function');
            boolean updateCheck = false;
            if(MerchantType=='Account')
                {
                    update new Account(Id = recordID, CurrentProduct__c = ProductLine);
                    updateCheck = true;
                }
            if(MerchantType=='Lead')
                {
                    update new lead(Id = recordID, CurrentProduct__c = ProductLine);
                    updateCheck = true;
                }
            return updateCheck;
        }

}

 Javascript Code in my VisualForce Page that enacts this method:

function updateAccount(MType, acc, newVal) 
    {
        // Javascript Remoting to update Accout record
        alert(MType);
        alert(acc);
        ManageLeadsRemote.updateMerchantProduct(MType, acc.Id, newVal, function(result, event)
            {         
               if (event.status && event.result) 
                   {       
                          alert('Good Job - this worked!');
                   } else 
                       {
                          alert(event.message);
                       }
            }, {escape:true});
    }

 

I have a feeling the error message that is being thrown is not the error that is actually occuring, the alerts are firing before the updateMerchantProduct remote function and are passing in the correct params. So I'm stuck on this....

 

Thanks!

  • September 14, 2011
  • Like
  • 0

I need to create a trigger that is kicked off when a custom object is cloned. Now I can do this via a before insert trigger on the object, but how would I know that the object is being clone vs a brand new record insertion?

 

It doesn't look like there is a "iscloned" method on triggers or sobjects. Does anyone have any ideas?

 

Thanks!