• Avidev9
  • ALL STAR
  • 6011 Points
  • Member since 2013
  • Independent Consultant


  • Chatter
    Feed
  • 202
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1472
    Replies
Hello

I have a template with a table formatted as follows:
 
<STYLE type="text/css">
.wordwrap {
    word-wrap: break-word;
    display: inline-block;
}
TH {font-size: 14px; font-face: Ariel;background: #C6DBEF; border-width: 1;  width: 400px; text-align: left }
TD {font-size: 14px; font-face: Ariel; text-align: left; }
TABLE {border: solid #CCCCCC; border-width: 1}
TR {border: solid #000000; border-width: 1; vertical-align: top; text-align: left; width: 400px;}
</STYLE>
<font face="ariel" size="2">

<p></p>
<h2>Coral Retail Priority 1 Incident Update   </h2>

<p></p>


<table border="0" >


<tr >

<th>Incident Description</th><th>{!relatedTo.BMCServiceDesk__incidentDescription__c}</th>


</tr>

<tr >

<th>Impact Analysis</th><th>{!relatedTo.Impact_Analysis__c}</th>

</tr>

<tr >

<th>Business Incident Update Notifications</th><td><apex:outputField value="{!relatedTo.HTML_History_Notes__c }"></apex:outputField></td> 
 

</tr>



                 
  </table>

But now I have been asked to format this table so that the first coloumn is a different colour (BACKGROUND: #1669BC)

So currently the email template looks like 

User-added image
But the first column needs to be #1669BC

I am unsure how to do this as I am not familiar with HTML and someone else designed this email template, can anyone help?




Many thanks

Sonya 

 
Trying to write a trigger to copy a custom zip code field on the account page to a lookup of a custom object.  

the custom zip code feild is Equipment_Zip_Postal_Code__c

The lookup field also on the account page is TZ__c

The Custom Object API name is TZDatabase__c

with a field name of Name that need to be copied over

So far I'm getting a Invalid bind expression type of Schema.SObjectField for colimn of type String.

Any help would be GREAT


trigger TZ on Account (after update) {
    String AccountId;
    String TextFieldValue;
    for(Account acc : Trigger.New)
    {
        AccountId = acc.id;
        TextFieldValue = acc.Equipment_Zip_Postal_Code__c;
    }
    list<TZDatabase__c> TZDatabaseList = new list<TZDatabase__c>();
    TZDatabaseList = [SELECT id, Name FROM TZDatabase__c WHERE Name =: account.Equipment_Zip_Postal_Code__c ];
    if(TZDatabaseList.size() > 0)
    {
        for(TZDatabase__c acc : TZDatabaseList)
        {
            account.TZ__c = Account.Equipment_Zip_Postal_Code__c;
        }
        try{
               update TZDatabaseList;
        }
        catch(Exception ex)
        {
             //add error message
        }
    }
}
Hi folks,
 Can anyone tell me how to display list of all account_name in two column in VFP??

Thanks in advance
Karthick
Hi,

I'm making a web service call to the metadata API from an Apex controller, and I'm getting the following error:
Got an unexpected error in callout : null. Contact support with error ID: 1650857327-111252 (-1513776465)

Can someone please shed some light on the actual cause of the error?

Thanks.
Hi,
I need to display like below.
-------------------------------------
Account Name1
    Contact1
    Contact2
Account Name2
    Contact1
AccountName3
    Contact1
-------------------------- etc
Like this per each Account Name i need to display associated contacts below that account as shown above.
Please  send sample code to achieve this.
select id,name, (select id  from contact) from account where id =:accountid

i dont understand where i am going wrong can any one guide me
HI,
    

   I am trying to creating new record sorce is coming out of the BOX using rest what i am creating new record that record owner also come out ofthe box that is also salesforce org.
hear my problem is insert owner field in new record.
Here is the sample code from the getEnclosingPrimaryId function documentation:

<apex:page standardController="Case">
    <A HREF="#" onClick="testCloseTab();return false">
         Click here to close this primary tab</A>

    <apex:includeScript value="/support/console/20.0/integration.js"/>
    <script type="text/javascript">
        function testCloseTab() {
            //First find the ID of the current primary tab to close it
            sforce.console.getEnclosingPrimaryTabId(closeSubtab);
        }
       
        var closeSubtab = function closeSubtab(result) {
            //Now that we have the primary tab ID, we can close it
            var tabId = result.id;
            sforce.console.closeTab(tabId);
        };
    </script>
</apex:page>

Simple question: What does "return false" do ?

I've been working on an issue to open a subtab inside a primary tab by
clicking a apex commandButton. I have an onclick="openSubtabFunction()"  on
the button to trigger a function when clicked.

The issue was after the first click of the button, my subtab would not open.

Here is my action sequence:
- I click the commandbutton and the onclick function is triggered to open the subtab (tab opens fine)
- I close the subtab.
- I repeat step 1. Subtab doesn't open

All I did to fix the issue was change my onclick code to:

onclick="openSubtabFunction();return false"

And then, I can open the subtab repeatedly.

But, I just want to know what kind of difference "return false"
makes.

If anyone can explain, it would be appreciated very much.

Thanks, Chris

Below is my page code,

<apex:page controller="SampleLocation">

<head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map-canvas { height: 100% }
    </style>
    <script type="text/javascript"
      src="https://maps.googleapis.com/maps/api/js?key=MY_API_KEY">
    </script>
    <script type="text/javascript">
      function initialize() {
        var mapOptions = {
          center: new google.maps.LatLng(-34.397, 150.644),
          zoom: 8
        };
        var map = new google.maps.Map(document.getElementById("map-canvas"),
            mapOptions);
      }
      google.maps.event.addDomListener(window, 'load', initialize);
    </script>
  </head>
  <body>
    <div id="map-canvas"/>
  </body>



</apex:page>

when I preview the page, nothing is shown.

when I save the exact same code in separate html file ( after removing apex:page tag) the code works just fine. I am sure that there is no issue with the API key.

any idea what is going wrong here ?
Hi, we have a custom object, we use workflow rule to set Name field to be the first name +' ' + last name. So I don't want to display this field in the page layout. But it appears name field is standard field and required. so has to be in the layout. Is there a way to avoid this?
Hi,

I ahve a requirement Bar code Genarator. Using with VF Page.please help me any one.

I'm trying to build an exploded record view for an app I'm developing.  The object records have some numerical fields, some boolean, but also a fair amount of large text boxes.  Having these all in a tabled view is suitable for some needs, but having them all in a large 'exploded' record view would also be nice.  Is there someway to have a summary view (multiple records) but also have each of those records fully enlarged to show the entirity of its contents?  Looking around, I have yet to find a way to do this.
I'm trying to create an SOQL Query for the controller of a custom VisualForce page. Is there any way to run a single SOQL query that can search fields in two different non-related objects? I'm aware that this can be done in SOSL, but there are specific reasons SOQL is required for this particular function (please no SOSL responses). 

Basically I'd like to combine the following (examples):

SELECT Name, Email, Phone FROM Contact WHERE Phone != null AND PhoneSearch1__c LIKE '%0149%' order by Name asc limit 75

SELECT Name, Email__c, Phone FROM Account WHERE Phone != null and PhoneSearch1__c LIKE '%0149%' order by Name asc limit 75

This might could be done by assigning the queries as variables? I'm not sure. Any help would be greatly appreciated! Thanks!
Here is a simplified version of my page:

<apex:page standardcontroller="Case" extensions="TestPassJSVariable">

    <script type="text/javascript">

        function createCase(cancel) {

            var supplier = document.getElementById('{!$Component.form.block.section1.supplierInput}').value;
            
            if(cancel == 1) {
            
                cancelFunction();
            }

            else {
            
               createFunction(supplier);
            }


    </script>
    <apex:form id="form">
    <apex:actionFunction name="createFunction" action="{!createCase}" rerender="view">    
        <apex:param id="supplier" assignTo="{!supplier}" name="supplier" value="" />  
    </apex:actionFunction>
    <apex:actionFunction name="cancelFunction" action="{!cancelCreate}"/>
    <apex:inputField id="supplierInput" value="{!Case.Supplier__c}" required="true"/>
        <apex:commandButton value="Create" onclick="createCase();" rerender="view"/><apex:commandButton value="Cancel" onclick="createCase(1);" immediate="true"/></center>
    </apex:form>
</apex:page>
I am trying to make the "supplierInput" field required, but also allow a cancel button on the page to go back to the previous URL without having to enter that information in.  I thought the immediate="true" attribute was supposed to allow this to happen, but it isn't working.

What am I missing here?

Hi All,

I currently implemented a code (which I copied somewhere) in my Production which copies the email body and insert it to Case Comment. However, I am getting multiple entries when I edit and Save the record. 

Ex. When the email comes in, it copy the email body and the code insert it to case comment. When I click the Edit button and Save WITHOUT changing any information, it creates a duplicate on the case comment. 

How can I correct this behavior that it should only create case comment when a new email is sent or received?

trigger commentMove on Case (after update) {
  Case myCase = trigger.new[0];
  if (myCase.New_Case_Comment__c!= null) {
    String caseId= myCase.ID;
    CaseComment cc = new CaseComment(CommentBody=myCase.New_Case_Comment__c,parentID=caseId);
    insert cc;
  }
}

Any assistance is greatly appreciated.
Our Org has a number of workflow generated tasks to help our users know what to do for an opportunity depending on which stage the opportunity is in. This is working well, but we are running into the issue of tasks coming due on weekends. I know this has been asked a number of times and I have done some digging and found an answer here (https://developer.salesforce.com/forums/ForumsMain?id=906F00000008uTgIAI) that worked quite well for a specific subject.

I am very new to Apex triggers and could use some help customizing the code to only work for opportunities of certain record types. Here is the code I am using:
trigger WeekendTasks on Task (after insert)
{ for (Task tas : Trigger.new)
  {  if (Opp.RecordType == 'RPA NTE-Perm' , 'RPA NTE(No Bid)' , 'RPA RFQ' , 'RPA Capital')
   {   Date origin = Date.newInstance(1900,1,6);
      Date due = tas.ActivityDate;
        Integer x = origin.daysBetween(due);
     Integer day = Math.mod(x,7);
     if (day < 2 )
     {    Task tt = new Task (
          Id = tas.Id,
           ActivityDate = (tas.ActivityDate + 2),
        Description = String.valueOf(day)    );
           update tt;
     } 
   }
  }
}
This trigger does not work as you probably already knew. If I replace the bold underlined line with:
if (tas.Subject == 'Change Stage - Awarded')
Everything works perfectly, but I do not want the trigger to fire off the Subject.  Could someone help me out with how to fire this trigger only for tasks associated with opportunity record types RPA RFQ, RPA NTE-Perm, RPA Capital and RPA NTE(No Bid)?

Thank you
I ran a batch job on our sandbox environment for 2.3M records. There were around 11K batches to process. The process got failed in between after processing half of the batches.

User-added image

There were 51 batch failures because of "First error: Ending position out of bounds: 5"." issue but the process stopped with status failed after processing 5K batches.

What could be the possible  reason behind this failure ? Any help would be greatly appreciated.

Thanks
Disable a button onClick that calls javascript function from where @RemoteAction method in apex Controller is invoked

I am trying to disable a button on meeting a condition. This <Button> helps me invoke a RemoteAction function in VF Controller. Need help in doing this. suggestion and solutions are appreciated.
Thanks

Note: This is not apex command button