• Sahba Shabrokh 3
  • NEWBIE
  • 25 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Hi all,

I need more flexibility in the lightning component aspect of SF and i am relativity new in this.

how can i convert this detailed URL button into a lightning component: 

/apex/echosign_dev1__AgreementTemplateProcess?masterId={!Quote.Id}&templateId=a2a1p00000667Xw

Just a background to this: since lighting you cannot use java script to validate a button. With lightning component you can use lightning record pages to hide components based on criteria.
Trying to basicly delete this apex class.

So i have changed the XML file staus to deleted. 

highlted the code and XML and tried to save to server.

But getting errors saying that the username in the test is duplicate. any ideas on how to delete? or overcome this?
 
/*
@Name           : TestUpdateAccountTeamMembers
@Author         : pwittmeyer@gmail.com  
@Date           : 4/3/2015
@Description    : Test Class for UpdateAccountTeamMembers trigger
*/

@isTest(seeAllData=TRUE)
private class TestUpdateAccountTeamMembers {
     static testMethod void validateAccountTeamMembers() {
     
        Profile p = [SELECT Id FROM Profile WHERE Name='Standard User']; 
        User u = new User(Alias = 'standt', 
                            Email='standarduser@testorg.com', 
                            EmailEncodingKey='UTF-8', 
                            LastName='Testing', 
                            LanguageLocaleKey='en_US', 
                            LocaleSidKey='en_US', 
                            ProfileId = p.Id, 
                            TimeZoneSidKey='America/Los_Angeles', 
                            UserName='testUserForTestUpdateAccountTeamMembers@testorg.com');
        insert u;
        User u2 = new User(Alias = 'standt2', 
                            Email='standarduser2@testorg.com', 
                            EmailEncodingKey='UTF-8', 
                            LastName='Testing2', 
                            LanguageLocaleKey='en_US', 
                            LocaleSidKey='en_US', 
                            ProfileId = p.Id, 
                            TimeZoneSidKey='America/Los_Angeles', 
                            UserName='testUserForTestUpdateAccountTeamMembers2@testorg.com');
        insert u2;
         
        /*Account a = new Account(Name = 'Test', Website = 'Http://test.com/', vertical__c = 'Adult',
                                                     Account_Manager_1__c = u.Id);
        insert a;
        
        Account a2 = new Account(Name = 'Test2', Website = 'Http://test.com/', vertical__c = 'Adult');
        insert a2;*/
        Account a = [SELECT Id, Name, Account_Manager_1__c FROM Account LIMIT 1];
        Account a2 = [SELECT Id, Name, Account_Manager_1__c FROM Account where Id != :a.id LIMIT 1];
        
        a.Account_Manager_1__c = u2.Id;
        a.Website_Currency__c = 'GBP';
        update a;
        
        a2.Account_Manager_1__c = u.Id;
        //update a2;
        
        a2.Account_Manager_1__c = null;
        //update a2;  
    }
}

 
Trying to comment out this entire class getting this issue: Unexpected token '<EOF>'.

Any Ideas?
/*
private class TestUpdateAccountTeamMembers {
     static testMethod void validateAccountTeamMembers() {
     
        Profile p = [SELECT Id FROM Profile WHERE Name='Standard User']; 
        User u = new User(Alias = 'standt', 
                            Email='standarduser@testorg.com', 
                            EmailEncodingKey='UTF-8', 
                            LastName='Testing', 
                            LanguageLocaleKey='en_US', 
                            LocaleSidKey='en_US', 
                            ProfileId = p.Id, 
                            TimeZoneSidKey='America/Los_Angeles', 
                            UserName='testUserForTestUpdateAccountTeamMembers@testorg.com');
        insert u;
        User u2 = new User(Alias = 'standt2', 
                            Email='standarduser2@testorg.com', 
                            EmailEncodingKey='UTF-8', 
                            LastName='Testing2', 
                            LanguageLocaleKey='en_US', 
                            LocaleSidKey='en_US', 
                            ProfileId = p.Id, 
                            TimeZoneSidKey='America/Los_Angeles', 
                            UserName='testUserForTestUpdateAccountTeamMembers2@testorg.com');
        insert u2;
         
        Account a = [SELECT Id, Name, Account_Manager_1__c FROM Account LIMIT 1];
        Account a2 = [SELECT Id, Name, Account_Manager_1__c FROM Account where Id != :a.id LIMIT 1];
        
        a.Account_Manager_1__c = u2.Id;
        a.Website_Currency__c = 'GBP';
        update a;
        
        a2.Account_Manager_1__c = u.Id;
        
        a2.Account_Manager_1__c = null;
    }*/
}
Hi all,

I need more flexibility in the lightning component aspect of SF and i am relativity new in this.

how can i convert this detailed URL button into a lightning component: 

/apex/echosign_dev1__AgreementTemplateProcess?masterId={!Quote.Id}&templateId=a2a1p00000667Xw

Just a background to this: since lighting you cannot use java script to validate a button. With lightning component you can use lightning record pages to hide components based on criteria.