• Luciano Castro2019
  • NEWBIE
  • 0 Points
  • Member since 2018
  • Salesforce Business Analyst
  • INTLFCStone

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
I created the following validation rule: 

ISCHANGED(Lead_Source_INTL__c) &&
NOT(ISBLANK(PRIORVALUE(Lead_Source_INTL__c))) &&
$Profile.Name <> 'System Administrator' &&
$Profile.Name <> 'Sales Support' &&
$Profile.Name <> 'API User' &&
$Profile.Name <> 'Marketing Administrator' &&
NOT(BEGINS($User.Username, 'giselle.petit@intlfcstone.com'))

However, I cannot deploy it because the class below is failing:

static testMethod void ShouldNotAllowCustomStandardUserToUpdateLeadSource() {
        User u = [SELECT Id FROM User WHERE IsActive = true AND ProfileId = :sObjectCreator.customStandardUserProfileId LIMIT 1];
        Boolean hasValidationError = insertAndUpdateLeadSourceAsUser(u);
        System.assert(hasValidationError);

Unfortunately, my only developer is on vacation :(  and I am not sure what is going on. Please help!
 
We have a Subscribe button that will take you to a different webiste when you click on it. In Lightning, when you click on the button, the Navigate to this page message will pop-up. 

Button: Subscribe 
Display Type: Detail Page Button
Behavior: Execute JavaScript
Content Source: OnClick JavaScript 

Code: 

window.open('/apex/ConnectSignup?FirstName={!URLENCODE(Contact.FirstName)}&lastname={!URLENCODE(Contact.LastName) }&CompanyName={!URLENCODE(Contact.Company__c)}&email={!URLENCODE(Contact.Email)}&ContactId={!URLENCODE(Contact.CDSContact_ID__c)}');

Is it possible to add another line to prevent the pop-up from opening and take our user directly to the website?
I created the following validation rule: 

ISCHANGED(Lead_Source_INTL__c) &&
NOT(ISBLANK(PRIORVALUE(Lead_Source_INTL__c))) &&
$Profile.Name <> 'System Administrator' &&
$Profile.Name <> 'Sales Support' &&
$Profile.Name <> 'API User' &&
$Profile.Name <> 'Marketing Administrator' &&
NOT(BEGINS($User.Username, 'giselle.petit@intlfcstone.com'))

However, I cannot deploy it because the class below is failing:

static testMethod void ShouldNotAllowCustomStandardUserToUpdateLeadSource() {
        User u = [SELECT Id FROM User WHERE IsActive = true AND ProfileId = :sObjectCreator.customStandardUserProfileId LIMIT 1];
        Boolean hasValidationError = insertAndUpdateLeadSourceAsUser(u);
        System.assert(hasValidationError);

Unfortunately, my only developer is on vacation :(  and I am not sure what is going on. Please help!