• Congnizent
  • NEWBIE
  • 95 Points
  • Member since 2015

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

Using trigger, I just want to auto create new contract records under the opportunity when ever the Opportunity record record type is set to (Record Type1 or Record Type2 or Record Type3) and Opportunity Stage = Closed Won. also the Contract Record owner will be same as the Opportunity Owner for the auto created record.

Thanks & Regards,
Karthikeyan Chandran
Hi All,
In contact standard object we can assign new task to any contact we have. but now i need to get the updates regarding each task assigned to any contact.How to achieve this???
Hi,

I am creating a visualforce page where I am trying to include two javascript files, but they are not running when the VF page loads. What is the correct way to include javascript in VF?

I have tried (with no luck):
  1. <script src="{!$Resource.jquery}"></script>
  2. <apex:includeScript value="{!URLFOR($Resource.jquery, 'jquery.min.js')}"/>
  • September 18, 2015
  • Like
  • 0
Hi,

I had CustomObjectA and Account standard object. 'CustomObjectB' is a junction object between CustomObjectA and Account object. Now, on Case object I had Account lookup filed. When I click on Account lookup field on Case object needs to search based on CustomObjectA fields also.

Please suggest the solutions.

Note: By default we can search using Account object fields, but I want search using both CustomObjectA and Account object fields.
  • February 24, 2016
  • Like
  • 0
Hi

I would like to create under a separate tab "Knowledge base", where I could upload internal documents for common use (e.g. price lists, fact sheets, presentations, templates...). How can I do that? Or who can help me with that?

SalesForce custom support redirected me to this Forum.
"As we discussed over the call, in order to create a new separate Knowledge Base section, we would need to create a customized Visualforce page, where we can design the page meeting our business needs. We can add quick links to upload, download, view, print etc., internal documents such as price Lists, Fact sheets, Presentations, Templates, Documents etc."

P.S.
I am not a developer
Hi, 

I am trying to create a trigger when Users are created with a specific custom profile(there are multiple), they need to have the service cloud user flag checked. The trigger for enabling the flag on user creation was easy enough, but how do I limit to specific profiles? Is this possible?

trigger ForceServiceCloud on User (before insert) {
    for (User userInLoop : Trigger.new) {
        userInLoop.UserPermissionsSupportUser = true;
    }
}
Hi, 

I have two custom objects: Library and employees. Each employee record represents information about a user in the company. One of the fields is department.

In library i publish useful articles. 

How can I make salesforce search and assign tasks to employees to read a publisehd article when i select department "marketing" in the library object. Same field and value exists in employee object.

to sum up - when I publish an article for marketing I want each employee in markteing to get a task to read the article.
Hi,

Using trigger, I just want to auto create new contract records under the opportunity when ever the Opportunity record record type is set to (Record Type1 or Record Type2 or Record Type3) and Opportunity Stage = Closed Won. also the Contract Record owner will be same as the Opportunity Owner for the auto created record.

Thanks & Regards,
Karthikeyan Chandran

Hi,

I'm using partner api to identify the custom fields available in event page layout.
For almost all Salesforce accounts its working fine except for one which I encountered and it return the exception as below:

There is an error in XML document (1, 11638).

"The specified type was not recognized: name='VisualforcePage', namespace='urn:partner.soap.sforce.com', at layout."

The issue occurring because of visual force page to write notes after the event exists in that account. Once it has been removed then its working fine.

Please suggest, to resolve the issue without removing this visual force page.
 
Hi,
i am getting same error as Compile Error: AND operator can only be applied to Boolean expressions at line 5 column 41

Thanks,
Swathi.
what is the wsdl
what is the entrprise.wsdl?
              partner.wsl?
 
global class OPsCMMIBatchSendMail implements Database.Batchable<Sobject>,Database.AllowsCallouts
{
        
        
       /*  pmPlan__c cpm = pmPlan__c.getInstance('replyToAddress');          
         String reply = cpm.replyTo__c; */

       global Database.QueryLocator start(Database.BatchableContext BC)
        {
            String query = 'SELECT Id,Name,DM_s_E_Mail_ID__c,PM_s_EMAIL_Id__c FROM Ops_CMMI__c';
            return Database.getQueryLocator(query);
        }
       
       global void execute(Database.BatchableContext BC, List<Ops_CMMI__c> scope)
        {
            //List<String> maill=new List<String>();
         //   Set<String> email_new = new Set<String>();       
          ApexPages.PageReference report = new  ApexPages.PageReference('/00O61000002bwj9?csv=1');                          
          Messaging.EmailFileAttachment Attachment = new Messaging.EmailFileAttachment();  
          Attachment.setFileName('CMMI Report.csv');
        
         Attachment.setBody(report.getContent());
          Attachment.setContentType('csv');
         /*for(Ops_CMMI__c mp : scope)
          {
               List<String> email=new List<String>();
                Integer i;
                String mail = mp.PM_s_EMAIL_Id__c;
               
                if(mail!=Null)
                {
                    email = mail.split(',');
                   // system.debug(email);
                }
                for(i=0;i<email.size();i++)
                {
                   
                    email_new.add(email[i]);
                   // system.debug(maill);
                }
                if(mp.DM_s_E_Mail_ID__c!=Null)
                {
                    email_new.add(mp.DM_s_E_Mail_ID__c);
                     system.debug(i);
                }       
          }*/
              Messaging.SingleEmailMessage smail = new Messaging.SingleEmailMessage();  
              //List<Messaging.SingleEmailMessage> lMail = new List<Messaging.SingleEmailMessage>();        
             /*  List<String> setTo = new List<String>(email_new); 
                 integer num = setTo.size();               
                 system.debug(num);   */     
                smail.setToAddresses(new string[]{'abc@gmail.com'});
               
                smail.setReplyTo('xyz@gmail.com' (mailto:'xyz@gmail.com'));
                String messageBody = 'Dearr,';
                       messageBody +=' ';
                       messageBody +='One action.';
                       messageBody +=' PS:  This Automation.';                      
                smail.setHtmlBody(messageBody);
                              smail.setSenderDisplayname('mo');             
                smail.setSubject('CMMI Project(s)');          
                smail.setFileAttachments(new Messaging.EmailFileAttachment[]{Attachment});
                      
           Messaging.sendEmail(new Messaging.SingleEmailMessage[]{smail});
           
        }
           
       global void finish(Database.BatchableContext BC)
        {
           
        }

}




This is how the out put is..
This is the way my output after opening the attachment.

Any help appreciated .
Thanks in advance.
Hello,
Here i am tried to write a test class for importing csv file.THere is no code coverage.Plese help me on this.

Controller Class-
public class adminPriorSale {
    public list<Sales__c> accon{get;set;}
    public Sales__c agnt{get;set;}
    
    public Blob csvFileBody{get;set;}
    public string csvAsString{get;set;}
    public String[] csvFileLines{get;set;}
    
    public adminPriorSale(apexpages.standardcontroller controller )
   {
     agnt = new Distributor_Prior_Sales__c();
     accon = New List<Distributor_Prior_Sales__c>(); 
     accon=[selectid,Name,SMS_sales_amount__c,SMS_Year__c,Exhibit_A_Customer__c,Calculation_Type__c from Distributor_Prior_Sales__c]; 
     csvFileLines = new String[]{};
     
     }

public void importCSVFile(){
        
       try{
              csvAsString = csvFileBody.toString();
              csvFileLines = csvAsString.split('\n'); 
              for(Integer i=0;i<csvFileLines.size();i++){
               Sales__c prisale = new Sales__c () ;
               string[] csvRecordData = csvFileLines[i].split(',');
               prisale.Year__c= csvRecordData[0] ;             
               prisale.sales_amount__c= Decimal.valueof(csvRecordData[1]);
               prisale.Customer__c= csvRecordData[2];
               prisale.Calculation_Type__c = csvRecordData[3];   
               accon.add(prisale); 
             
           }
        upsert accon;
        
        }
        catch (Exception e)
        {
            ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR,e.getMessage());
            ApexPages.addMessage(errorMessage);
        } 
        
  } 
}   



Testclass-
 @isTest
private class test_ExhibitAadminPriorSale {
    static testMethod void test_ExhibitAadminPriorSale4()
    { 
      //  Distributor_Prior_Sales__c   t1= new Distributor_Prior_Sales__c  ();
        //t1.Name='test1';
        //t1.SMS_sales_amount__c =123;
        //t1.SMS_Year__c='2014';
       // insert t1;
  
      
        Document lstDoc = [select id,name,Body from Document where name = 'accttest'];
 
        ExhibitAadminPriorSale file=new ExhibitAadminPriorSale ();
        file.fileAccess();
        Blob content= lstDoc.Body;
        file.csvFileBody = content; 
        file.importCSVFile(); 

file.csvAsString =content.toString();
String[] csvFileLines = new String[]{};
List accon;

accon = new List();
for (Integer i=1;i<csvFileLines.size();i++)
{
String[] csvRecordData = new String[]{};
csvRecordData = csvFileLines [i].split(',');
//Distributor_Prior_Sales__c a = new Distributor_Prior_Sales__c ();
Distributor_Prior_Sales__c   t1= new Distributor_Prior_Sales__c  ();
        t1.Name='test1';
        t1.SMS_sales_amount__c =123;
        t1.SMS_Year__c='2012';
        t1.Exhibit_A_Customer__c='I Architects';
        t1.Calculation_Type__c='Estimated Prior sales';
        t1.RecordTypeId = '0011900000AFc6c';

accon.add(t1); 
try{
      insert accon;
}
catch (Exception e)
{
      ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured. Please check the template');
      ApexPages.addMessage(errormsg);
}

}
}
 
  • October 12, 2015
  • Like
  • 0
How can i get UserInfo.getOrganizationId() of particular orgID= 00D500000006n2CEAQ
Is it possible to create a report based on when a field gets changed. What I am trying to do is have a report that will populate any time total revenue is changed in a contract.
Hi All,
In contact standard object we can assign new task to any contact we have. but now i need to get the updates regarding each task assigned to any contact.How to achieve this???

Hi,

 

How can I execute linux bash script from Salesforce. I want to execute once a check box is checked and workflow gets triggered.

 

Could you please reply?

 

Thanks,

 

Rahul