• U Jay
  • NEWBIE
  • 145 Points
  • Member since 2013

  • Chatter
    Feed
  • 4
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 22
    Questions
  • 42
    Replies
Hi Expert. I have a code below. Can anyone help to fix to avoid SOQL exception :

List<RecordType> recordTypes = [SELECT Id, Name FROM RecordType Where Name='Non-Compliance' Limit 1];
        String recordTypeId=recordTypes[0].Id;
        
        for(Task item : taskUpsertList){
            List<Non_Compliance__c> newNonComplianceList = mapNonCompliance.get(item.Subject.substring(0,4));
            for(Non_Compliance__c nc : newNonComplianceList){
                item.Subject = nc.Name;
                item.Legislative_Reference__c = nc.Legislative_Reference__c;
                item.Compliance_Issue__c = nc.Compliance_Issue__c;
                item.Offence_Reference__c = nc.Offence_Reference__c;
                item.Offender__c = nc.Offender__c;
                item.Offence_Penalty__c = nc.Offence_Penalty__c;
                item.Penalty_Notice_Penalty__c = nc.Penalty_Notice_Penalty__c;
                item.Outcome__c = nc.Outcome__c;
                item.Type = nc.RecordType.Name;
                item.Description = nc.Comments__c;
                item.Priority = nc.Priority__c;
                if(nc.RecordType.Name == 'Line Item Non-Compliance'){
                    item.Line_Item_Category_Id__c  = nc.Line_Item_Category__r.Id;
                }
                item.Non_Compliance_Id__c = nc.Id;
                item.Non_Compliance_Number__c = nc.Non_Compliance_Number__c;
                item.RecordTypeId = recordTypeId;
            }
        }
Can i convert a number / currency to TEXT without lose trailing zeroes.

<apex:outputText value="{!SUBSTITUTE(TEXT(additionalCost.List_Price__c),'.',',')}" />
Hi, 

We have created VF page to show google maps on for different routes. It is working fine yesterday but now we are facing "Over query limit" and "Zero_results". 

please help me

Thanks Advance.
 
hello all,

i am working on a visualforce page and i want to replace the dot in decimal with comma can and one help me please .

<apex:column headerValue="Preço de lista">
<apex:outputText value="{!oliWrapper.price}" id="unitPrice"/>
</apex:column>

Thanks in Advance

 
Hi, This following code is in my apex class.
In my test clas i can cover up List and followed by if condition, the bold part is not covering up. Please share me if any one have idea.

List < Forecast_Revenue_Report__c > getFlagVal = [SELECT Flag__c FROM Forecast_Revenue_Report__c WHERE Forecast_Month__c = : this.month1];
if(!getFlagVal.isEmpty()){

     this.flag = getFlagVal[0].Flag__c;

Thanks.
Hi 
I am creating a visual force page and I have to add a funnel chart in the visual force page similar to dashboard funnel component.
 
Hey guys,
I am trying to create visualforce pages from existing HTML code I have. Here is my apex so far:

<apex:page showHeader="false" standardStylesheets="false" sidebar="false">
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="../../assets/ico/favicon.ico">

    <title>Login into the blah blah</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/overrides.css" rel="stylesheet">
    <link href="css/login.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>
    <div id="perc-container">
    <div id="header">
      <div class="secondary-nav" style="background-color: #fff;"> 
        <div class="container">
          <div class="row">
            <div class="col-lg-12" style="background-color: white;"> 
                <button class="show-search">Search</button>
                <div class="global-search">
                    <form class="global-search-inner">
                    <input type="text" class="search-main"> 
                    <input type="submit" class="search-main-submit" value="" >
                    <span class="search-icon"></span> 
                    </form>
                                  
                </div>
                <ul class="nav navbar-nav">
                    <li><a href="#">About Us</a></li>
                    <li><a href="#">Contact Us</a></li>
                     <li><a href="#">Visit Us</a></li>
                </ul>
            </div>               
          </div>
        </div>
      </div>
      <div class="primary-nav">
        <div class="container">
          <div class="row">
            <div class="col-lg-12">
                <div class="navbar-header">
                  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                  </button>
                  <a href="#" class="mobile-search-btn hidden-lg"></a>
                  <a class="navbar-brand logo" href="#"></a>
                  <a href="" class="mobile-login hidden-lg">Login</a>
                </div>
                <div class="mobile-search hidden-lg clearfix">
                    <div class="global-search">
                        <form class="global-search-inner">
                        <input type="text" class="search-main"> 
                        <input type="submit" class="search-main-submit" value="" >
                        </form>                                  
                    </div>
                </div>
                <div class="collapse navbar-collapse">
                  <ul class="nav navbar-nav">
                    <li class="active"><a href="#">Home</a></li>
                    <li><a href="#about">Stuff</a></li>
                    <li><a href="#contact">Stuff</a></li>
                    <li><a href="#about">Submit Your Stuff</a></li>
                    <li><a href="#contact">Make an Appointment</a></li>
                   
                  </ul>
                </div><!--/.nav-collapse -->
              </div>
            </div>
          </div>
        </div>
    </div><!-- /#header -->

    <div id="main" class="landing">      
      
      <div class="section welcome-ctr">
        <div class="container">
            <div class="row">                 
                <div class="col-lg-12">
     <div class="backg-art">
    <img src="images/StuffLogo.png" alt="Stuff">
  
      <div class="form-contain">
        <form class="form-login" role="form">
          <input type="username" class="form-control" placeholder="username" required autofocus>
          <input type="password" class="form-control" placeholder="password" required>
          <button class="btn btn-sm btn-primary btn-block forgot-password btn-width btn-shade" type="submit">Login</button>
          <label class="forgot-password"><a href="#">Forgot Password</a></label>
          <label class="checkbox">
            <input type="checkbox" value="remember-me">
            Remember me</label>
        </form>
      </div>
    </div>
                   <!-- /.row --> 
                                    
                </div>
                                
            </div>                       
        </div>
      </div><!-- /.section -->  

    </div><!-- /#main -->
    <div id="footer" class="section">
        <div class="container hidden-xs">
            <div class="row"> 
                <div class="special-col">
                    <h2>Quick Links</h2>
                    <li><a href="#">Home</a></li>
                    <li><a href="#">Stuff</a></li>
                    <li><a href="#">Discussion</a></li>
                    <li><a href="#">Submit Your Stuff</a></li>
                    <li><a href="#">Our Process</a></li>
                    <li><a href="#">About Us</a></li>
                    <li><a href="#">Site Map</a></li>
                </div>
                <div class="special-col">
                    <h2>Stufforate</h2>
                    <li><a href="#">About Us</a></li>
                    <li><a href="#">Site Map</a></li>
                    <li><a href="#">Stuffs</a></li>
                    <li><a href="#">Legal</a></li>
                    <li><a href="#">Contact Us</a></li>
                    <li><a href="#">Privacy Policy</a></li>
                    <li><a href="#">Stuff Store</a></li>
                </div> 
               
               
            </div>                       
        </div>
        <div class="container visible-xs">
                <div class="row">
                    <div class="panel-group" id="accordion">
                              <div class="panel panel-default">
                                <div class="panel-heading">
                                  <h2 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">Quick Links<span></span></a></h2>
                                </div>
                                <div id="collapseOne" class="panel-collapse collapse">
                                  <div class="panel-body">
                                  <li><a href="#">Home</a></li>
                    <li><a href="#">Stuff</a></li>
                    <li><a href="#">Discussion</a></li>
                    <li><a href="#">Submit Your Stuff</a></li>
                    <li><a href="#">Our Process</a></li>
                    <li><a href="#">About Us</a></li>
                    <li><a href="#">Site Map</a></li>
                                  </div>
                                </div>
                              </div>
                              <div class="panel panel-default">
                                <div class="panel-heading">
                                  <h2 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">Stuff Solutions<span></span></a></h2>
                                </div>
                                <div id="collapseTwo" class="panel-collapse collapse">
                                  <div class="panel-body">
                                      <li><a href="#">About Us</a></li>
                    <li><a href="#">Site Map</a></li>
                    <li><a href="#">Stuff</a></li>
                    <li><a href="#">Legal</a></li>
                    <li><a href="#">Contact Us</a></li>
                    <li><a href="#">Privacy Policy</a></li>
                    <li><a href="#">Stuff Store</a></li>
                                  </div>
                                </div>
                              </div>
                              
                            </div>
                </div>
            
        </div>
        <div class="container">
            <div class="row"> 
                <p class="copyright">©2014 Stuff Services, Inc.</p>
            </div>                       
        </div>
    </div><!-- /.footer -->
    <div id="video-modal" role="dialog" class="modal fade">     
            <div class="modal-content">
            <button type="button" class="close" data-dismiss="modal"><span>x</span></button>        
            <video autoplay src=""></video>
            </div> 
    </div>
    </div>
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/lib/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/settings.js"></script>
  </body>
</html>

</apex:page>

I get the following error:
Error: StuffCenterLogin line 24, column 4: The element type "link" must be terminated by the matching end-tag "</link>"
Error Error: The element type "link" must be terminated by the matching end-tag "</link>".

Any ideas?
I'm new to visualforce

Thanks!
hi all,

i need to create a custom button on event object on click of which an edit page of a custom object opens up and after the custom obj record is
saved,the event objects related to field is populated with the custom object record

How can i best achieve this?


Thanks

I wrote a code for the following output:

<apex:page standardController="Account" recordSetVar="RecordsSet">
<apex:form >
    <apex:pageBlock >
        <apex:pageblocksection >
            <apex:pageblockTable value="{!RecordsSet}" var="rec" id="TableOne">
                <apex:column ><apex:facet name="header"></apex:facet>
                    <apex:commandLink value="{!rec.name}"/>
                </apex:column>
            </apex:pageblockTable>
        </apex:pageblocksection>
    </apex:pageBlock>
</apex:form>
</apex:page>

User-added image


But, Here i need when i click on any of the records then i want to display related contacts for that account in the TableTwo in the same page using PageReference or any other methods.............

I Would appriciate any king of replay..................
Hi,

When I open a VF-page in Winter 15, it shows smaller than it is in Summer 14. Any idea anyone?
Regards Monique
Hi people,

I wanted some clarifications on the set of questions w.r.t Salesforce Dev 401 examination.

Following are the set of questions :


1. Dynamic Dashboards can have a Scheduled Refresh ?  
   A.   True
   B.   False

2. When you delete an analytic snapshot, the source report and target object are also deleted?  
   A.   True
   B.   False

3. How many external Id’s are allowed on an object ?  
    A.   1
    B.   7
    C.   3 
    D. 4
4. Default values can be set on the Dependent Picklist Fields ?  
    A.   True
    B.   False
5. Do the Access granted to reports by the Folders roll up via the role Hierarchy ?  
    A.   Yes 
    B.   No
6. Standard reports parameters (Available Fields, Criteria, time Frame) be changed and saved in the same Standard Report ?  
    A.   True  
    B.   False

7. Can we change URL of the context-specific Help links on any salesforce.com page (one for all)?  
    A.  True
    B.  False

8. Standard components on home page is not editable except  
    A.  Dashboard Snapshot
    B.  Items to Approve
    C.  Recent Items
    D.  Create New...
    E.  Calendar
    F.  Tasks
    G.  Customer Portal Welcome
    H.  Messages & Alerts()
    I.  Custom Links

9. 'Custom links' standard component contains up to how many bookmarks? 
   A.   5
   B.   10
   C.   20
   D.   15

10. Which kinds of custom component can be added to home page?  
   A.  Links
   B.  Image Area
   C.  Bookmarks
   D.  Script Area
   E.  Image/Logo()
   F.  HTML Area

Please do the needful.


Regards,
Vignesh Nayak S

I am trying to round the decimal places that are being displayed in an outputField to remove trailing zeros. The custom field that I am trying to display is set to be a number with 7 decimal places. There are cases though where not all 7 decimal places will be used, so I want to strip away trailing zeros.


Example: If I had 10.0001000 I want it to display as 10.0001 on my Visualforce page.

 

I tried doing something like this:

 

<apex:outputField value="{0}">
   <apex:param value="{!ROUND(customField__c, number)}" />
</apex:outputField>

 This returned an error value for <apex:outputField> is not a dynamic binding!

 

If I change it to an outputText it works, but I need this field to be based on user locale which is why I was using an outputField.

 

Thanks in advance!

Hi,

 

 am trying to send the mass email to contacts.I am getting the error as  below.Am doing this in a DE org.

 


System.EmailException: SendEmail failed. First exception on row 0; first error: NO_MASS_MAIL_PERMISSION, Single email is not enabled for your organization or profile. Single email must be enabled for you to use this feature.

 

 

My coding as  below

 

 private final List<Id> contactids;
  public List<Contact> con;
  public testemail(ApexPages.StandardController controller)
  {
     con = [select Id from Contact limit 5];    
     contactids=new  List<Id>();     
     for(Integer i=0;i<con.size();i++)
     {    
      contactids.add(con[i].Id);       
     } 
  }

  public void SendEmail()
  {
      Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
      mail.setTargetObjectIds(contactids);   
      mail.setTemplateId('00X90000000ZQgA');
      Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
  } 

 

 

  Can anybody tell me how to enable single email/mass email?

 

  Thanks  for any help

 

 

Hi there. I'm wondering if anybody in the past has merged 2 or more pdf files using the getContent()

method or something similar? Is this possible?

Thanks