• Bill Button
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 6
    Replies
Hi,
 
Not sure why I am getting this error or how to get round it, the field has been defined as a Number(1,0) but I get an error when I compare this to 0 or 1. The filed has 3 possible values 0,1,2 currently.
 
 
 public String Edgecam_BGColor() {
  string BGColor = '';
  
  // ss_edgecam__c is defined as Number(1, 0)
  // but on the if's I get an error when saving
  // Comparison arguments must be compatible types
  // schema.SObjectField, Integer
  
  if (account.ss_edgecam__C == 0) {
   BGColor = '';
  } else if (account.ss_edgecam__C == 1) {
   BGColor = '#C0FFC0';
  } else {
   BGColor = '#FFC0C0';
  }
  return BGColor;
 
Hi,
 
Is it possible and if so how; to have conditional content on a visual force page. In the customer portal we have differnt types of Portal Users and based on a custom field called Brand on the account they are associated with, we want to display different content on a visual force page.
 
Regards
Bill Button
Business Systems Development Manager
Hi,
 
We are in the process of implementing and deploying the Salesforce Customer Portal, and would like to know the best way to controll access. When a user logs in, if they have a valid Contract with a Contract End Date in the future we want to make available the full customer portal, if however they do not have a valid contract we want to change their profile so they only have some basic tabs.
 
Whats the best way to approach this, does this need to be done from Apex or is there some standard functionality I have not found.
 
Regards
Bill Button
Business Systems Development Manager
Hi,
 
I am having toruble with a simple or statement, the following works when the first condition is true but not on the second condition
 
integer AssignmentRegionOnly = [select Count() from Assignment__c where Country__c = :a.Country and (State_County__c = :a.State or State_aka__c = :a.state) and brand__c includes (:a.brand__C)];
Regards
Bill
Hi,
 
When I try to do a select on a multi-select picklist I am getting an error as below, any help would be much apprietiated.
 

trigger TestingSyntax on Lead (before insert) {

for (Lead a : Trigger.new) {

 // the following gets no error but is not what I need.

Assignment__c AssignThis = [select Area_Account_Manager__c from Assignment__c where Country__c = :a.Country and brand__c = 'Edgecam'];

// the following causes the error "Save error: unexpected token: :"

//Assignment__c AssignThis = [select Area_Account_Manager__c from Assignment__c where Country__c = :a.Country and :a.brand__C in brand__c];

// or this alos get the same error.

//Assignment__c AssignThis = [select Area_Account_Manager__c from Assignment__c where Country__c = :a.Country and 'Edgecam' in brand__c];

}

}

Bill

Hi,
 
How to check number of records returned. Currentrly when I try to make "if (AssignmentRegionOnly = 1) {" it errors with condition expression must be of type Boolean.
 
 
 for (Lead a : Trigger.new) {
  integer AssignmentRegionOnly = [select Count() from Assignment__c where Country__c = :a.Country and State_County__c = :a.State];
  if (AssignmentRegionOnly > 0) {
   Assignment__c AssignThis = [select Area_Account_Manager__c,Reseller__c from Assignment__c where Country__c = :a.Country and State_County__c = :a.State];
   SendEmail = 1;
   a.OwnerId = AssignThis.Area_Account_Manager__c;
   if (AssignThis.Reseller__c != null ) {
    a.Reseller__C = AssignThis.Reseller__C;
    SendToReseller = 1;
   }
  }
  else {
   integer AssignmentRules = [select Count() from Assignment__c where Country__c = :a.Country];
   if (AssignmentRules > 0) {
    Assignment__c AssignThis = [select Area_Account_Manager__c,Reseller__c from Assignment__c where Country__c = :a.Country];
    a.OwnerId = AssignThis.Area_Account_Manager__c;
    SendEmail = 1;
    if (AssignThis.Reseller__c != null ) {
     a.Reseller__C = AssignThis.Reseller__C;
     SendToReseller = 1;
    }
   }
   else {
    //
    // No Match Found need to assign to Lead Queue
    //
    a.OwnerID = '00G20000000qGsmEAE';
    SendEmail = 1;
    SendToReseller = 0;
   }
  }
 
Thanks
Bill
 
How do you check an ID field is not blank, I get an exception error 'invalid id' on the following for the if statement.
 
Assignment__c AssignThis = [select Area_Account_Manager__c,Reseller__c from Assignment__c where Country__c = :a.Country and Region__C = :a.State];
SendEmail = 1;
a.OwnerId = AssignThis.Area_Account_Manager__c;
if (AssignThis.Reseller__c <> '') {
    a.Reseller__C = AssignThis.Reseller__C;
    SendToReseller = 1;
}

 
 
I have created the following trigger and am not sure how to send an email with the details of the lead to an external email address, but I do have the email address in my custom object Assignment__c. I also would like to be able to assign some leads to a queue when no match is found. If their are any suggestions in improving the code I would be very greatful as this is my fist attempt at a trigger.
 
trigger AssignReseller on Lead (Before Insert) { 
 for (Lead a : Trigger.new) {
  integer AssignmentRegionOnly = [select Count() from Assignment__c where Country__c = :a.Country and Region__C = :a.State];
  if (AssignmentRegionOnly > 0) {
   Assignment__c AssignThis = [select Area_Account_Manager__c,Reseller__c from Assignment__c where Country__c = :a.Country and Region__C = :a.State];
   a.OwnerId = AssignThis.Area_Account_Manager__c;
   a.Reseller__C = AssignThis.Reseller__C;
  }
  else {
   integer AssignmentRules = [select Count() from Assignment__c where Country__c = :a.Country];
   if (AssignmentRules > 0) {
    Assignment__c AssignThis = [select Area_Account_Manager__c,Reseller__c from Assignment__c where Country__c = :a.Country];
    a.OwnerId = AssignThis.Area_Account_Manager__c;
    a.Reseller__C = AssignThis.Reseller__C;
   }
   else {
    system.debug('Would like to assign lead to a queue here');
   }
  }
 }
}
 
Regards
Bill Button
Business Systems Development Manager
Hi,
 
Not sure why I am getting this error or how to get round it, the field has been defined as a Number(1,0) but I get an error when I compare this to 0 or 1. The filed has 3 possible values 0,1,2 currently.
 
 
 public String Edgecam_BGColor() {
  string BGColor = '';
  
  // ss_edgecam__c is defined as Number(1, 0)
  // but on the if's I get an error when saving
  // Comparison arguments must be compatible types
  // schema.SObjectField, Integer
  
  if (account.ss_edgecam__C == 0) {
   BGColor = '';
  } else if (account.ss_edgecam__C == 1) {
   BGColor = '#C0FFC0';
  } else {
   BGColor = '#FFC0C0';
  }
  return BGColor;
 
Hi,
 
I am having toruble with a simple or statement, the following works when the first condition is true but not on the second condition
 
integer AssignmentRegionOnly = [select Count() from Assignment__c where Country__c = :a.Country and (State_County__c = :a.State or State_aka__c = :a.state) and brand__c includes (:a.brand__C)];
Regards
Bill
Hi,
 
How to check number of records returned. Currentrly when I try to make "if (AssignmentRegionOnly = 1) {" it errors with condition expression must be of type Boolean.
 
 
 for (Lead a : Trigger.new) {
  integer AssignmentRegionOnly = [select Count() from Assignment__c where Country__c = :a.Country and State_County__c = :a.State];
  if (AssignmentRegionOnly > 0) {
   Assignment__c AssignThis = [select Area_Account_Manager__c,Reseller__c from Assignment__c where Country__c = :a.Country and State_County__c = :a.State];
   SendEmail = 1;
   a.OwnerId = AssignThis.Area_Account_Manager__c;
   if (AssignThis.Reseller__c != null ) {
    a.Reseller__C = AssignThis.Reseller__C;
    SendToReseller = 1;
   }
  }
  else {
   integer AssignmentRules = [select Count() from Assignment__c where Country__c = :a.Country];
   if (AssignmentRules > 0) {
    Assignment__c AssignThis = [select Area_Account_Manager__c,Reseller__c from Assignment__c where Country__c = :a.Country];
    a.OwnerId = AssignThis.Area_Account_Manager__c;
    SendEmail = 1;
    if (AssignThis.Reseller__c != null ) {
     a.Reseller__C = AssignThis.Reseller__C;
     SendToReseller = 1;
    }
   }
   else {
    //
    // No Match Found need to assign to Lead Queue
    //
    a.OwnerID = '00G20000000qGsmEAE';
    SendEmail = 1;
    SendToReseller = 0;
   }
  }
 
Thanks
Bill
 
How do you check an ID field is not blank, I get an exception error 'invalid id' on the following for the if statement.
 
Assignment__c AssignThis = [select Area_Account_Manager__c,Reseller__c from Assignment__c where Country__c = :a.Country and Region__C = :a.State];
SendEmail = 1;
a.OwnerId = AssignThis.Area_Account_Manager__c;
if (AssignThis.Reseller__c <> '') {
    a.Reseller__C = AssignThis.Reseller__C;
    SendToReseller = 1;
}

 
 
Hi all,
 
Do we have a function to trigger lead assignment email (using the notification template defined on the assignment rule) via the API after the Winter 07 release?
 
Thanks,
 
Scott