• Courtesy
  • NEWBIE
  • 0 Points
  • Member since 2009

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

Hi,

 

Does anyone know if Salesforce Mobile will run on the new Blackberry 9700 Bold?  I think the 9700 runs on Blackberry OS 5.0.

 

The 9700 isn't yet in the supported devices list, but I wonder if it will work because I'd like to buy one and I want it work with SF mobile.

Contact Duplicate Trigger:

 

I've got the general idea on this, but my multiple conditions for the where clause are not working.  I need it to throw the error either if the email address matches or if the first name, last name, and one of the phone numbers match.  Parentheses don't seem to be helping drive the logic.  Who can give me some guidance here?

 

When I use this code it throws the error if the first and last name match regardless of whether there is a match on one of the phone numbers.  But I want it to only throw the error if a the full name and one of the phone numbers match an existing contact record.

 

trigger ContactDuplicateTrigger on Contact (before insert) {
for (Contact c : Trigger.new){
Contact[] contacts= [select id from Contact where
    ((FirstName = :c.FirstName and LastName = :c.LastName) and
    (Phone=:c.Phone or MobilePhone=:c.MobilePhone or HomePhone=:c.HomePhone or OtherPhone=:c.OtherPhone or Home_Phone_2__c=:c.Home_Phone_2__c)
)    or Email = :c.Email];
if (contacts.size() > 0) {
c.LastName.addError('Contact cannot be created - Contact already exists with the same email or name-phone combination.');
}
}
}

I'm trying to implement a trigger to prevent duplicate contacts from being entered.  The criteria is that it should prevent the contact from being added if the first and last name and any of the phone numbers match those of an existing contact, or if the email matches an existing contact regardless of whether the name matches or not.

 

Here's the code I'm trying to get it to accept:

 trigger ContactDuplicateTrigger on Contact (before insert) {
for (Contact c : Trigger.new){
Contact[] contacts= [select id from Contact where
    (FirstName = :c.FirstName and LastName = :c.LastName) and
    (Phone=:c.Phone or MobilePhone=:c.MobilePhone or HomePhone=:c.HomePhone or OtherPhone=:c.OtherPhone or Home_Phone_2__c=:c.Home_Phone_2__c)
    or Email = :c.Email];
if (contacts.size() > 0) {
c.LastName.addError('Contact cannot be created - Contact already exists with the same email or name-phone combination.');
}
}
}

 

Here's the error it gives me:

 

 Error: Compile Error: expecting right square bracket, found 'or' at line 6 column 4

 

I tried adding in parentheses to group the logic correctly, but I wonder if Apex support it.  Can someone help me with the syntax to enforce the desired logic?

 

Thank you!

Hello,

 

We are running a SF instance with 2 different companies under a parent company.  For cases, we don't want employees of company A to be able to transfer (change ownership of) the case to an employee of company B.

 

I'm trying to accomplish this by entering a validation rule on the Case Owner field.  Here is my initial attempt which produces a syntax error:

 

 OwnerId.CompanyName <>  $User.CompanyName

 

 The problem I'm running into is that I don't seem to be able to access the CompanyName field for the user who is the assigned owner of the case.  I'm not tied to this approach, I just need to accomplish the goal that employees of company A cannot assign cases to employees of company B and vice versa.

I've got to think this is a common request, but I didn't find an answer in my searching...

 

We are using Email-To-Case.  After a case is created, the support person will send an email to the customer from the support mailbox.  When the customer replies to that email, it is routed to Salesforce using email-to-case and the reply is automaticaly attached to the case because of the ID number in the email.

 

What I need to do is figure out how to make it so that an email alert is sent to the case owner to notify them that a customer's reply has been attached to their case.

 

Does anyone already have some code that does this?

Or, is there a way to forward the user to add products based upon the record type?

The end affect is that for one record type called "Syndication", a trigger will add a product to the opportunity. Otherwise, the user will be forwarded to the add products page.

Thanks in advance! 

Hi All,

Does anyone know how can I deploy from Sandbox to production?

I searched Change-Sets and tried to use Eclipse and even the meta-data API but could not deploy it to production.

Does any one know how to deploy assignment rule?

 

Thank you for your help,

 

Hi,

 

Does anyone know if Salesforce Mobile will run on the new Blackberry 9700 Bold?  I think the 9700 runs on Blackberry OS 5.0.

 

The 9700 isn't yet in the supported devices list, but I wonder if it will work because I'd like to buy one and I want it work with SF mobile.

Hello,

 

We are running a SF instance with 2 different companies under a parent company.  For cases, we don't want employees of company A to be able to transfer (change ownership of) the case to an employee of company B.

 

I'm trying to accomplish this by entering a validation rule on the Case Owner field.  Here is my initial attempt which produces a syntax error:

 

 OwnerId.CompanyName <>  $User.CompanyName

 

 The problem I'm running into is that I don't seem to be able to access the CompanyName field for the user who is the assigned owner of the case.  I'm not tied to this approach, I just need to accomplish the goal that employees of company A cannot assign cases to employees of company B and vice versa.

Hello,

I was trying to create a "Informational" Field in the close page layout. It will inform the users on what type of record they are closing. I created the field. I checked the field accessibility and security and profiles, seems OK. But when I go to close page layout, it does not show that field.

I am able to add to the Case Page Layouts, but not to the Closed Case Page Layouts.

When I checked the accessibility, it showed me where to assign the field in what page layout, but Close page layout is not an option. Only Case Page Layouts are shown, Closed Case Page Layouts are not available in the drop down box.

Any ideas?

Thanks

Sree

 

Or, is there a way to forward the user to add products based upon the record type?

The end affect is that for one record type called "Syndication", a trigger will add a product to the opportunity. Otherwise, the user will be forwarded to the add products page.

Thanks in advance!