• vck01
  • NEWBIE
  • 5 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies

Hi guys,

 

I have a vf page(say container) in which i have used iframe where the source is another visual force page.I am trying to call the action functon in iframe from the container page. It's working perfectly fine in the Internet Explorer but not working in other browsers.I am not able to figure out what the issue could be.Here is the example sample of what i did.Please help me out in solving this issue. Thanks in Advance!!

 

 

 

Container Page:


<apex:page standardController="Account" sidebar="false" showHeader="false" extensions="testWizard" id="pgtest" cache="true" >
<apex:form id="frmSupplier1" >
<apex:pageBlock id="pgSupplier" mode="detail" >
<apex:pageBlockButtons >
<apex:commandButton action="{!previous}" value="previous" onclick="return document.getElementById('testgrid').contentWindow.callFromOtherPagetoSave();" />
<apex:commandButton action="{!saveAndNext}" value="next" onclick="return document.getElementById('testgrid').contentWindow.callFromOtherPagetoSave();" />
</apex:pageBlockButtons>

<iframe width="100%" class="autoHeight" frameborder="0" src="{!$Page.Base_VFP_test}?id={!supplier.Id}&inline=1 name="testgrid" id="testgrid" />
</apex:pageBlock>
</apex:form>
</apex:page>


Iframe page

<apex:page controller=Account extension="class_testgrid">
<script>
function callFromOtherPagetoSave()
{

savethegrid();
return true;
}

</script>
<apex:actionfunction action="{!savethegrid}" id="savethegrid1"/>
----Some code here ---
</apex:page>


  • January 03, 2011
  • Like
  • 0

Pls help me to write a test class for the below class.

 

 

public class transferinnew1 {
String pid = ApexPages.currentPage().getParameters().get('id');
public  List<Product_serial__c> pserial=new List<Product_Serial__c>();
);

public  List<Transfer_In__c> pt=new List<Transfer_in__c>();

 
 public transferinnew1(){


 pserial=[select id,name,Product_disp__c,type__c,serial_number__c,status__c,warehouse__c,bin__c,order__c,select__c,project__c
from product_serial__c where status__c='Out'  order by order__c asc];
 
 
 pt=[select id,reasons__c ,order__c from transfer_in__c where id =:ApexPages.currentPage().getParameters().get('id') ];

}

public List<product_serial__c> getRecord() {
            return pserial;
      }
      public List<transfer_in__c> getRec() {
            return pt;
      }

    public PageReference save() {
   
      
  update pserial;
for ( product_serial__c ps:pserial){

  if(ps.select__c==true){
  Transfer_In_Line__c iv = new Transfer_In_Line__c(product_serial__c = ps.id,
        transfer_in__c=pid,warehouse__c=ps.warehouse__c,bin__c=ps.bin__c );
insert iv;
ps.select__c=false;
ps.status__c='Available';
  ps.tid__c=pt[0].reasons__c;      
update ps;
if (pt[0].reasons__c=='Excess Material')
{
ps.order_stock__c=false;
ps.type__c='Spare Stock';
ps.order__c=null;
update ps;
}
if (pt[0].reasons__c=='Ongoing Project (Hold Stock)')
{
ps.order_stock__c=true;
ps.order__c=pt[0].order__c;
ps.status__c='Order Stock';
ps.type__c='Spare Stock';

update ps;
}

}
 
}

 
  Pagereference p = new PageReference('/'+pid);

p.setRedirect(true);

return p;  
   
   }   
   public PageReference Cancel() {
  delete pt;

PageReference mysample = Page.tabinv;
       mysample.setRedirect(true);    
                     return mysample;
 

}


}

 

 

 

 

Thanks,

 

Vidya

 

 

  • May 11, 2011
  • Like
  • 0

I have written Apex code to support custom functionality for all objects. As I need to perform common task according to organization wide defaut secuirty(Public/Private) of object.

 

Is there any way to dynamically know the OWD of the object with in the Apex class. So I do not need to change the code, if any object OWD permission get changed.

 

Thanks in advance.

Ganesh

Using this code I can get a list of my objects

 

 

Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();

 

 

I can look through that list and get the Schema.SObjectType

 

Now I want to display the fields within that SObjectType in a manner similar to

 

Map<String, Schema.SObjectField> M = Schema.SObjectType.Account.fields.getMap();

 

The problem is in that last example Account is static, where I need to use a variable to designate the proper SObject Type since I will be looping through them.

I’m the developer of a package that has a heavy dependence on a scheduled Batch Apex job. The package currently runs in a dozen or so orgs, some of which have fairly large amounts of data. One org in particular has over 3 million records that are processed by the Batch Apex job.

 

Over the past 3 months, we’ve been encountering a lot of stability problems with Batch Apex.  We’ve opened cases for several of these issues, and they’ve been escalated to Tier 3 Support, but it consistently takes 2 weeks or more to get a case escalated, and then it can several more weeks to get a meaningful reply form Tier 3.

 

We really need to talk with the Product Manager responsible for Batch Apex. We asked Tier 3 to make that introduction, but they said they couldn’t. We’re trying to work with Sales to set up a discussion with a Product Manager, but so far, we haven’t had any luck there either. We’re hoping that a Product Manager might see this post and get in touch with us. We need to find out whether Batch Apex is a reliable-enough platform for our application.

 

Here are a few examples of the problems we’ve been having:

 

  • The batch job aborts in the start() method. Tier 3 Support told us that the batch job was occasionally timing out because its initial  query was too complex. We simplified the query (at this point, there are no WHERE or ORDER BY clauses), but we occasionally see timeouts or near timeouts. However, from what we can observe in the Debug Logs, actually executing the query (creating the QueryLocator) takes only a few seconds, but then it can take many minutes for the rest of the start() method to complete. This seems inconsistent with the “query is too complex” timeout scenario that Tier 3 support described.  (Case 04274732.)
  • We get the “Unable to write to ACS Stores” problem. We first saw this error last Fall, and once it was eventually fixed, Support assured us that the situation would be monitored so it couldn’t happen again. Then we saw it happen in January, and once it was eventually fixed, Support assured us (again) that the situation would be monitored so it couldn’t happen again. However, having seen this problem twice, we have no confidence that it won’t arise again. (Case 04788905.)
  • In one run of our job, we got errors that seemed to imply that the execute() method was being called multiple times concurrently. Is that possible? If so, (a) the documentation should say so, and (b) it seems odd that after over 6 months of running this batch job in a dozen different orgs, it suddenly became a problem.

 

  • We just got an error saying, “First error: SQLException [java.sql.SQLException: ORA-00028: your session has been killed. SQLException while executing plsql statement: {?=call cApiCursor.mark_used_auto(?)}(01g3000000HZSMW)] thrown but connection was canceled.” We aborted the job and ran it again, and the error didn’t happen again.
  • We recently got an error saying, “Unable to access query cursor data; too many cursors are in use.” We got the error at a time when the only process running on behalf of that user was the Batch Apex process itself. (Perhaps this is symptomatic of the “concurrent execution” issue, but if the platform is calling our execute() method multiple times at once, shouldn’t it manage cursor usage better?)
  • We have a second Batch Apex job that uses an Iterable rather than a QueryLocator. When Spring 11 was released, that Batch Apex job suddenly began to run without calling the execute() method even once. Apparently, some support for the way we were creating the Iterable changed, and even though we didn’t change the API version of our Apex class, that change caused our Batch Apex job to stop working. (Case 04788905.)
  • We just got a new error, "All attempts to execute message failed, message was put on dead message queue."

 

We really need to talk with a Product Manager responsible for Batch Apex. We need to determine whether Batch Apex is sufficiently stable and reliable for our needs. If not, we’ll have to find a more reliable platform, re-implement our package, and move our dozen or more customers off of Salesforce altogether.

 

If you’re responsible for Batch Apex or you know who is, please send me a private message so we can make contact. Thank you!

 

  • April 04, 2011
  • Like
  • 0