• JoannaAtMaritz
  • NEWBIE
  • 25 Points
  • Member since 2009

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

I am trying to write simple trigger that needs some kind of not logic.  Can someone please give me some examples.  This is what I am trying to write

 


trigger SetLeadOwner on Lead (before insert, before update) {
for (Lead TempLead: System.Trigger.new)
if (TempLead.Owner not like('%Queue%'))
    {     
 TempLead.LeadOwner__c = TempLead.OwnerId;
    }
}

I have a custom lookup field to the User object on the Contact object called ContactOwner__c.  I need a trigger that can populate this with the contact's owner data upon insert and update.  This will be my first trigger, and I would appreciate some help with the syntax.

 

I'm thinking it should be something like this, but I'm not sure of the syntax to specify to indicate the current record that the trigger is firing on.  Also, does it matter if the event is "before" or "after" for this scenario?  Right now I have it set to "before".

 

trigger SetContactOwner on Contact (before insert, before update) {
thisContact.ContactOwner__c = thisContact.Owner;

}

 

Any help would be greatly appreciated.  Thanks!

Currently we have all of our e-mail templates in the standard unfiled public email templates folder.  However, we want to organize this better so that not all users have access to modify all of the email templates.

 

We want to create a new folder "Workflow and Approval Templates" and have its public folder access setting to Read/Write and have it set to "This folder is accessible only by the following users:" Group: System Administrators.  That way only the Sys Admins would be able to modify the templates used in our workflow and approval processes.

 

But, we want to make sure that moving our e-mail templates used in our workflow and approval processes to this new folder won't break our existing workflow and approval processes.  I had entered a case to Salesforce premier support, but their response was very unclear.  They said "After speaking with teir 2 support, I was advised that this will not break the  WFR /Approvals as long as templates are kept in public folders. Users must have access to the  folders."

 

I don't really understand what users must have access to the folders in order for the workflows to still work.  Can anyone advise me?  I'd like to set up some tests in our sandbox, but I want to make sure that the tests are really valid.  Why would every Salesforce user have to have access to the e-mail templates in order for e-mail alerts to still be able to access the templates for the workflow?  As a developer, I can't understand why that would be the case.  I would go back to Salesforce premier support, but I'm doubting their accuracy regarding this case.

We want to add a new custom checkbox field "BU Touched" to the Opportunity object.  If this field is true, then we want to display Amount, GP and Fee Income as read-only.  If it is false, then we want the 3 fields to be editable.

I believe that this can be done via Record Type.  But, our record types are already so numerous that this would add a lot of complexity to our system - just to accomplish this simple interface customization.  

Is there any other way to do this?  Or if not making the fields read-only, could we have some other kind of visual indication on the screen, and then we could write some validation rules to prevent the save if someone tried to edit the fields if the checkbox is true?  Any ideas?  Thanks.
If you have a custom report type, which a number of reports were created based on.  Then, if you remove a field from the page layout of the custom report type.  Will all of the reports that were created based on that custom report type be modified (removing the field)?  Or will they remain unchanged?  Thanks!
On the Lead object in SFC, there is a standard lookup field called Campaign.  We are trying to import Leads from a flat file, specifying the Campaign Id.  However, the Campaign field does not seem to be available via the Apex Data Loader or via Informatica.  Can anyone tell me how I can specify the campaign on a Lead for import?  Thanks!
We're implementing Leads in SFC now, and we have the need for a custom report that shows Won opportunities that have an Original Contact assigned (this is a custom lookup field to the Contact object) where that contact has a Campaign assigned in the Campaign History section.  Further, we would want to filter out opportunities that already have a Primary Campaign Source already filled in.

The need for this report stems from the fact that due to business requirements, we cannot convert leads to opportunities.  We can only convert leads to contacts.  So, the campaign data from the lead is tied to the contact but not the opportunity.  We're wanting a report so that we can periodically pull the data and manually assign the Primary Campaign Source to the opportunity based on the campaign history of the Original Contact.

I tried creating a custom report type tying Opportunities to Contact Roles to Campaign History.  But, the Contact Roles data is not required, so I really need it based on the contact data for the Original Contact on the opportunity.  Can anyone advise on how I can create this report?  Thanks!
Is there a way to change the field label of the Industry field on the Lead object?  Normally the field label property is editable, but I don't see a way to change this one.  Thanks!

We have a custom object SQB (Sales Qualification Briefs), which is a Master/Detail relationship with Opportunities.  We have an approval process set up on SQB.  I'm trying to set up an additional Workflow to do an e-mail notification for certain cases when certain SQBs are submitted for approval.

 

The way the approval process is set up is that the Initial Submission Actions include 1) Record Lock 2) Field Update (updating a custom field on the SQB called "Approval Status" to "Pending").

 

The requirements for this new workflow includes e-mailing Person A based on the following rules: 1) it must occur upon submission of the SQB, 2) The Opportunity that the SQB is based on must have a Business Unit (custom field) = Loyalty, 3) The user submitting the SQB must have Sector Leader (custom hierarchy field) = Person B.

 

So, here is the rule criteria that I set up:

(Sales Qualification Brief: Approval Status equals Pending) and (Opportunity: Business Unit equals Loyalty) and (Current User: Sector Leader equals 00580000001pZmw) - fyi 00580000001pZmw is the SFC id for Person B

 

 

And I have the Evaluation Criteriaset to:
When a record is created, or when a record is edited and did not previously meet the rule criteria
 
I've made sure to activate the workflow rule as well, and I've added the e-mail alert (hardcoded to e-mail myself).
 
To test, I've logged in as a user who has Person B as their Sector Leader, I went to a SQB that was on a Loyalty opportunity, and submitted it.  But, no e-mail was sent.  Is there anything wrong with my rule criteria?
 
I read in the SFC help text "Some functions are not available in workflow rule formulas. You cannot create a formula in which a custom object references fields on a parent object."  Does this mean that I cannot reference the Business Unit field in my rule criteria?  How can I get this workflow to work?
 
Thanks so much.
 
Joanna
 

 

 

My company is designing how we want to implement Leads/Campaigns.  We're running into some issues regarding how to implement the business requirements technically within Salesforce.  We're planning on implementing Web-to-Lead, in which users requesting information from us online (e.g.. when downloading a webcast) can be tracked in the system as Leads.

 

However, rather than simply having this add as a Lead, they want to go further.  If the Lead has the same e-mail address as an already existing contact in SFC, they want to send an alert to the contact's owner, add an activity to the contact, and then close the Lead.

 

Most of this seems like Workflow (e-mail alerts, adding the task, field update to close the lead).  But, I couldn't see how to create the Workflow Rule to check to search contacts based on e-mail address.  And, if one is found, to add the task and send the e-mail alert based on that contact.  Plus, what if there are multiple contacts with that same e-mail address?  Any advice?  Can this be done via Workflow? 

 

Or do I have to try to figure out how to do this via a trigger?  If I have to go the trigger route, is there any kind of sample trigger code regarding searching contacts by e-mail address, sending e-mail alerts, and adding an activity to a contact? 

 

Thanks so much.  Any advice is appreciated.

 

 

I need to create a dynamic link to our inhouse Sales Data Warehouse reports.  For this dynamic link, I need the beginning of the link, which is static:

http://servername.maritz.com:7778/reports/rwservlet?maso&AUTHID=charts/display1&p1=

 

For the p1 parameter, I need it comprised of a custom field on the user object  {!User.HR_ID__c}.  HR_ID__c is a numeric custom field, but in the link, it includes the commas.  How can I remove them?

 

Also in the p1 parameter, I need the current date.  I tried using the code: {!TODAY()}, but it is not formatting correctly for the link (see details below).

 

Here is the full custom link code that I am using:

http://servername.maritz.com:7778/reports/rwservlet?maso&AUTHID=charts/display1&p1={!User.HR_ID__c}{!TODAY()}

 

Here is what it results in:

http://servername.maritz.com:7778/reports/rwservlet?maso&AUTHID=charts/display1&p1=150%2C2518%2F20%2F2009

 

I need it to be:

http://servername.maritz.com:7778/reports/rwservlet?maso&AUTHID=charts/display1&p1=15025108202009

So, 150251 for the HR ID, and 08202009 for the date.

 

Further, once I have this, they actually want the p1 parameter (so the 15025108202009) encrypted in a simple manner.  The HR ID is always 6 digits, so they want it mixed up a bit (e.g. putting the last 3 digits of the HR ID, then putting the year from the date, then putting the 1st 3 digits of the HR ID, then putting the 2 digit day, then the 2 digit month - so, 25120091502008).  To, do this, can I still use a custom link?  Or do I need to switch to an s-control?  Is there any kind of documentation regarding how to do something like this?  I am new to force.com development, so I'm not sure of the syntax. Thanks so much for any help.

Hi,

My company has just purchased SFC, and we're currently working on integrating SFC with our internal system (specifically Opportunity data).  We're having trouble with consistency between our picklist values (on custom fields on the Opportunity object) and the descriptions in our internal system.

 

We're hoping that there's a way to export the picklist values for the fields on the Opportunity object, perhaps through the Apex Data Loader somehow?  That way it would make for easy comparison with our internal system's data.  Right now, the only option that we know of is to go into the Setup/Customize/Opportunities/Fields and then click into each picklist field to see the values.  We're hoping that there's a better way, though.

 

Thanks so much.

 

Joanna

I am trying to write simple trigger that needs some kind of not logic.  Can someone please give me some examples.  This is what I am trying to write

 


trigger SetLeadOwner on Lead (before insert, before update) {
for (Lead TempLead: System.Trigger.new)
if (TempLead.Owner not like('%Queue%'))
    {     
 TempLead.LeadOwner__c = TempLead.OwnerId;
    }
}

I have a custom lookup field to the User object on the Contact object called ContactOwner__c.  I need a trigger that can populate this with the contact's owner data upon insert and update.  This will be my first trigger, and I would appreciate some help with the syntax.

 

I'm thinking it should be something like this, but I'm not sure of the syntax to specify to indicate the current record that the trigger is firing on.  Also, does it matter if the event is "before" or "after" for this scenario?  Right now I have it set to "before".

 

trigger SetContactOwner on Contact (before insert, before update) {
thisContact.ContactOwner__c = thisContact.Owner;

}

 

Any help would be greatly appreciated.  Thanks!