• izay
  • NEWBIE
  • 469 Points
  • Member since 2012

  • Chatter
    Feed
  • 15
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 70
    Replies

Have a button that calls a VF page for a user to fill in 3 required fields then create a case.

The VF page is in a pop up window.

 

When the Case is created I want the parent window to redirect to the newly created Case.

 

button on Contact page passes accountid and contactid in URL

 

Field Set is used to populate the fields in the page.

 

Everything works except closing the pop-up and redirecting the parent window.

 

 

Apex Page:

<apex:page standardController="Case" extensions="CreateCaseController" showHeader="false"> 

    <apex:form >
        <apex:pageMessages />
        <apex:pageBlock title="New Case">
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!Save}"/>
                <input type="button" value="Cancel" class="btn" onclick="window.close();"/>
            </apex:pageBlockButtons>
            <apex:outputLabel value="Account:  " for="acc"/ >
            <apex:outputField id="acc" value="{!case.accountid}" /><br/>
            <apex:outputLabel value="Contact:  " for="con"/>
            <apex:outputField id="con" value="{!case.contactid}" />
        
            <apex:pageBlockTable value="{!$ObjectType.Case.FieldSets.CaseQuickCreate}" var="f">
                <apex:outputField value="{!case.contactid}"/>
                <apex:outputField value="{!case.accountid}"/> 
                <apex:column value="{!f.Label}">
                    <apex:facet name="header"></apex:facet>
                </apex:column>
                <apex:column >
                    <apex:inputField value="{!Case[f]}" required="{!f.Required}" />
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
        
        <script type="text/javascript">
            if ({!isSaveSuccess}) {
                var url = '/{!cs.id}';
                opener.location.href=url; 
                window.close();
            }
        </script>
    
    </apex:form>
</apex:page>

 

 

 

 Extension: 

/** Create Case controller used by support for Quick Case creation

TBouscal 2013-11-25
*/

public class CreateCaseController{

public Account account{get; set;} 
public Contact contact{get; set;}
public Case cs{get; set;}
public Boolean isSaveSuccess{get; set;}
Public string retURL{get; set;}

public CreateCaseController(ApexPages.StandardController controller){
    cs=((case) controller.getRecord());
    cs.contactid=ApexPages.currentPage().getParameters().get('cid');
    cs.accountid=ApexPages.currentPage().getParameters().get('aid'); 
    }
    
public void createCase(){
    cs.contactid=ApexPages.currentPage().getParameters().get('cid'); 
    cs.accountid=ApexPages.currentPage().getParameters().get('aid');
    
    insert cs;
    isSaveSuccess = true;
    retUrl=cs.id; 

    }

 

 

 

 

I am trying to capture an element from an external webpage and display it on a visualforce page whenever the text value in a field exists as a value for the external webpage. For example, if I type "GOOG" in the text field, then the page should render the current price for Google's stock.

 

Here are the details of the task:

1. Create a field to enter the ticker symbol of a stock.

2. Use the inputted ticker symbol to render a call to Google Finance or Yahoo! Finance.

3. Return the quoted price on the webpage to the visualforce page in a field.

4. The page should rerender the current price every 10 seconds.

 

I currently have the following object and fields:

Object: Stock_SC__c

 

Fields:

1. Ticker_Symbol_SC__c = text field to capture the desired ticker symbol.

2. Google_Finance_Link_SC__c = formula field that concatenates the base website URL (http://www.google.com/finance?q=) and Ticker_Symbol_SC__c text field.

3. Yahoo_Finance_Link_SC__c = formula field that concatenates the base website URL (http://finance.yahoo.com/q?s=) and Ticker_Symbol_SC__c text field.

 

The element of Google finance that stores the current price is "<span id="ref_694653_l">1,033.89</span>." For Yahoo! Finance, the element is "<span id="yfs_l84_z">73.06</span>."

 

Any help is appreciated!

  • November 25, 2013
  • Like
  • 0

Hello Helpers

 

I would like  to  display a popup  dialog  box  from inside the Visual force  page  After  the action  method  is finished at the controller side. the diualog  Box  should  display a simple message  something like  "operation succesfull"

 

 

 

<apex:commandButton  action="{!FunctionFromapexcontroller}"   "/>

 

I know  how  to  diplay  message boxes  using Javascipt  onclick()  evewnt handler but these messages fire before the 

action  method  starts

 

 

I need a message  after  the method  in controller finish

 

any suggestions are welcommed

 

Thanks in advancs

csaba

 

 

 

  • November 22, 2013
  • Like
  • 0

I am attempting to write test code for a deletion extension....The extension is for a delete button inside a pageblock table for an accounts tabbed VF page. I am sure that I have overcomplicated the test as I am trying to refer to everything. Please help, look at this mess of code:

 

@isTest
private class extAccountDel {

static testMethod void extAccountDel(){
        //Attempting to change an old test to suit my new extension

// create a test account that will be use to reference the Fact Finder Record

Account acc = new Account(Name = 'Test Account');
insert acc;

//Now lets create Fact Finder, Destiny Service, Destiny Product, transaction and compliance note record that will be reference for the Standard Account
        Fact_Finder__c facTest = new Fact_Finder__c(Account__c = acc.id);
         Service__c SerTest = new Service__c(Account__c = acc.id);
         Destiny_Products__c ProTest = new Destiny_Products__c(Account__c = acc.id);
         Transaction__c TraTest = new Transaction__c(Account__c = acc.id);
        Notes__c ComTest = new Notes__c(Account__c = acc.id);
        
        
        //call the apepages stad controller
        Apexpages.Standardcontroller stdFac = new Apexpages.Standardcontroller(facTest);
         Apexpages.Standardcontroller stdSer = new Apexpages.Standardcontroller(SerTest);
          Apexpages.Standardcontroller stdPro = new Apexpages.Standardcontroller(ProTest);
           Apexpages.Standardcontroller stdTra = new Apexpages.Standardcontroller(TraTest);
            Apexpages.Standardcontroller stdCom = new Apexpages.Standardcontroller(ComTest);

//now call the class and reference the standardcontroller in the class.
        extAccountDel extFac = new extAccountDel(stdFac);
        extFac.deleteFacRecord();
        
        
        extAccountDel extSer = new extAccountDel(stdSer);
         extSer.deleteSerRecord();
        
        extAccountDel extPro = new extAccountDel(stdPro);
        extPro.deleteProRecord();
        
        extAccountDel extTra = new extAccountDel(stdTra);
        extTra.deleteTraRecord();
        
        extAccountDel extCom = new extAccountDel(stdCom);
extCom.deleteComRecord();
//call the pageReference in the class.
        
       
        
        
        
    }

}

 This is the deletion extension:

 

public class extAccountDel {

    //string delId is used to set the parameter
    public string delId {get;set;}
    public Account acc {get;set;}

    public extAccountDel (ApexPages.StandardController controller) {
        this.acc = (Account)controller.getRecord();
    }
    
    //delete for Fact Finder record and then re-directs back to the VF page with the Fact Finder tab open
    public PageReference deleteFacRecord() {
    
        Fact_Finder__c Fac = [select id from Fact_Finder__c where id =: delId];
        delete Fac;
        
        
        
        PageReference pageRef= new PageReference('/apex/DestinyAccountTest?id='+acc.id+'&Sfdc.override=1');
         pageRef.getParameters().put('tab','FactFinder');
        pageRef.setredirect(true);

       
        return pageRef;
    }
    
    
 //delete for Destiny Products record and then re-directs back to the VF page with the Destiny Products tab open
    public PageReference deleteProRecord() {
    
        Destiny_Products__c Pro = [select id from Destiny_Products__c where id =: delId];
        delete Pro;
        
        
        
        PageReference pageRef= new PageReference('/apex/DestinyAccountTest?id='+acc.id+'&Sfdc.override=1');
         pageRef.getParameters().put('tab','Destiny Products');
        pageRef.setredirect(true);
        
         return pageRef;
}

 //delete for Destiny Services record and then re-directs back to the VF page with the Destiny Services tab open
    public PageReference deleteSerRecord() {
    
        Service__c Ser = [select id from Service__c where id =: delId];
        delete Ser;
        
        
        
        PageReference pageRef= new PageReference('/apex/DestinyAccountTest?id='+acc.id+'&Sfdc.override=1');
         pageRef.getParameters().put('tab','Destiny Services');
        pageRef.setredirect(true);
        
         return pageRef;
}

 //delete for Transactions record and then re-directs back to the VF page with the Transactions tab open
    public PageReference deleteTraRecord() {
    
        Transaction__c Tra = [select id from Transaction__c where id =: delId];
        delete Tra;
        
        
        
        PageReference pageRef= new PageReference('/apex/DestinyAccountTest?id='+acc.id+'&Sfdc.override=1');
         pageRef.getParameters().put('tab','Transactions');
        pageRef.setredirect(true);
        
         return pageRef;
}

 //delete for Compliance Notes record and then re-directs back to the VF page with the Compliance Notes tab open
    public PageReference deleteComRecord() {
    
        Notes__c Com = [select id from Notes__c where id =: delId];
        delete Com;
        
        
        
        PageReference pageRef= new PageReference('/apex/DestinyAccountTest?id='+acc.id+'&Sfdc.override=1');
         pageRef.getParameters().put('tab','Compliance Notes');
        pageRef.setredirect(true);
        
         return pageRef;
}

}

Hello,

 

I have the following VF Page code which allows a user to toggle between 3 different images (red, yellow, green).  The toggle works, but now I need to assign a value to a custom number variable based upon the image that the user toggles to.  Does anyone know how I can accomplish this or where I might find some code to do it?  Thanks,

 

<apex:page standardController="Account_Plan__c" tabStyle="Account" ShowHeader="TRUE">


<apex:outputPanel id="msgs">
<apex:pageMessages />
</apex:outputPanel>

 

<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" />
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js" />

 

<script type="text/javascript">


$(document).ready(function () {
$('.icon').click(function () {
$(this).hide();
var next = $(this).next();
console.log(next.length);
if (next.length == 0)
next = $(this).parent().find('.icon').first();

next.show();
});
});
</script>

 

<style type="text/css">
#StatusIcon
{
position: relative;
}

.icon
{
position: absolute;
left: 0px;
top: 0px;
display: none;
}

.icon.default
{
display: block;
}
</style>

 

<apex:form >


<div id="StatusIcon">
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP7" class="icon default" id="R"/>
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP8" class="icon" id="Y"/>
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP6" class="icon" id="G"/>
</div>

 

</apex:form>

</apex:page>

  • May 17, 2013
  • Like
  • 0

Hi I have a visual force page which has a table of records to be processed. Most everything works as expected except one minor issue.

 

I am trying to display an alert message via the jave script "Alert"  function below. The message displays as expected, but the variable for {!workOrderCount2Remove} does not change in the jave script "alert" function. However the variable changes as expected when I reference it directly in my output panel with the vf form. I am guessing because this is processed server side but the java script runs in the browser and the variable is not resetting for some reason. So how can I accomplisth this without a refresh? My rerendering works for the tables and panel, only the variable callerd in the java script is set on the initial page load and never again without a refresh. Hope this issue makes sense.

 

Thanks

 

 

<apex:page controller="ManifestMaintenanceController">
<script type="text/javascript">
    function checkAll(cb,cbid)
        {
            var inputElem = document.getElementsByTagName("input");                    
            for(var i=0; i<inputElem.length; i++)
            {            
                 if(inputElem[i].id.indexOf(cbid)!=-1){                                       
                    inputElem[i].checked = cb.checked;
                }
            }
        }
        </script>
        
 <script type="text/javascript">
    
    function alert() {

    var myVar = '{!workOrderCount2Remove}';
     
   if (  '{!workOrderCount2Remove}' == 0 ) {
        alert('There are no manifest lines available to remove. MyVar = ' + '{!workOrderCount2Remove}');
    }
    else {
        alert('MyVar Count is ' +  '{!workOrderCount2Remove}');
          myVar = 0;
    }
        }
      
     
</script>



      <apex:form >
    
          <apex:pageBlock >
              <apex:pageBlockButtons >
                  <apex:commandButton value="Remove from Manifest" action="{!processRemoveSelected}" rerender="table, panel"  onclick="alert();" />
                  <apex:commandButton value="Return to Manifest" action="{!pageCancel}"/>
              </apex:pageBlockButtons>
              
               <apex:outputPanel id="panel">
               <apex:outputText style="font-style:italic" value="Manifest lines available to remove: {0}">
                          <apex:param value="{!workOrderCount2Remove}"/>
                      </apex:outputText>
                </apex:outputPanel>
              
              <!-- In our table we are displaying the records -->
              <apex:pageBlockTable value="{!serviceOrderLines2Remove}" var="c" id="table">
                  <apex:column ><apex:facet name="header">
                      <!-- This is our selected Boolean property in our wrapper class -->
                      <apex:inputCheckbox value="{!c.selected}" onclick="checkAll(this,'checkedone')" />
                         </apex:facet>
                        <apex:inputCheckbox value="{!c.selected}" id="checkedone"/></apex:column>
                 
                 <apex:column headerValue="Work Order Line">
                      <apex:outputLink value="/{!c.con.id}">{!c.con.Name}</apex:outputLink>
                  </apex:column>
                  <apex:column headerValue="Activity Type" value="{!c.con.SVMXC__Activity_Type__c}" />
                  <apex:column headerValue="Line Type" value="{!c.con.SVMXC__Line_Type__c}" />
                  <apex:column headerValue="Line Status" value="{!c.con.SVMXC__Line_Status__c}" />
                  <apex:column headerValue="Received City" value="{!c.con.SVMXC__Received_City__c}" />
                  <apex:column headerValue="Quantity Shipped" value="{!c.con.SVMXC__Quantity_Shipped2__c}" />
                  <apex:column headerValue="Work Order" value="{!c.con.SVMXC__Service_Order__c}" />
                  <apex:column headerValue="Work Description" value="{!c.con.SVMXC__Work_Description__c}" />
              </apex:pageBlockTable>
          </apex:pageBlock>
     </apex:form>
</apex:page>

 

 

 

 

  • April 12, 2013
  • Like
  • 0

i have a button that calls apex to create a change record from a case.  See code snippit below.  I only get this error when AccountId and Dealer__c have the same value, but it is possible that these 2 can be the same.  I need it to not worry about that part.  How do I get around that?

public class SampleCaseButtonController {    Case currCase;    public SampleCaseButtonController(ApexPages.StandardController controller) {        currCase = [Select AccountId, ContactId, Dealer__c, Product__c, Support_Advocate__c From Case Where Id = :controller.getId() LIMIT 1];    }        public PageReference changeCase(){            // Create a new Change Record        Change__c newChange = new Change__c();

 

  • April 09, 2013
  • Like
  • 0

Hi All , 

 

This is the second time , I am posting this issue . But No one has been able to provide any concrete solution. Please help,

 

I have created a custom with javascript functionality and its working fine . I want when the same button is pressed twice or thrice  it should give alert message " Invalid action". I tried  using lot of things but its not working. I know it looks very easy but pls help me out in this issue. TBelow is the script:-

 

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}

 

var leadstatus = '{!Lead.Status}';
if (leadstatus != "Z-Program Approved")
{
alert('An Elite name cannot be assigned unless the Lead Status is equal Z-Program Approved');
}

else{

// Now calling the webservice to create a new Id 
var callback = "" + sforce.apex.execute("CreateliteId","createlite", {LeadId:"{!Lead.Id}"});

// If create and update was ok - just reload Lead page to see the id of the elite partner
if(callback == 'OK' ){

alert('The Elite Id has been assigned');
window.location.reload();
}

 

else{
alert('Error: ' + callback);
}}

Hi All,
I have a custom VF page which performs the normal search functionality on Account and based on the selected account value wants to proceed further.
Problem:
I am not able to pass the selected account's id as action function is not working in the following code:

<apex:page controller="accountSearch">
<apex:form >
<script>
function toGetAccountId(id)
{
alert('test1');
variable1=document.getElementById(id).value;
xyz(variable1);
alert('test2');
}
</script>
<apex:pageBlock >

<apex:actionFunction name="xyz" action="{!samepage}">
<apex:param value="" assignTo="{!var1}"/>
</apex:actionFunction>


<apex:outputLabel value="Enter your search text:" >
<apex:inputText value="{!searchVar}">
</apex:inputText>
</apex:outputLabel>

<apex:commandLink value="Search" action="{!getAccounts}" />

<apex:pageBlockTable value="{!accList}" var="acc">
<apex:column headerValue="Account Name" > <apex:outputLink id="olId" onclick="toGetAccountId('{!$Component.olId}')">{!acc.name}
</apex:outputLink></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
-----------------------------------------------------
controller:
public with sharing class accountSearch {
public String olId { get; set; }
public String searchVar { get; set; }
public String var;
public String var1{get;set;}
public String var2;
public list<Account> accList = new list<Account>();

public PageReference getAccounts() {
var='%'+searchVar+'%';
system.debug('aaaaaaaaaaaa'+var);
accList = [Select name,NumberOfEmployees from account where name LIKE:var ];
system.debug('vvvvv'+accList);
return null;
}

public list<Account> getAccList(){
return accList;
}
public pagereference samepage()
{
//PageReference curPage = ApexPages.currentPage();
system.debug('lllllllllll');
var2=var1;
system.debug('dddddddddddddd'+var2);
PageReference curPage = new Pagereference('/apex/testpage2');
curPage.setRedirect(true);
return curPage ;
}
}

After the list of accounts returned, if I select a particular account (onclick of a output link),the javascript is getting invoked and I am getting the alerts. But the action method (samepage()) is not invoked. (for testing purpose, I am just redirecting a test page on the action method and its not working)
Also, if I try saving <apex:actionFunction name="xyz" action="{samepage}"> instead of <apex:actionFunction name="xyz" action="{!samepage}"> , its getting saved which is wrong.

I am at lost. Please help..

Thanks.

  • April 08, 2013
  • Like
  • 0

 

This is the basic page I''m testing with.  Below is the VF page code.  How do I change the order of all of the related list that appear under the detail section of the on the object?

 

Thank you, Steve ps I will give Kudos for you if you solve my question

<apex:page standardController="Contact" 
extensions="sampleDetailPageCon">
//<style>
//.fewerMore { display: none;}
//</style>
<apex:form > 
    <apex:pageMessages /> 
    <apex:detail relatedList="true"></apex:detail>
<apex:pageblock id="CustomList" title="Related Opportunities"  >
    <apex:pageBlockTable value="{!oppz}" var="o" rendered="{!NOT(ISNULL(oppz))}">
     
      
       <apex:column>
             <apex:commandLink action="/{!o.id}" value="{!o.Name}" />
       </apex:column>
        
        <apex:column value="{!o.Name}"/>        
        <apex:column value="{!o.Account.Name}"/>        
        <apex:column value="{!o.Type}"/>
        <apex:column value="{!o.Amount}"></apex:column>       
        <apex:column value="{!o.CloseDate}"/>
     </apex:pageBlockTable>
     <apex:outputLabel value="No records to display" rendered="{!(ISNULL(oppz))}" styleClass="noRowsHeader"></apex:outputLabel>
    </apex:pageblock>
</apex:form>
</apex:page>

Here is the apex to go wit

public class sampleDetailPageCon {    
    private List<Opportunity> oppz;    
    private Contact cntact;     
    public sampleDetailPageCon(ApexPages.StandardController controller) {        
        this.cntact= (Contact)controller.getRecord();    
        }    
        public List<Opportunity> getOppz()    
        {        
            Contact con = [Select id, Account.id FROM Contact where id = :cntact.id];        
            if (con.Account == null)         
                return null;        
                oppz = [Select id, Name, Account.Name, CloseDate, Amount, Type from Opportunity where Account.id = :con.Account.id];        
                return oppz;    
        }
}




Hi,

I am trying to write a chatter trigger to repost to an account if it meets a certain criteria ?  

 

For example: if i post something aboutn # canada in my personal feed or in a group feed, it should automatically reposted to the account feed which is having account name as canada.

 

I have trigger a trigger on this.

 

trigger chatterfeed on FeedItem (after insert)
{

set<string> fbody= new set<string>();
for(feedItem f:trigger.new)
{
fbody.add(f.body);
}
List<FeedItem> feedItems = new List<FeedItem>();
list<account> a=[select id,name,ownerId from account ];

for(FeedItem f:trigger.new)
{

for(account ac:a){
if(f.body.contains(ac.name))
{
string s= f.body;
FeedItem fitem = new FeedItem();
fitem.type = 'LinkPost';
fitem.ParentId = ac.id;
system.debug(fitem.parentId+'IIIIIIIIII');
fitem.linkurl='https://ap1.salesforce.com/_ui/core/userprofile/UserProfilePage?u=00590000000NI6s&fId='+f.id;
fitem.Title = 'view';
fitem.Body=s;
system.debug(fitem.body+'BBBBBBBBB');
feedItems.add(fitem);
system.debug(feedItems+'FFFFFFFFf');
}
}
}

if(feedItems.size() > 0) {
try{
Database.insert(feedItems,false);
system.debug(feedItems+'OOOO');}
catch(exception e){}
}
}

 

I am getting internal salesforce error when I am fetching feetitem body. If I fetch feed Item id it is working fine.

 

Can anyone pls help me out its very urgent.

 

Thanks in advance.

 

 

 

  • April 08, 2013
  • Like
  • 0

First i create a button in campaign and if click this button. campaign members contact and lead ownership to be changed as    campaign owner name....

 

Thi is my code can any one tell me where did i make a mistake..

 

{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")}

var url = parent.location.href;

var AccId = "{!Account.Id}";
var CampId ="{!Campaign.Id}";
var CampOwnerId= "{!Campaign.OwnerId}";

var updateRecords = [];
var update_Cons = new sforce.SObject("Contact");

var result = sforce.connection.query("SELECT Id, Contact.OwnerId, Lead.OwnerId, campaignid FROM CampaignMember WHERE campaignid = '"+CampId +"'"); 
var recs = result.getArray("records");

if(confirm("Are you sure you want to update the name on related contacts and leads?") )
{
for(var i = 0; i < recs.length; i++)
{
recs[i].Contact.OwnerId= CampOwnerId;
recs[i].Lead.OwnerId= CampOwnerId;

updateRecords.push(recs[i]);
}

var result = sforce.connection.update(updateRecords);

parent.location.href = url;

if(result[0].success == 'true')
{
alert("Related contacts and leads updated successfully");
}
else
{
alert("Failed to update the related contacts and leads");
}
}

  • April 08, 2013
  • Like
  • 0

Hello Helper

 

I want to force a logged user to do something  before start working .  for this I see 2 options:  

 

A. automatically redirect the user to a visual force page right after login

 

Or 

 

B. display a modal dialog box  on the home tab  like the salesforce "Getting started with Chatter"

 

It would be possible?

any other options/suggestion are welcomed

 

 

Thanks in advance

csbaa

  • April 06, 2013
  • Like
  • 0

I have a input feild in visualforce page which is a picklist and I want to rerender certain part of the page after changes happens on that input feild
Here is the code

<apex:inputField value="{!a__c.c__c}" >
                <apex:actionSupport event="onchange" action="{!changeHappenedOnC}" rerender="aSection" />
 </apex:inputField>

Before rerendering "aSection", Function "changeHappenedOnC" inside of my controller should be executed.

Function "changeHappenedOnC" is executed almost everytimes except when one of the required field for "a__c" is empty.

Have anybody entered this kind of problem and resolved their issue??
Your help will be appreciated..
 
p.s. looking into the logs when the issue happens this are the lines I got:


20:20:18.118 (118316000)|VF_PAGE_MESSAGE|You must enter a value
20:20:18.120 (120297000)|VF_PAGE_MESSAGE|You must enter a value

 


cheers
JS

Hi,


I am looking for a little boost on an issue I am having.  I am calling the code snippet below from another class that is Batch Apex.  The results from the batch job do not show as failing nor does the log show that I have a failure.  However, when I intentionally make a field smaller than the data that I am inserting the INSERT fails.  I had to dig into several of the logs returned from the batch process to find that the insert InsertList line below is failing.  So my error handling is working to report the message in the log but if this was in production I would not have any clue that it failed.  In addition, I never received the automated email that SF usually sends me that Apex code failed (User setting is turned on).

 

Should I do my try catch block at the caller level that is inside the batch apex class?  Or is there something that I am doing wrong.  I thought if you catch an error and do nothing like the code below is doing that the reset of the code would stop.  At the end of the job no records where update or insert by any of my other code so I believe it all was rolled back.

 

 

 

    public static Integer InsertErrorRecycle(List<Enrollment_Recycle__c> InsertList) {
         try {
             insert InsertList;
             System.debug('Enrollment_QueryBase.InsertErrorRecycle insert count: ' + InsertList.size());
         } catch(System.DmlException e) {
            System.debug('DmlException in Enrollment_QueryBase.InsertErrorRecycle: Error at line ' + e.getLineNumber() + ' - ' + e.getMessage());
         } catch(System.Exception e) {
            System.debug('Exception in Enrollment_QueryBase.InsertErrorRecycle: Error at line ' + e.getLineNumber() + ' - ' + e.getMessage());
         }
         return InsertList.size();        
    }

 

Have a button that calls a VF page for a user to fill in 3 required fields then create a case.

The VF page is in a pop up window.

 

When the Case is created I want the parent window to redirect to the newly created Case.

 

button on Contact page passes accountid and contactid in URL

 

Field Set is used to populate the fields in the page.

 

Everything works except closing the pop-up and redirecting the parent window.

 

 

Apex Page:

<apex:page standardController="Case" extensions="CreateCaseController" showHeader="false"> 

    <apex:form >
        <apex:pageMessages />
        <apex:pageBlock title="New Case">
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!Save}"/>
                <input type="button" value="Cancel" class="btn" onclick="window.close();"/>
            </apex:pageBlockButtons>
            <apex:outputLabel value="Account:  " for="acc"/ >
            <apex:outputField id="acc" value="{!case.accountid}" /><br/>
            <apex:outputLabel value="Contact:  " for="con"/>
            <apex:outputField id="con" value="{!case.contactid}" />
        
            <apex:pageBlockTable value="{!$ObjectType.Case.FieldSets.CaseQuickCreate}" var="f">
                <apex:outputField value="{!case.contactid}"/>
                <apex:outputField value="{!case.accountid}"/> 
                <apex:column value="{!f.Label}">
                    <apex:facet name="header"></apex:facet>
                </apex:column>
                <apex:column >
                    <apex:inputField value="{!Case[f]}" required="{!f.Required}" />
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
        
        <script type="text/javascript">
            if ({!isSaveSuccess}) {
                var url = '/{!cs.id}';
                opener.location.href=url; 
                window.close();
            }
        </script>
    
    </apex:form>
</apex:page>

 

 

 

 Extension: 

/** Create Case controller used by support for Quick Case creation

TBouscal 2013-11-25
*/

public class CreateCaseController{

public Account account{get; set;} 
public Contact contact{get; set;}
public Case cs{get; set;}
public Boolean isSaveSuccess{get; set;}
Public string retURL{get; set;}

public CreateCaseController(ApexPages.StandardController controller){
    cs=((case) controller.getRecord());
    cs.contactid=ApexPages.currentPage().getParameters().get('cid');
    cs.accountid=ApexPages.currentPage().getParameters().get('aid'); 
    }
    
public void createCase(){
    cs.contactid=ApexPages.currentPage().getParameters().get('cid'); 
    cs.accountid=ApexPages.currentPage().getParameters().get('aid');
    
    insert cs;
    isSaveSuccess = true;
    retUrl=cs.id; 

    }

 

 

 

 

I am trying to capture an element from an external webpage and display it on a visualforce page whenever the text value in a field exists as a value for the external webpage. For example, if I type "GOOG" in the text field, then the page should render the current price for Google's stock.

 

Here are the details of the task:

1. Create a field to enter the ticker symbol of a stock.

2. Use the inputted ticker symbol to render a call to Google Finance or Yahoo! Finance.

3. Return the quoted price on the webpage to the visualforce page in a field.

4. The page should rerender the current price every 10 seconds.

 

I currently have the following object and fields:

Object: Stock_SC__c

 

Fields:

1. Ticker_Symbol_SC__c = text field to capture the desired ticker symbol.

2. Google_Finance_Link_SC__c = formula field that concatenates the base website URL (http://www.google.com/finance?q=) and Ticker_Symbol_SC__c text field.

3. Yahoo_Finance_Link_SC__c = formula field that concatenates the base website URL (http://finance.yahoo.com/q?s=) and Ticker_Symbol_SC__c text field.

 

The element of Google finance that stores the current price is "<span id="ref_694653_l">1,033.89</span>." For Yahoo! Finance, the element is "<span id="yfs_l84_z">73.06</span>."

 

Any help is appreciated!

  • November 25, 2013
  • Like
  • 0

Hello Helpers

 

I would like  to  display a popup  dialog  box  from inside the Visual force  page  After  the action  method  is finished at the controller side. the diualog  Box  should  display a simple message  something like  "operation succesfull"

 

 

 

<apex:commandButton  action="{!FunctionFromapexcontroller}"   "/>

 

I know  how  to  diplay  message boxes  using Javascipt  onclick()  evewnt handler but these messages fire before the 

action  method  starts

 

 

I need a message  after  the method  in controller finish

 

any suggestions are welcommed

 

Thanks in advancs

csaba

 

 

 

  • November 22, 2013
  • Like
  • 0

Hi,

 

how can we convert from E.g. June 24, 2002 5:12:16.789 PM, Australian EST is: to 20022406171216789000+60

 

can anybody help on this

Hi,

 

Please if anybody can help me in generating PPT from visualforce page with slides break.

 

Regards

Hey there,

 

I have created a VF page with extension that will re-direct the user to a visualforce page with the correct tab open after creating a new record. I tried putting that same page onto the clone button and although it autofilled the correct fields, upon attempting to save I was left with this:

 

System.DmlException: Insert failed. First exception on row 0 with id a0LN0000000OsBEMA0; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]

Error is in expression '{!SaveFactFinder}' in component <apex:commandButton> in page factfinderext

 

 

Class.extSaveButton.saveFactFinder: line 11, column 1

 

 

Am I able to do it like this or do I have to create an entirely different VF page and extension?

 

Thank you,

 

Mikie

I am attempting to write test code for a deletion extension....The extension is for a delete button inside a pageblock table for an accounts tabbed VF page. I am sure that I have overcomplicated the test as I am trying to refer to everything. Please help, look at this mess of code:

 

@isTest
private class extAccountDel {

static testMethod void extAccountDel(){
        //Attempting to change an old test to suit my new extension

// create a test account that will be use to reference the Fact Finder Record

Account acc = new Account(Name = 'Test Account');
insert acc;

//Now lets create Fact Finder, Destiny Service, Destiny Product, transaction and compliance note record that will be reference for the Standard Account
        Fact_Finder__c facTest = new Fact_Finder__c(Account__c = acc.id);
         Service__c SerTest = new Service__c(Account__c = acc.id);
         Destiny_Products__c ProTest = new Destiny_Products__c(Account__c = acc.id);
         Transaction__c TraTest = new Transaction__c(Account__c = acc.id);
        Notes__c ComTest = new Notes__c(Account__c = acc.id);
        
        
        //call the apepages stad controller
        Apexpages.Standardcontroller stdFac = new Apexpages.Standardcontroller(facTest);
         Apexpages.Standardcontroller stdSer = new Apexpages.Standardcontroller(SerTest);
          Apexpages.Standardcontroller stdPro = new Apexpages.Standardcontroller(ProTest);
           Apexpages.Standardcontroller stdTra = new Apexpages.Standardcontroller(TraTest);
            Apexpages.Standardcontroller stdCom = new Apexpages.Standardcontroller(ComTest);

//now call the class and reference the standardcontroller in the class.
        extAccountDel extFac = new extAccountDel(stdFac);
        extFac.deleteFacRecord();
        
        
        extAccountDel extSer = new extAccountDel(stdSer);
         extSer.deleteSerRecord();
        
        extAccountDel extPro = new extAccountDel(stdPro);
        extPro.deleteProRecord();
        
        extAccountDel extTra = new extAccountDel(stdTra);
        extTra.deleteTraRecord();
        
        extAccountDel extCom = new extAccountDel(stdCom);
extCom.deleteComRecord();
//call the pageReference in the class.
        
       
        
        
        
    }

}

 This is the deletion extension:

 

public class extAccountDel {

    //string delId is used to set the parameter
    public string delId {get;set;}
    public Account acc {get;set;}

    public extAccountDel (ApexPages.StandardController controller) {
        this.acc = (Account)controller.getRecord();
    }
    
    //delete for Fact Finder record and then re-directs back to the VF page with the Fact Finder tab open
    public PageReference deleteFacRecord() {
    
        Fact_Finder__c Fac = [select id from Fact_Finder__c where id =: delId];
        delete Fac;
        
        
        
        PageReference pageRef= new PageReference('/apex/DestinyAccountTest?id='+acc.id+'&Sfdc.override=1');
         pageRef.getParameters().put('tab','FactFinder');
        pageRef.setredirect(true);

       
        return pageRef;
    }
    
    
 //delete for Destiny Products record and then re-directs back to the VF page with the Destiny Products tab open
    public PageReference deleteProRecord() {
    
        Destiny_Products__c Pro = [select id from Destiny_Products__c where id =: delId];
        delete Pro;
        
        
        
        PageReference pageRef= new PageReference('/apex/DestinyAccountTest?id='+acc.id+'&Sfdc.override=1');
         pageRef.getParameters().put('tab','Destiny Products');
        pageRef.setredirect(true);
        
         return pageRef;
}

 //delete for Destiny Services record and then re-directs back to the VF page with the Destiny Services tab open
    public PageReference deleteSerRecord() {
    
        Service__c Ser = [select id from Service__c where id =: delId];
        delete Ser;
        
        
        
        PageReference pageRef= new PageReference('/apex/DestinyAccountTest?id='+acc.id+'&Sfdc.override=1');
         pageRef.getParameters().put('tab','Destiny Services');
        pageRef.setredirect(true);
        
         return pageRef;
}

 //delete for Transactions record and then re-directs back to the VF page with the Transactions tab open
    public PageReference deleteTraRecord() {
    
        Transaction__c Tra = [select id from Transaction__c where id =: delId];
        delete Tra;
        
        
        
        PageReference pageRef= new PageReference('/apex/DestinyAccountTest?id='+acc.id+'&Sfdc.override=1');
         pageRef.getParameters().put('tab','Transactions');
        pageRef.setredirect(true);
        
         return pageRef;
}

 //delete for Compliance Notes record and then re-directs back to the VF page with the Compliance Notes tab open
    public PageReference deleteComRecord() {
    
        Notes__c Com = [select id from Notes__c where id =: delId];
        delete Com;
        
        
        
        PageReference pageRef= new PageReference('/apex/DestinyAccountTest?id='+acc.id+'&Sfdc.override=1');
         pageRef.getParameters().put('tab','Compliance Notes');
        pageRef.setredirect(true);
        
         return pageRef;
}

}

I have a visual force list page with pagination when I click on next button i should get the loading image over the pageblock table i.e pageblock table to be grayed out and loading image should be visible over it I am using action status with image but image is not over the pgblock table.but it is coming below the table .can same body pls help....

  • November 19, 2013
  • Like
  • 0

I am having a small issue in my service cloud app. I was wondering if anyone else has experienced this issue in the past.

 

APP Architecture: All standard objects. I have replaced the standard objects VIEW and NEW page references with custom VF.

 

Steps to recreate error:

  1. Create new record on standard NEW page -- custom VF page
  2. Click save - default {!save}
  3. DML success record relocates to standard VIEW -- custom VF page
  4.  "refresh" browser on detail page
  • page now relocates to a new standard NEW page with all empty fields

This is a major problem for me as it drastically affects my user experience. I thought about creating an action on my detail page <apex:page> which refreshed the page (again). This has not been tested yet.

 

I first noticed the issue when speeding through my app as it has a semi "wizard" feel and I noticed I was occasionally getting kicked back to blank NEW pages.

 

your thoughts?

I want to build in two flexible pieces to a document renderer

 - allow for custom logos

 - allow for customizng a css file

 

currently the logo is storde as a document and displayed as an apex image:

 

<apex:image value="/servlet/servlet.ImageServer?id={!imageSrc}&oid={!$Organization.Id}"/>

 And the css file is a static resource

<apex:stylesheet value="{!URLFOR($Resource.PDFStyles, 'default.css')}"/>

 I'm hoping that customres will be able to upload to their own documents repository their logo for the pdf, and they can overwrite the static resource if they want to change pdf style.

 

A) are both of those editable from a managed package?

B) can the CSS file be a document as well, or is this a best practice?

 

It feels kinda odd have one resource in one place and another somewhere else

On my VF page, I am rerendering the pageblock after the user selects from a picklist.  There can be variable # of rows on the page.  After the user selects a value for each row, additional columns are displayed.  The column with the required flag shows the red bar next to the input box but no error validation takes place when the user click on the save button.

 

Any ideas????

 

VF Page - 

<apex:page standardController="STG_Car_Stock_Sale_Items__c" extensions="CarStockSaleItemManageListController" >
<!-- <apex:page controller="ManageListController"> -->
<apex:form >

<apex:pageBlock title="Car Stock Sale Items">
<apex:pageMessages />
<apex:pageBlockButtons location="top">
<apex:commandButton value="Save" action="{!save}"/> 
<apex:commandButton value="Cancel" action="{!cancel}"/> 
</apex:pageBlockButtons>

<apex:pageBlockButtons location="bottom"> 
<apex:commandButton value="Save" action="{!save}"/> 
<apex:commandButton value="Cancel" action="{!cancel}"/> 
</apex:pageBlockButtons>

<apex:pageBlockTable value="{!wrappers}" var="wrapper" id="wtable">

<apex:column headerValue="Line #">
<apex:outputText value="{!wrapper.ident}"/>
</apex:column>
<apex:column headerValue="Car Stock Sale ID">
<apex:outputField value="{!wrapper.acc.Name}"/>
</apex:column>

<apex:column headerValue="Product">
<apex:selectList id="ProdAvail" value="{!wrapper.acc.STG_Car_Stock_Product__c}" size="1" >
<apex:actionSupport event="onchange" action="{!CSProdData}" reRender="wtable">
   <apex:param name="GetProductLine" value="{!wrapper.ident}" assignTo="{!GetProductLine}"/> 
</apex:actionSupport>
<apex:selectOptions value="{!ProdAvail}"></apex:selectOptions>
</apex:selectList>
</apex:column>

<apex:column headerValue="Quantity On Hand" id="test">
<apex:actionRegion >
<!-- <apex:outputField value="{!wrapper.acc.Quantity_Available__c}" rendered="{!DisplayFields}" /> -->
<apex:outputField value="{!wrapper.acc.Quantity_Available__c}"/>
</apex:actionRegion>
</apex:column>
<apex:column headerValue="Quantity (# of Units)">
<apex:inputField value="{!wrapper.acc.Quantity__c}" required="{!DisplayFields}" style="display:{!IF(!DisplayFields == false,'inline', 'none')}" />
</apex:column>
<apex:column headerValue="Price (per Unit)">
<apex:inputField value="{!wrapper.acc.Unit_Price__c}" style="display:{!IF(!DisplayFields == false,'inline', 'none')}" />
</apex:column>

</apex:pageBlockTable>
</apex:pageBlock>

</apex:form>
</apex:page>

  

Controller - 

public with sharing class CarStockSaleItemManageListController 
{ 
 public List<AccountWrapper> wrappers {get; set;}
 public STG_Car_Stock_Sale__c css {get; set;}
 private String cssiname;
 Id returnCSid;
 public static Integer GetProductLine {get; set;}
 public static String GetProduct {get; set;}
 public static String GetProductscreen {get; set;}
 Public STG_Car_Stock_Product__c CSPData {get; set;}
 public static Boolean DisplayFields {get; set;}
 private Integer CountProducts;
  
 public CarStockSaleItemManageListController (ApexPages.StandardController stdController) {
    Id currentStockSaleId = ApexPages.CurrentPage().getParameters().get('carstock');
    returnCSid = currentStockSaleId;
    if(currentStockSaleId != null){
        this.css = [Select Name, Id, Number_of_Lines__c, Customer_Account__c, STG_Car_Stock__c 
                    From STG_Car_Stock_Sale__c where Id =:currentStockSaleId ];
     }                  
          
  wrappers=new List<AccountWrapper>();

  for (Integer idx=1; idx<=css.Number_of_Lines__c; idx++)
  {
   if(idx < 10){
      cssiname = css.name + '0' + idx;
   } else {
      cssiname = css.name + idx;
   }
   wrappers.add(new AccountWrapper(idx, cssiname, currentStockSaleId));
  }

 }
 
  //builds a picklist of Products based on the wholesale account
  public List<selectOption> getProdAvail() {
  
     //new list for holding all of the picklist options
     List<selectOption> options = new List<selectOption>(); 

     //add the first option of '- None -' in case the user doesn't want to select a value or in case no values are returned from query below  
     options.add(new selectOption('', '- None -')); 
     //System.debug('************ Query:11 ************ ' + scp);   

     //query for Product records 
     for (STG_Car_Stock_Product__c acctpa : [SELECT Id, Product__c FROM STG_Car_Stock_Product__c 
     WHERE STG_Car_Stock__c = :css.STG_Car_Stock__c AND Quantity_On_Hand__c > 0 ORDER BY Product__c]) { 

        //for all records found - add them to the picklist options
        options.add(new selectOption(acctpa.id, acctpa.Product__c)); 
     }
  
  //return the picklist options
  return options; 
  }
  
 public PageReference save()
 {
  System.debug('************ Query:ACTION SAVE1 ************ ' + wrappers[1].acc.Quantity__c);
  System.debug('************ Query:ACTION SAVE2 ************ ' + wrappers[0].acc.Unit_Price__c);
  List<STG_Car_Stock_Sale_Items__c> accs=new List<STG_Car_Stock_Sale_Items__c>();
  for (AccountWrapper wrap : wrappers)
  {
   accs.add(wrap.acc);
  }
  System.debug('************ Query:ACTION SAVE2 ************ ' + accs); 
  insert accs;
  
  PageReference returnPage = new PageReference('/' + returnCSid);
            returnPage.setRedirect(true);
            return returnPage; 
 }
 
 public PageReference cancel()
 {
  PageReference returnPage = new PageReference('/' + returnCSid);
            returnPage.setRedirect(true);
            return returnPage; 
 }
 
 public PageReference CSProdData(){
     GetProductLine = GetProductLine-1;
     GetProduct = Wrappers[GetProductLine].acc.STG_Car_Stock_Product__c;
     if (GetProduct != null) {
        CSPData = [SELECT Id, Last_Purchase_Price_per_Unit__c, Product__c, Quantity_On_Hand__c 
                   FROM STG_Car_Stock_Product__c
                   WHERE Id = :GetProduct.substring(0,15)];
     Wrappers[GetProductLine].acc.Quantity_Available__c = CSPData.Quantity_On_Hand__c;
     Wrappers[GetProductLine].acc.Unit_Price__c = CSPData.Last_Purchase_Price_per_Unit__c.setScale(2);
     Wrappers[GetProductLine].acc.Avg_Purchase_Price__c = CSPData.Last_Purchase_Price_per_Unit__c;
          
     DisplayFields = false;
     CountProducts = 0;
     for (Integer idx=0; idx<=(Wrappers.size()-1); idx++)
     {
       GetProduct = Wrappers[idx].acc.STG_Car_Stock_Product__c;
       if(GetProduct != null){
          CountProducts = CountProducts + 1;
       } 
     }
       if (CountProducts == Wrappers.size()) {
          DisplayFields = true;
       }
       //System.debug('************ Query:ACTION FOR7 ************ ' + CountProducts);
       //System.debug('************ Query:ACTION FOR8 ************ ' + Wrappers.size());
       //System.debug('************ Query:ACTION FOR9 ************ ' + DisplayFields); 
     } 
     return null;
 }
  
 public class AccountWrapper
 {
  public STG_Car_Stock_Sale_Items__c acc {get; private set;}
  public String iname {get; private set;}
  public String inamecss {get; private set;}
  public Integer ident {get; private set;}
  
  //public AccountWrapper(String inIdent)
  public AccountWrapper(Integer inIdent, String inName, String InNameCSS)
  {
   ident=inIdent;
   iname=inName;
   inamecss=inNameCSS;
   acc=new STG_Car_Stock_Sale_Items__c(Name = iname, Line_Number__c = ident, STG_Car_Stock_Sale__c = inamecss);
  }
 }
}

 

I have a VF page where a button is present.On click of it a batchjob runs and deletes the records from custom object.

 

So my design was I have controller 'batchctrl' for the VF Page which will call the execute method of the batch class.

 

Here is the execute method in my batchClass:

public     List<obj__c> objList= new List<obj__c>();

global void execute(Database.BatchableContext BC,List<sObject> scope){

    for(sObject s:scope){
       obj__c x= (obj__c)s;       
       objList.add(x);
    }     
    delete objList;
}

 

Finish Method:

global void finish (Database.BatchableContext BC){
    AsyncApexJob a = [Select Id, Status, NumberOfErrors, JobItemsProcessed, TotalJobItems, CreatedBy.Email, ExtendedStatus
                          From AsyncApexJob where Id =:BC.getJobId()];
   if(a.status=='Completed'){

     ObjRecordsSize = objList.size();
       batchctrl b= new batchctrl();
       b.updateErrorMsg(ObjRecordsSize);
   }
}

 

In the finish method i'm trying to call updateErrorMsg method of my batchctrl class to send the recordsize value and if it is zero i want to display an error message.

 

But i'm getting the below exception

System.FinalException: ApexPages.addMessage can only be called from a Visualforce page

 

So please let me know if they is any way I could display the error message in the VF Page.

I'm sure that there must be someway :)

 

Many thanks in advance :)

Hello,

 

I have the following VF Page code which allows a user to toggle between 3 different images (red, yellow, green).  The toggle works, but now I need to assign a value to a custom number variable based upon the image that the user toggles to.  Does anyone know how I can accomplish this or where I might find some code to do it?  Thanks,

 

<apex:page standardController="Account_Plan__c" tabStyle="Account" ShowHeader="TRUE">


<apex:outputPanel id="msgs">
<apex:pageMessages />
</apex:outputPanel>

 

<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" />
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js" />

 

<script type="text/javascript">


$(document).ready(function () {
$('.icon').click(function () {
$(this).hide();
var next = $(this).next();
console.log(next.length);
if (next.length == 0)
next = $(this).parent().find('.icon').first();

next.show();
});
});
</script>

 

<style type="text/css">
#StatusIcon
{
position: relative;
}

.icon
{
position: absolute;
left: 0px;
top: 0px;
display: none;
}

.icon.default
{
display: block;
}
</style>

 

<apex:form >


<div id="StatusIcon">
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP7" class="icon default" id="R"/>
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP8" class="icon" id="Y"/>
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP6" class="icon" id="G"/>
</div>

 

</apex:form>

</apex:page>

  • May 17, 2013
  • Like
  • 0

Hi,

I am trying to write a chatter trigger to repost to an account if it meets a certain criteria ?  

 

For example: if i post something aboutn # canada in my personal feed or in a group feed, it should automatically reposted to the account feed which is having account name as canada.

 

I have trigger a trigger on this.

 

trigger chatterfeed on FeedItem (after insert)
{

set<string> fbody= new set<string>();
for(feedItem f:trigger.new)
{
fbody.add(f.body);
}
List<FeedItem> feedItems = new List<FeedItem>();
list<account> a=[select id,name,ownerId from account ];

for(FeedItem f:trigger.new)
{

for(account ac:a){
if(f.body.contains(ac.name))
{
string s= f.body;
FeedItem fitem = new FeedItem();
fitem.type = 'LinkPost';
fitem.ParentId = ac.id;
system.debug(fitem.parentId+'IIIIIIIIII');
fitem.linkurl='https://ap1.salesforce.com/_ui/core/userprofile/UserProfilePage?u=00590000000NI6s&fId='+f.id;
fitem.Title = 'view';
fitem.Body=s;
system.debug(fitem.body+'BBBBBBBBB');
feedItems.add(fitem);
system.debug(feedItems+'FFFFFFFFf');
}
}
}

if(feedItems.size() > 0) {
try{
Database.insert(feedItems,false);
system.debug(feedItems+'OOOO');}
catch(exception e){}
}
}

 

I am getting internal salesforce error when I am fetching feetitem body. If I fetch feed Item id it is working fine.

 

Can anyone pls help me out its very urgent.

 

Thanks in advance.

 

 

 

  • April 08, 2013
  • Like
  • 0