• sunny.sfdc
  • NEWBIE
  • 34 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 30
    Replies
I have installed salesforce cli but when I am trying to execute any sfdx command. it is giving me error:
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module '../dist/versions'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (C:\Users\SharmSc\AppData\Local\sfdx\client\bin\sfdx.js:15:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
i am not able to use sfdx/vscode because of this blocker. 

I tried reinstalling salesforce cli, updating nodejs, resintalling vscode. Nothing worked.

Please let me know if anybody has any solution to this.
Hi 

I am writing a code which runs test classes and evaluate test coverage using tooling api. There are around 800 odd classes which when test classes are run splits into 4 bacthes of 200 each.

I want total test coverage of each class. I have some confusion around implementing the logic:

1. How salesforce calculates the percentage coverage if the same class is being covered in two separate test classes in two separate batches?
2. Are the test coverages for classs shown after each batch run changes after every batch run?
3. Is there are mechanism to override/increase the limit from 200 to more for test class run in each batch?

TIA
Hi All

I have a textarea field in the standard record detail page in lightning experience. While entering text to this field if I click on enter key rather than moving to next line it shifts the focus from textarea field to save button.

Has anybody faced this kind of issue? Is there any setting where we can configure this?

TIA
I have a requirement in lightning components where I need to check whether a URL is working or not. I am using navigateToURL to navigate to that page but not able to handle the status in my lightning component.
Is there a way in lightning component by which I can check whether a URL is working or not? e.g www.google.com page is up and running or not.
Hi 

I want to implement authenticate mechanism just like one in workbench,salesforce for outlook or any other third party app. I want to implement like this:

1. A standalone application in java with a login screen.
2. When salesforce username and password are filled, it should display a page for allow/deny the access to salesforce.
3. User clicks on allow and then user is taken to my application's home page.

Basically I dont want to use anything other than salesforce username and password to login and make api calls to salesforce.

Please let me know how can I achieve the above mentioned as I am not able to figure out anything from numerous articles on net describing OAuth, SSO etc.

Regards
Sunny
How system handles intemediate calls to the record those are a part of @future method?

Like if I have a record id passed in the future method and that record is actually deleted from the system before it is processed by @future method.

TIA
Sunny
Hi

Apex has character limits in Salesforce. I have a constant which I want to use in my code in number of different places. So I stored this constant in a separate class and used wherever it is required in code.
For example if I take a constant value in a variable:
public static final String BLANKSPACE = 'hi!';
However harcoding occupies only 3 characters but assigning it to a variable and then using variable occupies a lot more characters. How apex code character limit is justified in the above case?

TIA

 
Hi

I am using a vf component to display OrderItems information. For this I am passing orderitems after fetching them as sub query:
 
select Id, (select Id from OrderItems) from Order
and passing it to the component:
<c:mycomponent orderItems="{!orderObj.OrderItems}"/>
and in component:
<apex:attribute name="orderItems" assignTo="{!orderItemsFrmCon}" type="Object"/>
But when I am trying to fetch these in component controller and cast into orderitems list like:
List<OrderItem> lstOIs = (List<OrderItem>)orderItemsFrmCon;
It is throwing error:
10:12:46:163 FATAL_ERROR System.TypeException: Invalid conversion from runtime type List<Order> to List<OrderItem>
And this is happning in one of the sandbox but in other it is working fine. 

Any suggestion will be of great help.

TIA
Sachin
Hi All

I have following query in my code:
[select abc__c,xyz__c from sobj where field1__c != null and field2__c IN :lstValues]

field1__c is a text field
field2__c is a formula field which is a combination of 3 custom fields separated by #

I am experiencing following error when the trigger executing the above mentioned query runs in production:
System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)

However this is working perfectly fine in full sandbox. My production environment has 146000 rows and my full sandbox has 200000 rows.
If this is working in full sandbox this should work in production as well as it is having low volume of data.

Please help!

Regards
Sachin
Hi

I have overridden the delete button of Event object to a visualforce page:
<apex:page standardController="Event" action="{!URLFOR($Action.Event.Delete,Event.Id,[retURL='/home/home.jsp'])}">
    <apex:outputText value="Record Deleted!"/>
</apex:page>
But when I click on the delete button on the Event popup on Homepage, I am getting this error:
The link you followed wasn’t valid for your session. Return to the previous page, refresh it, and try again.
Please let me know if anybody had experienced this error and how to resolve it!

TIA
Hi All

I am having problem restoring sidebar styles. I created a homepage component of type 'Visualforce' and two tabs 'Accounts' and 'Contacts' which redirect user to 'All List ' view for corresponding objects (As I do not want to see recent item page for accounts and contacts for some profiles). 

When I click on these visualforce tabs, my homepage component loses style. When I checked through developer tool a new css is getting applied i.e. ext-all-no-theme.css 

I have not mentioned style anywhere. Not sure why this is happening. Please let me know if anybody has experienced this problem before.

TIA
Hi

Is there any way that I can fetch competitor names configured in opportunity object through Apex code?

Regards
Sachin
Hi

I am working on a functionality where I need to copy my custom Meeting object's record to standard event object. In my custom Meeting object WhoId is a Contact lookup with a filter that only those records whcih belongs to WhatId (Account) should appear as choice. While saving custom object record I create an Event object record and assign values to standard Event object's record.

All values are getting copied but 'Type', 'WhatId' and 'WhoId'. I have tried putting hard coded values as well but of no use. It simply creates a standard Event object's record without these values.

I tried executing the same code as anonymous from force.com ide and it worked fine and populated all values correctly. I am not sure whats happening in there.

Please let me know if anybody has any solution to this.

Regards
Sachin
Hi All

I am having problem restoring sidebar styles. I created a homepage component of type 'Visualforce' and two tabs 'Accounts' and 'Contacts' which redirect user to 'All List ' view for corresponding objects (As I do not want to see recent item page for accounts and contacts for some profiles). 

When I click on these visualforce tabs, my homepage component loses style. When I checked through developer tool a new css is getting applied i.e. ext-all-no-theme.css 

I have not mentioned style anywhere. Not sure why this is happening. Please let me know if anybody has experienced this problem before.

TIA
I have installed salesforce cli but when I am trying to execute any sfdx command. it is giving me error:
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module '../dist/versions'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (C:\Users\SharmSc\AppData\Local\sfdx\client\bin\sfdx.js:15:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
i am not able to use sfdx/vscode because of this blocker. 

I tried reinstalling salesforce cli, updating nodejs, resintalling vscode. Nothing worked.

Please let me know if anybody has any solution to this.
I have custom object called 'Mall'. Once users have selected the Malls, there would be a button on the top right that says "Add to Account".
When the user clicks the button, it will ask them to select an account (they will be able to search accounts). Once they select an Account, there will be a button that says 'Add'. 
When they click add, the Malls that they selected on the list view would be added to the selected account they chose. 





How can I achieve this functionality in Lightening ?User-added image
I have a requirement in lightning components where I need to check whether a URL is working or not. I am using navigateToURL to navigate to that page but not able to handle the status in my lightning component.
Is there a way in lightning component by which I can check whether a URL is working or not? e.g www.google.com page is up and running or not.
I'm stumped as to why my emails aren't being delivered from my Sandbox when I use an Apex class.  Here is what I've checked:

(I have replaced the email from actual results with 'MY EMAIL 1' and 'MY EMAIL 2', so that's not bad email values in the code.)

1) Deliverability:  Set to All email

2) Bounce management:  Both checked and unchecked

3) Test Deliverability:  Recieved all 32 emails

4)  Single message:  I need to deliver a templated email with an attachment, but just to try and see if I can get anything to work, I've commented that out and just tried to send a single email.  I copy and pasted the code off the web in an effort to make sure I'm not overlooking anything.  Here it is, copy-and-pasted straight from my class (and then masked the email):

Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
    String[] sendingTo = new String[]{'MY EMAIL ADDRESS 1'};
    semail.setToAddresses(sendingTo);
    String[] sendingToBccAdd = new String[]{'MY EMAIL 2'};
    semail.setBccAddresses(sendingToBccAdd);
    String[] sendingTocAdd = new String[]{'MY EMAIL 1'};
    semail.setCcAddresses(sendingTocAdd);
    semail.setSubject('Single Email message Example');
    semail.setPlainTextBody('Hello!!!!!!!!!!This is a test email to test single email message program');
            
try {
    system.debug('Yapa - Sending a non-template email.');
    Messaging.sendEmail(new Messaging.SingleEmailMessage[] {semail});
    }
catch (exception e) {
        system.debug('Yapa - Tried to send a non-template email and got an error:  ' + e);
    }    

5)  Debug logs:  system.debug statements and try... catch

I've thrown in all sorts of debug entries.  You can see in the single message email I'm sending that I am logging both success and failure.  When I look at debug logs, the "try" statement succeeds and I can see the email in the logs.

6)  Email logs:  Nothing.  The Deliverability test shows up in the log, but none of the many, many email tests I've tried.

For testing, I've got a button on my Lead object that calls a class to send the email.  Like I said, I've got it debug logged the !*(& out of, and I've traced it working all the way to the email send in the 'try...catch', and it's working, with all the correct values, right up to the send which gives the appearance of having worked.  But the emails never show up.

Here's a sample from the log:

15:00:07.0 (68224890)|VARIABLE_SCOPE_BEGIN|[176]|semail|Messaging.SingleEmailMessage|true|false
15:00:07.0 (68286222)|VARIABLE_ASSIGNMENT|[176]|semail|"common.api.soap.wsdl.SingleEmailMessage@76bb46ad"|0xac78023
15:00:07.0 (68293666)|STATEMENT_EXECUTE|[177]
15:00:07.0 (68303142)|HEAP_ALLOCATE|[177]|Bytes:4
15:00:07.0 (68324170)|HEAP_ALLOCATE|[177]|Bytes:29
15:00:07.0 (68332788)|VARIABLE_SCOPE_BEGIN|[177]|sendingTo|List<String>|true|false
15:00:07.0 (68351056)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
15:00:07.0 (68360976)|VARIABLE_ASSIGNMENT|[177]|sendingTo|["MY EMAIL 1"]|0x344d1916
15:00:07.0 (68366779)|STATEMENT_EXECUTE|[178]
15:00:07.0 (68380256)|STATEMENT_EXECUTE|[179]
15:00:07.0 (68386333)|HEAP_ALLOCATE|[179]|Bytes:4
15:00:07.0 (68401241)|HEAP_ALLOCATE|[179]|Bytes:25
15:00:07.0 (68407362)|VARIABLE_SCOPE_BEGIN|[179]|sendingToBccAdd|List<String>|true|false
15:00:07.0 (68421543)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
15:00:07.0 (68429426)|VARIABLE_ASSIGNMENT|[179]|sendingToBccAdd|["MY EMAIL 1"]|0x2e1ff2aa
15:00:07.0 (68435010)|STATEMENT_EXECUTE|[180]
15:00:07.0 (68446165)|STATEMENT_EXECUTE|[181]
15:00:07.0 (68451784)|HEAP_ALLOCATE|[181]|Bytes:4
15:00:07.0 (68467537)|VARIABLE_SCOPE_BEGIN|[181]|sendingTocAdd|List<String>|true|false
15:00:07.0 (68480803)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
15:00:07.0 (68488466)|VARIABLE_ASSIGNMENT|[181]|sendingTocAdd|["MY EMAIL 1"]|0x5624acf0
15:00:07.0 (68493667)|STATEMENT_EXECUTE|[182]
15:00:07.0 (68511652)|STATEMENT_EXECUTE|[183]
15:00:07.0 (68515434)|HEAP_ALLOCATE|[183]|Bytes:28
15:00:07.0 (68534615)|STATEMENT_EXECUTE|[184]
15:00:07.0 (68537295)|HEAP_ALLOCATE|[184]|Bytes:72
15:00:07.0 (68549852)|STATEMENT_EXECUTE|[186]
15:00:07.0 (68551392)|STATEMENT_EXECUTE|[186]
15:00:07.0 (68552661)|STATEMENT_EXECUTE|[187]
15:00:07.0 (68554725)|HEAP_ALLOCATE|[187]|Bytes:36
15:00:07.0 (68571269)|USER_DEBUG|[187]|DEBUG|Yapa - Sending a non-template email.
15:00:07.0 (68578657)|STATEMENT_EXECUTE|[188]
15:00:07.0 (68599370)|HEAP_ALLOCATE|[188]|Bytes:4
15:00:07.0 (68652773)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
15:00:07.0 (68674221)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
15:00:07.0 (111182217)|EMAIL_QUEUE|[188]|subject: Single Email message Example, bccSender: false, saveAsActivity: true, useSignature: true, toAddresses: [MY EMAIL 1], ccAddresses: [MY EMAIL 1], bccAddresses: [MY EMAIL 2], plainTextBody: Hello!!!!!!!!!!This is a test email to test single email message program, 
15:00:07.0 (111271089)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
15:00:07.0 (111306604)|METHOD_EXIT|[63]|01p0U00000058Uf|sendEmailWithAttachment.sendEmailWithPDFAttachment(Id, String)
15:00:07.0 (111320211)|STATEMENT_EXECUTE|[65]
15:00:07.0 (111326767)|HEAP_ALLOCATE|[65]|Bytes:1
15:00:07.0 (111398051)|HEAP_ALLOCATE|[65]|Bytes:18
15:00:07.0 (111413617)|HEAP_ALLOCATE|[65]|Bytes:19


7)  I don't see any of them in my Junk email box for either email address.

8)  If I send an email directly from the UI for a Lead (i.e. not via code), it successfully reaches the email address.

Any ideas what's going wrong?
I have a public list where in I want to check if the record owner is the same as a related object, but I keep getting an error. Anybody know if this is possible?
 
public List< Custom__c > getBalance2(){
        return [SELECT id, name, State__c, OwnerId, Related__r.OwnerId

                    FROM Custom__c 
                    WHERE State__c = 'Active'
                    AND Related__r.OwnerId =  :Balance2.OwnerId ];
}

 

Hi,

I'm trying to build a simple validation rule so that an opportunity can't move forward unless X condition has been met. The condition works, always.
How do I make sure it only triggers when stagename = Integrating or Live?

 

AND (
OR (
ISPICKVAL(StageName, 'Integrating'), 
ISPICKVAL(StageName, 'Live')
),
ISPICKVAL(Account.Integration_Type__c, "")
)

 

AND( 
ISPICKVAL(Account.Integration_Type__c, ""),
OR( 
ISPICKVAL(StageName, 'Won'), 
ISPICKVAL(StageName, 'Integrating'), 
ISPICKVAL(StageName, 'Live') 

)



const filter1= { $schema: "http:/000000",
target: {
table: "VW_SF_VIS_ORG", column: "RETAILER_CD" },
operator: "In",
values: ["88888"]
}
I am very new to SalesForce and I need help about the following situation: 
I have a form with some input fields about a custom object called Student, like name, Surname etc. On the same page below I have another form with a table and I want this table to save every single input record from the form above. What I managed to do is when I hit the button Save every current record is being saved in the table and not all records. 

I do not know how to proceed. Any help would be greatly appreciated!

VisualForce code: 

<apex:page controller="StudentController1">
 <apex:form id="form1">
 
  <apex:pageBlock title="Nov Student">
  
    <apex:pageBlockSection columns="1">
      <apex:inputField value="{!Student.Name}"/>
      <apex:inputField value="{!Student.Priimek__c}"/>
      <apex:inputField value="{!Student.Letnik__c}"/>
      <apex:inputField value="{!Student.Naslov__c}"/>
      <apex:inputField value="{!Student.Datum_rojstva__c}"/>
      <apex:inputField value="{!Student.Naziv_fakultete__c}"/>
      <apex:inputField value="{!Student.Studijski_program__c}"/>
      <apex:inputField value="{!Student.Tip_studija__c}"/>
<apex:selectcheckboxes layout="pagedirection">
      <apex:selectOption id="Placnik" itemValue="Samoplacnik" itemLabel="Samoplacnik" />
</apex:selectcheckboxes>

     <apex:pageBlock title="Vsi studenti">
      <apex:pageBlockTable value="{!Student}" var="wrapper" id="wtable" rows="9">
            <apex:column value="{!wrapper.Name}"/>      
            <apex:column value="{!wrapper.Priimek__c}"/>
            <apex:column value="{!wrapper.Naslov__c}"/>
            <apex:column value="{!wrapper.Datum_rojstva__c}"/>      
            <apex:column value="{!wrapper.Naziv_fakultete__c}"/>
            <apex:column value="{!wrapper.Studijski_program__c}"/>
            <apex:column value="{!wrapper.Letnik__c}"/>
            <apex:column value="{!wrapper.Tip_studija__c}"/>
      </apex:pageBlockTable>
     </apex:pageBlock>
 <apex:commandButton action="{!dodajStudent}" value="Save" id="theButton" reRender="wtable"/>
    </apex:pageBlockSection>
  </apex:pageBlock>
 </apex:form>
</apex:page>



APEX code:

public class StudentController1 {

  public boolean showValue {get;set;}
  public string studentName {get;set;}
  public Student__c student {get;set;}
  public StudentController1(){
        student = new Student__c();
    } 
  public pageReference Save(){
        insert student; 
        return null;
   }     
  public void dodajStudent(){
        upsert student;
  }
  
  public void updateFieldVisibility() {
        showValue = true;
    }
}
  • September 15, 2017
  • Like
  • 0
Hello,
We currenly use Conga to merge information into templates, then save and email these document to attorney's. We want to find a way to do this without Conga or a 3rd party plug in. So from Apex itself.  Has anyone done this? Is this possible? 
I am new to Salesforce and Apex ect.. I have only written a few triggers, but I am a Sr. Veteran with .NET C#.

Any advice or help would be great.
Thanks,
Keith.
Hi Team,

Is is possible to write Asynchronous Trigger?

Regards
Lakshmi
Hi friends,
I'm unable to execute my method because unable to pass correct format for datetime datatype. Can any one please let me know the format for execution. In my execute window I have to pass 2 values. One in integer and another is datetime.My code is as below
**********************
@RemoteAction
    global static string SetReminder(Integer dataId, datetime Date_time){
         Recommendation__c recom = [Select id, name, Account__r.Id, Account__r.Name, Recommendation_Contact__r.Name,Recommendation_Contact__r.Contact_YTD_Sales__c, Feedback__c, Account__r.AccountNumber,
                                                 Recommendation_Contact__r.Title, Product_Service__c, Type__c, Opportunity_Score__c, Next_Best_Action__c, Product_Recommendation__c, Primary_SKU__c,  
                                                 Status__c, Recom_External_Id__c from Recommendation__c where Recom_External_Id__c =:dataId];
                system.debug('Recommendation:' +recom);
          if(recom != null){  
              SetReminder__c rem = new SetReminder__c();
              rem.Name = recom.name;
              rem.Recommendation__c = recom.name;
              rem.Recom_External_Id__c = recom.Recom_External_Id__c;
              rem.Date_and_Time__c = Date_time;
              insert rem;
        }
        
         return null;
    }
  • September 15, 2017
  • Like
  • 0
Hello, 

I'm a beginner to apex, I want to create a web service to attach and parse an xml file. My file is hosted in an FTP server. The goal is to retrieve the XML file to insert the data into a salesforce object.
I try with the code below: 

webservice static String parse(String url) {
    
    DOM.Document doc = new DOM.Document();     
      try {    
        doc.load(url);       
        DOM.XMLNode root = doc.getRootElement();
        String message = 'File find';        
        return message;    
      } 
      // catch error
      catch (System.XMLException e) {      
        return e.getMessage();    
      }    
    } 

But it doesn't work with the url (C:\files\file.xml)

Can you help me please ?
Thank's in advance
Hi 

I want to implement authenticate mechanism just like one in workbench,salesforce for outlook or any other third party app. I want to implement like this:

1. A standalone application in java with a login screen.
2. When salesforce username and password are filled, it should display a page for allow/deny the access to salesforce.
3. User clicks on allow and then user is taken to my application's home page.

Basically I dont want to use anything other than salesforce username and password to login and make api calls to salesforce.

Please let me know how can I achieve the above mentioned as I am not able to figure out anything from numerous articles on net describing OAuth, SSO etc.

Regards
Sunny
i have a <apex:iframe> which opens a visualforce page with hyperlinks. when i click on hyperlink the page has to open within iframe no matter the target for hyperlinks are differentUser-added image
Hi All

I am having problem restoring sidebar styles. I created a homepage component of type 'Visualforce' and two tabs 'Accounts' and 'Contacts' which redirect user to 'All List ' view for corresponding objects (As I do not want to see recent item page for accounts and contacts for some profiles). 

When I click on these visualforce tabs, my homepage component loses style. When I checked through developer tool a new css is getting applied i.e. ext-all-no-theme.css 

I have not mentioned style anywhere. Not sure why this is happening. Please let me know if anybody has experienced this problem before.

TIA

Hi I am getting the error: "There is already a Child Relationship named" for the following fields for ANT script migration.

 

Error: objects/Bid_Request__c.object(658,13):There is already a Child Relationship named RFPs on User.
Error: objects/Bid_Request__c.object(681,13):There is already a Child Relationship named Bid_Requests on Opportunity.
Error: objects/Bid_Request__c.object(713,13):There is already a Child Relationship named Bid_Requests1 on User.
Error: objects/Bid_Request__c.object(725,13):There is already a Child Relationship named Bid_Requests on Contact.
Error: objects/Bid_Request__c.object(748,13):There is already a Child Relationship named Bid_Requests on Account.
Error: objects/Bid_Request__c.object(952,13):There is already a Child Relationship named Bid_Requests on User.

 

This is basically parent child relationship between, standard objects (Opportunity,User,Contact,Account) and new custom object "BidRequest".


When i first deployed from dev to sandbox the deployment worket fine.Then i deleted all the deployed custom objects.
Later when i again did a new deployment it failed.


What is really strange is on the target environment(sandbox) no custom fields exists with the above mentioned "relationshipLabel" but still i keep getting the error.

My controller works correctly, but when I go to test it I get an error and I'm not sure how to fix it.  Can anybody help?

 

static testMethod void testInquiryToProject()
  {
      List<Case> inquiries = [SELECT ID FROM Case LIMIT 1];
    
    if (inquiries.size() > 0)
    {
        Case inquiry = inquiries[0];
      ApexPages.StandardController controller = new ApexPages.StandardController(inquiry);
      controller.reset();
      InquiryToProjectExtension ext = new InquiryToProjectExtension(controller);
    }else
      System.debug('No Cases available');
  }

 

////////////////////////////////////////////////////////////////////////////////////

 

ublic InquiryToProjectExtension(ApexPages.StandardController cont)
  {
    List<String> fields = new List<String>();
    fields.add('Account');
    fields.add('CaseNumber');
    fields.add('Neighborhood_Lookup__c');
    fields.add('Sector__c');
    fields.add('Owner');
    fields.add('In_a_Main_Street_District__c');
    fields.add('Main_Street_Districts__c');
    cont.addFields(fields);//I get my error here when my test method executes
    inquiry = (Case)cont.getRecord();
    project = new Project__c(RecordType = [select id, name from RecordType where Name =: 'Grant'], Project_Account__c = inquiry.accountID, Neighborhood_Lookup__c = inquiry.Neighborhood_Lookup__c, Sector__c = inquiry.Sector__c, Project_Manager__c = UserInfo.getUserId(), In_a_Main_Street_District__c = inquiry.In_a_Main_Street_District__c, Main_Street_District__c = inquiry.Main_Street_Districts__c);
    controller = new ApexPages.StandardController(project);
  }

Hi,

 

I have a visualforce email template which is related to a custom object. In the template I have the following line where Agenda_Objective__c is a long text area.

 

 

<apex:outputText value="{!relatedTo.Agenda_Objective__c}"/>

 

 If there are any line breaks in the field in the custom object, they do not come through in the email template.

E.G. if the field contains the text:

 

Test1

Test2

Test3

 

the mail will display

 

Test1 Test2 Test3

 

Is there any way of preserving the line breaks? I could use outputfield instead of outputtext but this puts extra javascript into the mail which causes an error in my email client.

 

  • December 14, 2009
  • Like
  • 0
Hello,

I have a visual force custom search developed, can I use it a home page component.

Here is the simple code for my Visual Force page and I want this to be a homepage component.

Code:
<apex:page showHeader="false" controller="quichSeachController">
<apex:form target="_top"> 
<apex:panelGrid columns="2" style="width:100%;height:100%;background:#e8e8e8"> 
<apex:outputLabel value="SSN" for="SSN"/> 
<input id="ssn" name="ssn" size="10" /> 
<apex:outputLabel value="DOB" for="DOB"/>
<input id="dob" name="dob" size="10" /> 
<apex:outputLabel value="TN" for="TN"/> 
<input id="tn" name="tn" size="10" /> 
<apex:commandButton action="{!go}"  value="Go!" styleClass="btn"/> 
</apex:panelGrid> 
</apex:form>
</apex:page>

I currently embed it using an iframe here is the code for that:
Code:
<P><IFRAME style="Z-INDEX: 220; WIDTH: 179px; 
POSITION: relative; HEIGHT: 100px" src="/apex/QuickSearch" 
frameBorder=0 scrolling=no target="_top">
</IFRAM><P></IFRAME></P>

 However I don't want to do that as it would make the page loading slower as this would load separately from the main page.

Any advice will be greatly appreciated.

Regards,
Girish Suravajhula.