• S.Haider Raza
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Developer
  • Pentasoft


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 9
    Replies
Hi i have a requirement please find the below req and suugget me , or send my any related code is already developed .

Display all related opp records for a particualr account with the below conditions
1) Opportunities which are status= TRUE 
2) These Opportunities should have at least one Product.
3) This VF page should support Pagination, each page should have max of 25 record.
This VF page should have sorting in all the columns.
4) VF page should have i/p check box has to be present in front of every record.


i developed VF page for pagination for displaying account records but dont know how to to display one account related opportunities , please help me on this or send any code 

Regards,
Hanu
hello i worte an apex trigger code, which update custom fields in oppertunity object, with the details of the primary contactrole,

the code works fine , but i cant deploy it cause i just dont know how to builed an apex test , 

could someone help me with that.

the code:

trigger PrimaryContactRole on Opportunity (before update) {

List<String> names = new List<String>();

   for (Opportunity o : Trigger.new) {
     Integer i = [select count() from OpportunityContactRole where OpportunityId = :o.id and IsPrimary = true];

        

       if(i==1) {

OpportunityContactRole contactRole = [select Contact.name,Contact.email,Contact.phone ,Contact.Passport_Num_contact__c,Contact.Local_ID_contact__c from OpportunityContactRole where OpportunityId = :o.id and IsPrimary = true];

 o.Opportunity_Contact_email__c = contactRole.Contact.email;
        
  o.Opportunity_Contact_name__c = contactRole.Contact.name;
  
  o.Opportunity_Contact_passport__c = contactRole.Contact.Passport_Num_contact__c;
 
  o.Opportunity_Contact_phone__c = contactRole.Contact.phone;

  o.Opportunity_Contact_localid__c = contactRole.Contact.Local_ID_contact__c;
   
   
   o.Contact_Role_Count__c = i;
   
  }

  }
thank you!
Hi.

I just want that one of my pages to a get request to other of my pages. I know how to do GET requests from APEX but because pages are behind auth I don't know how I can do it. 
For example: So I want that the app: https://c.na24.visual.force.com/apex/test01 calls https://c.na24.visual.force.com/apex/test02
Thank you
Hi All,

I have created a custom button on case feed that helps to change owner either to user or queue. Now, I need to include a send email notification checkbox in that visualforce page that will send email when case owner is changed same as standard SFDC Change Owner page.

Please can anyone help? Here is my visualforce and apex code.
 
apex:page tabStyle="Case" standardController="Case" extensions="ChangeCaseOwner" sidebar="false">

<apex:form id="formId">
<apex:includeScript value="/soap/ajax/26.0/connection.js"/>  
<apex:includeScript value="/support/console/26.0/integration.js"/>
<apex:inputHidden id="isInConsole" value="{!isInConsole}" />
<apex:sectionHeader title="Change Case Owner"/>
<!-- <p>This screen allows you to transfer cases from one user or queue to another. When you transfer ownership, the new owner will own:</p>
<ul><li>all open activities (tasks and events) for this case that are assigned to the current owner</li></ul>
<p>Note that completed activities will not be transferred. Open activities will not be transferred when assigning this case to a queue.</p> -->
<apex:pageBlock mode="Edit">
<apex:pageMessages ></apex:pageMessages>
<apex:pageBlockButtons location="bottom">
<apex:outputText rendered="{!shouldRedirect}">
                <script type="text/javascript">
                    window.top.location.href = '{!redirectUrl}';
                </script>
</apex:outputText>
<apex:commandButton value="Save" action="{!save}" />
<apex:commandButton value="Cancel" action="{!cancel}"/>
</apex:pageBlockButtons>
<br/><apex:pageBlockSection title="Select New Owner" collapsible="false" columns="3">
<apex:pageBlockSectionItem >
<apex:outputLabel value="Owner"></apex:outputLabel>
<apex:inputField value="{!Case.ownerId}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
<script type="text/javascript">
    document.getElementById("j_id0:formId:isInConsole").value = sforce.console.isInConsole();
</script>

</apex:page>

Apex Code
public class ChangeCaseOwner {
    ApexPages.StandardController   controllerInstance;
    public String redirectUrl {public get; private set;}
    public Boolean shouldRedirect {public get; private set;}
    public String isInConsole{get; set;}
    public String browserUrlforRedirection{get;set;}
   
    public ChangeCaseOwner (ApexPages.StandardController controller) {
        controllerInstance = controller;
    } 
    
    public pageReference save () {
        controllerInstance.save();
        case caseRecord = (Case)controllerInstance.getRecord();
        shouldRedirect = true;
        system.debug('correctVal' + isInConsole);
        String baseUrl = System.URL.getSalesforceBaseUrl().toExternalForm();
        String url;
        if(isInConsole == 'false') {
            url = baseUrl + '/' + caseRecord.Id ;
            system.debug('inside false');
        }
        else{
            url = baseUrl + '/console' ;
        }
        system.debug('final url' + url);
        redirectUrl  = url;
        system.debug(redirectUrl);
        //redirectUrl = 'https://cs30.salesforce.com/console';
        return null;

    } 
    
    public pageReference cancel () {
        case caseRecord = (Case)controllerInstance.getRecord();
        shouldRedirect = true;
        system.debug('correctVal' + isInConsole);
        String baseUrl = System.URL.getSalesforceBaseUrl().toExternalForm();
        String url;
        if(isInConsole == 'false') {
            url = baseUrl + '/' + caseRecord.Id ;
        }
        else{
            url = baseUrl + '/console' ;
        }
        redirectUrl  = url;
        return null;

    } 

}


 
  • June 17, 2015
  • Like
  • 0
I have a customer requirement for mys users to have the ability to upload multiple products by way of an external text file to the quote line items. 
This would be part of the user experience each time they work on an opportunity and not an admin feature or use the data loader. I cannot think of a method of doing this. Any ideas ?
 
Hi All,

I need to select all the fields ( like accountName, accountNumber etc ) of Account ( or any sobject ) through SOQL.

I constructed the select qurey as follows.

DescribeSObjectResult res = binding.describeSObject( "Account" );
Field[] fields = res.getFields();
String expr = "";
for( int i=0; i < fields.length-1; i++ )
{
expr += fields[i].getName() + ", ";
}
expr += fields[ fields.length - 1 ].getName();

String qry = "Select " + expr + " from Account";
QueryResult res = binding.query( qry );

While executing this, I am getting following exception.

Is there any easier way to achieve this!

Kindly help me solve this problem!

Regards,
Ganesh Kumar N.S.A

Exception in thread "main" java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.crimson.tree.ElementNode2
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:217)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at com.adventnet.authentication.interceptor.ClientPrincipalAssociator.invoke(ClientPrincipalAssociator.java:52)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
at $Proxy1.importFromSForce(Unknown Source)
at com.adventnet.examples.ImportUtilClient.main(ImportUtilClient.java:39)
Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.crimson.tree.ElementNode2
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1603)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:215)
... 10 more
Caused by: java.io.NotSerializableException: org.apache.crimson.tree.ElementNode2
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1224)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1050)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:367)
at java.util.Vector.writeObject(Vector.java:1017)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
  • April 23, 2004
  • Like
  • 0