• Joseph Carper
  • NEWBIE
  • 0 Points
  • Member since 2016

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

I have a Visual force email template on a workflow action. That will fire upon creation of Account and when it meets a check box to true and not a specific profile user. To test it I also have added the task, which creates parallalely. 
Problem I am facing is when I have added the component to the Vf email template then My Vf Template is giving me an error 
Below is the error 

Error occurred trying to load the template for preview: List has no rows for assignment to SObject. Please try editing your markup to correct the problem.

What could be the possible issue can you please help me out on this.

Below is my class for the vf component which gets account id.

public class CTBnewmyresourceemail {
    List<asset> assetlist = new List<asset>();
    Account accdetails = new Account();
    public id recId;
    public Account thisAccountId { get; set; }
    public CTBnewmyresourceemail()
    {
    recId = ApexPages.currentPage().getParameters().get('Id');
   
    accdetails = [select id from account where id=:recId limit 1];
    assetlist = [select id,accountid,description from asset where accountid =:accdetails.id];
    //return assetlist;
    }
    public List<asset> getAccount_assets() {
        return assetlist;
    }    
}

Did I made any mistake in it please suggest me.
Also In the visual force page I am trying to display the asset field value of that particular account.

THanks in advance
Prad