• markdamo
  • NEWBIE
  • 55 Points
  • Member since 2008

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

Hi,

 

  I Created a E-Mail Template for Leads. My Requirement is to add Lead Name in the Subject Line.

 

  I tried adding Below code in the subject but its not showing when email is triggered 

 

 {!Lead.Name}

 Please suggest me how to add.

 

Thanks

Sudhir

Today I am running into an Apex error ' Illegal assignment from LIST<User> to User' with the following piece of code.

 

User u =[Select u.Profile.Name, u.ProfileId From User u where u.UserName = :username];

 

This code worked ok last week with no errors but today I cannot get this to work and I dont know why!

 

Ive tried to change the code to 

User[] u =[Select u.Profile.Name, u.ProfileId From User u where u.UserName = :username];

but this also errors out with 'Illegal assignment from LIST<User> to LIST<User>'

 

Any help/pointers would be greatly appreciated.

 

I am an experienced Business Systems Analyst and Software Engineer, with several years of experience in consulting and implementing web-based (SaaS) systems for companies across Ireland, UK and USA. I have primarily worked in the Web Development & Design sector with a number of year’s commercial experience working with salesforce.com. 

My responsibilities have included project analysis, development and delivery including client management, requirements analysis, design, custom development, implementation, end user training and ongoing support. 

I have been working closely in UK & Ireland with Salesforce.com as a consulting partner and have successfully deployed a number of Salesforce.com implementations utilising out the box functionality and bespoke development.  

 

Salesforce.com Specific experience:

Consulting: 

- Standard (out of the box) Salesforce.com Roll outs. Service Cloud, Sales Cloud, Marketing Cloud and custom AppExchange Apps.
- Partner Portal.
- Work Flow and Approval Processes. 
- Security Permissioning. 
- Content Module Roll outs.
- User Training.

Development:

- Saleforce.com Sites + Web site integration (Web to Lead + Web to Case).
- Solutions Architecture.
- Apex Coding.
- API Integration with External Data Sources
- Triggers.
- VisualForce Development.

 

Specialties

- CRM + Enterprise Software Solutions.
- Salesforce.com.
- Force.com.
- Visualforce.
- APEX.
- Business Proccess Consulting.
- Project Management.
- System integration.
- Web Start-ups.
- Software Development (VB.NET, C#, ASP, PHP).

 

For more info visit www.mreconsultancy.com.

Does anyone know if the code for the LinkedIn control that was created in this Visual Force demo video (http://wiki.apexdevnet.com/index.php/Visualforce_Demo) is available anywhere online.  Ive been looking everywhere and cant find it. 

Today I am running into an Apex error ' Illegal assignment from LIST<User> to User' with the following piece of code.

 

User u =[Select u.Profile.Name, u.ProfileId From User u where u.UserName = :username];

 

This code worked ok last week with no errors but today I cannot get this to work and I dont know why!

 

Ive tried to change the code to 

User[] u =[Select u.Profile.Name, u.ProfileId From User u where u.UserName = :username];

but this also errors out with 'Illegal assignment from LIST<User> to LIST<User>'

 

Any help/pointers would be greatly appreciated.

 

Hi, 

For a couple of days I've been receiving this kind of line in my debug logs. I guess this is realated to the new API version (v37.0). 
I would n't care about this if didn't receive thousands of lines like this one in all my traces. 

17:02:42.238 (238882742)|USER_INFO|[EXTERNAL]Salesforce user id| username| GMT time

My debugs levels are: 

Database               INFO
Workflow                INFO
Validation               INFO
Callouts                 INFO
Apex Code            INFO
Apex Profiling        DEBUG
Visualforce            NONE
System                 NONE

Thanks

Hi,

 

  I Created a E-Mail Template for Leads. My Requirement is to add Lead Name in the Subject Line.

 

  I tried adding Below code in the subject but its not showing when email is triggered 

 

 {!Lead.Name}

 Please suggest me how to add.

 

Thanks

Sudhir

Hi,

 

I want to create an lead assignment rule to Sales Team of a specific project.Project is a lookup field which is created in Lead.

Say if Project is X ,lead should assign to three users A,B ,C.

 

The rule is to have an automated assignment of leads to these users in a rotational system of 5 leads each.

Ex: The first set of 5 leads to be assigned to the user A and the next 5 leads to B & the last set of 5 leads to C and the cycle continues in this order.

 

I know there is possibility using roundrobin lead assignement.Can anyone one explain how the fuctionality works here

 

Thanks

  • May 14, 2013
  • Like
  • 0

hi all

 i have written this trigger but in sandbox its working but in live its giving errors plz some one help me rewr

public class updateasset1 {
public static boolean isfuture=false;
public static void oli (OpportunityLineItem[] OLI)
      {
     if (isfuture==false){
     isfuture=true;
   // for(OpportunityLineItem ol: OLI){  
   OpportunityLineItem ol = OLI[0];
 ol = [Select UnitPrice,OpportunityId, Opportunity.Account.Id , Quantity,Fully_Shipped_Date__c,Shipped_Quantity__c, PricebookEntry.Product2Id,Create_Asset__c, PricebookEntry.Product2.Name,Product_Shipment_Status__c, Description From OpportunityLineItem where OpportunityLineItem.Id = :ol.Id limit 1]; 

        Asset[] ast = new Asset[]{}; 
        Asset a = new Asset();        
 
 
 
 
 
 
if(ol.Product_Shipment_Status__c == 'Fully Shipped'&& ol.Create_Asset__c == false){ 

        
a = new Asset();   
a.Name = ol.PricebookEntry.Product2.Name;
a.Asset_Location__c =   'NONE' ;
a.AccountId = ol.Opportunity.Account.Id;            
a.Product2Id = ol.PricebookEntry.Product2Id;          

a.PurchaseDate =ol.Fully_Shipped_Date__c;
a.Quantity = ol.Quantity;
a.Price = ol.UnitPrice;
     
ast.add(a);           
ol.Create_Asset__c = true;  
 

  update OL; 
}
    
upsert ast;  
}
//}   
 }   
 }
trigger updateasset1 on OpportunityLineItem (after update) {OpportunityLineItem[] OLI = Trigger.new;
updateasset1.oli(OLI);
}
plz help me resolve the issue

 

 

ite the code to avoid the errors

 

 

Usual story trigger working fine, test class working to 86%. But can't seem to get the last part.

 

Here is the class (called by before insert trigger on opportunity).

 

The trigger is updating the type field on the account from 'Lead Acct' to 'Opportunity Acct'

 

 System.assertEquals(opp.Account.Type, 'Opportunity Acct') - this should equal, I could be late and something obvious, but I can't spot it.

 

Any help  appreciated 

 

public with sharing class OpportunityTriggerHandler {
	
		/**
		*	@author			Mike Gill
		*	@date			28/07/11
		*	@description	Update account type based on certain criteria
		*/

     
     public OpportunityTriggerHandler(){}
	
	//TODO: Add user custom persmission check
	
	 public void OnBeforeInsert(Opportunity[] newOpps){
	 	
		List<Account> accs = new List<Account>();
		
		for (Opportunity opp:newOpps){
			
			if (opp.Type == 'Lead Acct'){
				accs.add( new Account (id=opp.AccountId, Type = 'Opportunity Acct' ));
			}
			
		}
		
		update accs;  
     }
     
}

 

And here is the test class

 

@isTest
private class TestOpportunityTriggerHandler {
	
	/**
	*	@author			Mike Gill
	*	@date			28/07/11
	*	@description	Test Scenarios for Opportunity Trigger Handler
	*  	TODO: 			
	*/
	
	static List<Account> accounts;
	static List<Opportunity> opps;
	static List<Contact> contacts;
	
	static {
			
			// Empty Lists	
			accounts = new List<Account>();
    		opps = new List<Opportunity>();
    		contacts = new List<Contact>();
		
			// Fetch profile id
     		Profile p = [select id from Profile where name = 'Standard User'];
     		
     		// Create user for tetsing
     		User u = new User ( alias = 'testme', email = 'testme@noemail.com', emailencodingkey = 'UTF-8', lastname = 'test',languagelocalekey = 'en_US', 
     		localesidkey = 'en_US', profileid = p.Id, country = 'United Kingdom', timezonesidkey = 'Europe/London', username = 'testme@noemail.com');
     		insert u;
     		
     		// Add  Accounts to the list to be inserted	
     		for (Integer i = 0; i<1; i++){
     			Account a = new Account(
     			Name = 'Test' + i,
     			Type = 'Lead Acct',
     			BillingState = 'CA',
     			Industry = 'Business Services',
     			OwnerId = u.Id
     			);
     			accounts.add(a);
     		}
     		
     			insert accounts;
     	
     		
     		// Add Contacts to the list to be inserted
     		for (Account a: accounts){
     			
     			Contact c = new Contact();
     			c.FirstName = 'Test First';
     			c.LastName = 'Test Last';
     			c.LeadSource = 'Call In';
     			c.AccountId = a.Id;
     			contacts.add(c);
     			
     		}
     		
     		insert contacts;
     	
     		// Add Opps
     		for (Account a: accounts){
     			
     			
     			
     			Opportunity o = new Opportunity();
     			o.Name = 'Test Opp';
     			o.AccountId = a.Id;
     			o.CloseDate = Date.today();
     			o.StageName = '1-Qualified Prospect';
     			opps.add(o);
     			
     		}
  	
		
	}
	
    static testMethod void myUnitTest_CreateOpp() {
    	
    /**
    * @description	Test related account type is set to Opportunity Acct on create of opportunity
    */
    
    		test.startTest();
       	
       		// Check account type is Lead Acct before insert
       		for (Account acc:accounts){
       			System.assertEquals(acc.Type, 'Lead Acct');
       		}	
     	
     		
     		// Insert opps
     		insert opps;
     		
     		
     		// Check records
     		System.debug(Logginglevel.ERROR, 'EB/DEBUG TEST: Number of accounts created is'+ accounts.size() + ' id=' + accounts[0].Id);
     		System.debug(Logginglevel.ERROR, 'EB/DEBUG TEST: Number of contacts created is ' + contacts.size() + ' id=' + contacts[0].Id);
     		System.debug(Logginglevel.ERROR, 'EB/DEBUG TEST: Number of opps created is ' + opps.size() + ' id='+ opps[0].Id);

   		
   			// Query for newly inserted opps
     		List<Opportunity> o = [select Id, Account.Type  from Opportunity where Id in: opps];
   			
   			for (Opportunity opp:o){
   				System.assertEquals(opp.Account.Type, 'Opportunity Acct');
   			
   			}
       		
       		       	
       		// End test
       		test.stopTest();
       		
    }
  
}

 

 

 

Today I am running into an Apex error ' Illegal assignment from LIST<User> to User' with the following piece of code.

 

User u =[Select u.Profile.Name, u.ProfileId From User u where u.UserName = :username];

 

This code worked ok last week with no errors but today I cannot get this to work and I dont know why!

 

Ive tried to change the code to 

User[] u =[Select u.Profile.Name, u.ProfileId From User u where u.UserName = :username];

but this also errors out with 'Illegal assignment from LIST<User> to LIST<User>'

 

Any help/pointers would be greatly appreciated.

 

Hi All,

 

In my VF page some input fileds and dependent pick lists are there.I am overriding the standard save button.i had created dependent picklists using Vf with apex(using <apex:selectList>).All input fileds are saved but picklist values are not saved.if any one knows tell me the solution.

 

Thanks in advance,

manu..

  • January 05, 2010
  • Like
  • 0

Hi,

 

I just want to keep the filed named categories hidden on the ideas page. I am not getting an option to modify the field security settings to keep this categories field hidden. The user permissions set are view and create. Any help?

 

Thanks 

 

  • January 05, 2010
  • Like
  • 0

Hi,

 

I hope someone can help me with my problem concerning CMSForce and Customer Portal.

 

I have set HomePage as default Tab within Customer Portal. After login with a customer portal user I can see  the visual force page but not the content block items of the page. If I am using the same with sites everything works (without any login).

 

 It seems that the customer portal user with his profile can't see the content block items. I have no more idea what to change to make the content block items appear.

 

I have checked the debug protocol and can see that the items were queried, so the controllers run.

 

Does anyone know this issue and can help me with it?

 

Thanks,

Jochen 

I just installed CMSForce in development as a trail before I go forth with production...

The first 6 steps of the installation process are concerning. We have way too many documents, dashboards, letterheads, workflows etc that we already have set up in Salesforce. I do not want any existing settings changed that would impact their current function.  Can you verify before I install to production? Thanks!

  1. Change the visibility settings for any installed documents, reports, dashboards, letterheads, email templates, and custom fields on standard objects. By default, these components are visible to all users. Set the Running User for any installed dashboards or analytic snapshots; by default, it is set to you.
  2. Set the Running User for any installed dashboards or analytic snapshots; by default, it is set to you.
  3. Specify the appropriate recipients for any installed workflow tasks.
  4. Specify the appropriate assignees for any installed workflow alerts.
  5. Specify the appropriate user for workflow field updates that modify the Owner field or user lookups; by default, it is set to you.
  6. Create a schedule for any installed analytic snapshots.
  7. Configure any additional settings for this package from the package detail page.
  8. Deploy the package by clicking Deploy Now below. You can also do this at any time in the future from the package detail page.