• aiyaz_SFDC
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 11
    Replies

Just hoping to get some advise:

 

- i'm trying to set up a trigger on task insert and update and since tasks can be associated to various objects Accts, Opps, Contacts, Cases, Leads, etc) I will need to create a trigger that can handle every scenario!  Has anyone done this?

 

- what should I consider (eg. the values of WhoID, whatID etc??)

 

- should I make several triggers for the Task object, or can it be done just as effectively in one trigger?

 

Any suggestions would be great!

 

Thanks in advance!

Hi I was wondering whether this could be done.

 

I have a custom picklist on a task record, and based on what is selected there, it will update the picklist value on the account that the task associated to.  So everytime a new task is create for that account and the picklist value is selected, it will also update the picklist on the Account record. 

 

Any advise or suggestion?

Hello All,

 

I'm receiving a compile error -

 

(Error: Compile Error: Initial term of field expression must be a concrete SObject: LIST:SOBJECT:Lead at line 21 column 29)

 

for the following trigger code which I found in the salesforce wiki.  I'm unsure what is wrong with the "Initial term", can anyone help with this?

 

 

 

/* * Simple round robbin lead assignment, * trigger assumes the following custom fields on the User object * User. * Receiving_Leads__c -- are they open for new leads at this time * Open_Leads_Owned__c -- how many leads do they have right now * * if no matching new owner is found the default for the org is the new owner */ trigger triggerLeadRoundRobin on Lead ( before insert , after insert, after update , after delete) { if (Trigger.isBefore && Trigger.isInsert) { // find the user who can accept leads and which has the fewest at the moment Double least = 99999; // start with large number, find which user has least for ( User u : [select id,lastname,Open_Leads_Owned__c from User where isActive = true and Receiving_Leads__c = true]) { if ( u.Open_Leads_Owned__c == null || u.Open_Leads_Owned__c < least) { Trigger.new.ownerid = u.id; // this user will own the new lead least = u.Open_Leads_Owned__c; // changes owner before record is inserted } } } /* remaining code will keep the (summary field) Open_Leads_Owned__c * uptodate on each user record adjusts the value on insert, delete and transfer */ if (Trigger.isAfter) { if (Trigger.isInsert) { System.assert(Trigger.old == null,' old data row cannot exist at insert?'); System.assert(Trigger.new != null,' expected new object row in isInsert'); leadOwnerRelation.updateOpenLeadCount( Trigger.new.ownerid ); // call to a package } else if (Trigger.isUpdate ) { // as in change owner // here we have to recalc both the old owner and new owner System.assert(Trigger.old != null,' old data row must exist at update'); System.assert(Trigger.new != null,' what, no new in Trigger data in update'); if (Trigger.old.ownerid != Trigger.new.ownerid ) { // update includes a transfer owner leadOwnerRelation.updateOpenLeadCount( Trigger.old.ownerid ); leadOwnerRelation.updateOpenLeadCount( Trigger.new.ownerid ); } } else if (Trigger.isDelete) { System.assert(Trigger.old != null,' old data row must exist at delete time'); System.assert(Trigger.new == null,' cant have new object in isDelete'); leadOwnerRelation.updateOpenLeadCount( Trigger.old.ownerid ); } } } // end of trigger

 

Hi All,

 

This may be a really simple question:

 

 I have just installed eclipse and I want to be able to use the WSDL.   Are there any specifics steps I need to take to use the wsdl for Java projects?

 

Thanks for any help!

Hi,

 

I am having  problem with a web to lead form not capturing leads in the system.  If I just simply generate the code from the web-to-lead generator it works with no problem, however when using an existing form and addeing the input type="hidden" name="sfga" value="OID",  it goes not seem to work.  I got this straight from the help section (Setting Up Lead Tracking - https://na1.salesforce.com/help/doc/user_ed.jsp?section=help&target=adwords_lead_conversion_tracking.htm&loc=help&hash=TestSetup-title)

 

Any help will be great on this.  Thank you.

 

Below is a snippet of what has been added.

 

<form onSubmit="saveHarvestPoints();chkfrm(this);" name="frm" method="post" action="/common/php/autodemo.php"> <input type="hidden" name="sfga" value="00D30000000XXXXX (the actualy org ID)"/> <input type="hidden" name="postpage" value="cpm_autodemo_request">

 

Is  there a sure set way to verify whether a lookup field is empty? 

 

Thanks for any help.

Hi,

 

I know this sound a bit weird but i'm sure others may have done something like the following use case:

 

- Select a value from a Picklist field (eg. Other)

 

- when "Other" selected, a custom field will display below allowing the user to enter a value for "other"

 

Any ideas or best practices on such a use case scenario?

 

Any help will be great.

 

Hi,

 

 

I have a custom object (Bonds) that has a lookup field that displays Accounts which creates the Child-to-Parent relationship.

 

Currently i'm working with Visualforce to display Accounts detail along with just the current month's Bonds.  When I view the WSDL I see that Bonds is set as a related object (Bonds__r).  When I set up a SOQL query i'm unsure whether I am on the right track although I believe I should be using the "__r" notation when referencing the relationship.   Below is the query: 

 

 

 

Account[] ab =
[SELECT Name, (SELECT BondVol__c FROM Bonds__r) FROM Account]

 

 

Hi,

 

I am receiving an error in the code  provided

 

Error: Compile Error: unexpected token: return at line 15 column 5

 

but I'm unsure what is causing it.  Can anyone help?

 

public class AccountExtension {

private final Account BondObj;


public AccountExtension(ApexPages.StandardController controller) {
this.BondObj = (Account)controller.getSubject();
}

public Account[] getSecurities(){
Account[] ab =
[SELECT Name, (SELECT AccVol__c FROM Bonds__r) FROM Account]


return ab;
}


}

==================================================================

Error message -> 


Error: Compile Error: unexpected token: return at line 15 column 5

 

 Thanks for any help!

Just hoping to get some advise:

 

- i'm trying to set up a trigger on task insert and update and since tasks can be associated to various objects Accts, Opps, Contacts, Cases, Leads, etc) I will need to create a trigger that can handle every scenario!  Has anyone done this?

 

- what should I consider (eg. the values of WhoID, whatID etc??)

 

- should I make several triggers for the Task object, or can it be done just as effectively in one trigger?

 

Any suggestions would be great!

 

Thanks in advance!

Hi I was wondering whether this could be done.

 

I have a custom picklist on a task record, and based on what is selected there, it will update the picklist value on the account that the task associated to.  So everytime a new task is create for that account and the picklist value is selected, it will also update the picklist on the Account record. 

 

Any advise or suggestion?

Hi,

 

I am having  problem with a web to lead form not capturing leads in the system.  If I just simply generate the code from the web-to-lead generator it works with no problem, however when using an existing form and addeing the input type="hidden" name="sfga" value="OID",  it goes not seem to work.  I got this straight from the help section (Setting Up Lead Tracking - https://na1.salesforce.com/help/doc/user_ed.jsp?section=help&target=adwords_lead_conversion_tracking.htm&loc=help&hash=TestSetup-title)

 

Any help will be great on this.  Thank you.

 

Below is a snippet of what has been added.

 

<form onSubmit="saveHarvestPoints();chkfrm(this);" name="frm" method="post" action="/common/php/autodemo.php"> <input type="hidden" name="sfga" value="00D30000000XXXXX (the actualy org ID)"/> <input type="hidden" name="postpage" value="cpm_autodemo_request">

 

Is  there a sure set way to verify whether a lookup field is empty? 

 

Thanks for any help.

Hi,

 

I know this sound a bit weird but i'm sure others may have done something like the following use case:

 

- Select a value from a Picklist field (eg. Other)

 

- when "Other" selected, a custom field will display below allowing the user to enter a value for "other"

 

Any ideas or best practices on such a use case scenario?

 

Any help will be great.

 

Hi,

 

 

I have a custom object (Bonds) that has a lookup field that displays Accounts which creates the Child-to-Parent relationship.

 

Currently i'm working with Visualforce to display Accounts detail along with just the current month's Bonds.  When I view the WSDL I see that Bonds is set as a related object (Bonds__r).  When I set up a SOQL query i'm unsure whether I am on the right track although I believe I should be using the "__r" notation when referencing the relationship.   Below is the query: 

 

 

 

Account[] ab =
[SELECT Name, (SELECT BondVol__c FROM Bonds__r) FROM Account]

 

 

I was hoping that SFDC would add time based rule evaluation to the workflow capabilities.  That is, to run workflow rules without requiring the record to be modified first to trigger the rule.
 
My example is we allow some accounts be have a protected status as long as they have certain activity in a certain time period.  I've created the field that shows the days since said qualified activity occured, I have a workflow that will change the protected status based on the value in that qualified activity age field.
 
However, the rule only runs when someone modifies the account, so accounts can be falsely protected simply by not editing them.
 
I'm trying to find a way to make this rule run periodically without the modification.
 
Any suggestions?
 
Thanks,
 
Michael