• csathishbabu
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 5
    Replies

Hi Guys,

             Actually my requirement is to validate a stage in opportunity evry time a opportunity is created,Picklist values in stage are 1.pre-reserve,2.reserve,3.confirm,4.bfore 2 weeeks,5.before 3days...like that,if suppose a user select a picklist value of 3.confirm directly at the time of creating opportunity error should be throw to alert the user to select 1.pre-reserve,as im new to ssalesforce i need ur suggestions,thanks for help in advance. 

Hi I have created a visual Force page for Create a invoice for the Products added in The Relatedlist of opportunity Tab,

as im new to apex COntroller,I want to know how to retrive the products in the related list of opportunity tab to a visualforce page Suggest me an idea to achieve it ur help will be of great help Thanks.

Is it possible to disable or enable a standard Input field in salesforce,Actually i have to alter the salesprice field in products according to a flag i set in a products tab,if it so in which way i can achieve it,i have no idea abt it im new to saleforce thanks in advance sathish
Im using a custom button in opportunity tab to get INvoice for a particular Opportunity,In that case the Invoice PAge should Invoke only wen the Opportunity Created date should be less than 21 days from now,so if difference between is greater 21 days it should not invoke Here is my COde in Custom button link display type is detail page button if({!Opportunity.CloseDate} - {!Opportunity.CreatedDate} > 21){ window.parent.location.href = "/apex/Invoice_1?id="+'{!Opportunity.Id}'; }else{ //do nothing } Thanks in Advance Sathish
I have created a Custom Button in Opportunity tab called Invoice,and wen Click the custom Button It has to generate a Invoice for a particular Opportunity ID in a apex Page, Using Condition Only when Opportunity Name Equal to 'Testing' if not it has to be null.I have tried Several times using IF Control Statement,but im getting a error of URL NO LONGER EXIST, Here is my CUstom Button Code {!IF( Opportunity.Name = 'Testing' , '/apex/Invoice_1?id='&Opportunity.Id , null)} but its working fine wen the code is like below /apex/Invoice_1?id={!Opportunity.Id} Kindly Suggest me a Example for how to use IF statemnts in Calling URL Thanks in advance Sathish

Hi I have created a visual Force page for Create a invoice for the Products added in The Relatedlist of opportunity Tab,

as im new to apex COntroller,I want to know how to retrive the products in the related list of opportunity tab to a visualforce page Suggest me an idea to achieve it ur help will be of great help Thanks.

I have created a Custom Button in Opportunity tab called Invoice,and wen Click the custom Button It has to generate a Invoice for a particular Opportunity ID in a apex Page, Using Condition Only when Opportunity Name Equal to 'Testing' if not it has to be null.I have tried Several times using IF Control Statement,but im getting a error of URL NO LONGER EXIST, Here is my CUstom Button Code {!IF( Opportunity.Name = 'Testing' , '/apex/Invoice_1?id='&Opportunity.Id , null)} but its working fine wen the code is like below /apex/Invoice_1?id={!Opportunity.Id} Kindly Suggest me a Example for how to use IF statemnts in Calling URL Thanks in advance Sathish
In salesforce Production/Developer edition test coverage shows only 13%.But same code in trail edition test coverage shows 88% And salesforce Production/Developer edition system.assert shows error "variable doesnot exist But in Trail edition no errror Code Visualforce page DocumentEmailer Apex class DocumentEmailController public with sharing class DocumentEmailController { public ID documentId {get;set;} public String email {get;set;} public List documents { get { if (documents == null) { documents = new List(); documents.add(new SelectOption('01570000001NZDn','Cup of Coffee? - DOC')); documents.add(new SelectOption('01570000001NZDi','Workflow Cheatsheet - PDF')); } return documents; } set; } public PageReference sendDoc() { Document doc = [select id, name, body, contenttype, developername, type from Document where id = :documentId]; Messaging.EmailFileAttachment attach = new Messaging.EmailFileAttachment(); attach.setContentType(doc.contentType); attach.setFileName(doc.developerName+'.'+doc.type); attach.setInline(false); attach.Body = doc.Body; Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); mail.setUseSignature(false); mail.setToAddresses(new String[] { email }); mail.setSubject('Document Email Demo'); mail.setHtmlBody('Here is the email you requested: '+doc.name); mail.setFileAttachments(new Messaging.EmailFileAttachment[] { attach }); // Send the email Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'Email with Document sent to '+email)); return null; } } Test code Test_DocumentEmailer @isTest private class Test_DocumentEmailer { static Document document; static { document = new Document(); document.Body = Blob.valueOf('Some Text'); document.ContentType = 'application/pdf'; document.DeveloperName = 'my_document'; document.IsPublic = true; document.Name = 'My Document'; document.FolderId = [select id from folder where name = 'My Test Docs'].id; insert document; } static testMethod void testDocumentEmailer() { PageReference pref = Page.DocumentEmailer; DocumentEmailController con = new DocumentEmailController(); Test.startTest(); System.assertEquals(2,con.documents.size()); // populate the field with values con.documentId = document.id; con.email = 'test@noemail.com'; // submit the request pref = con.sendDoc(); Test.stopTest(); } } In test code System.assertEquals(2,con.documents.size()); shows error Variable doesnot exist documents