• kgrasu
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 12
    Replies
Hi,

Is System.AsyncException (Future method cannot be called from a future or batch method) apply to appexchnage partner program?

We have installed an AppExchange which is a managed package  and also we have our own code (batch apex). Whenever we run the batch job; the future callout in the managed package is error out a System.AsyncException.
The managed package code snippet are:

Trigger:
trigger <triggername> on opportunity (before update){
//checking condition
If(Check__c == true);
//collect the info and call future method
Classname.updatemethod(data);


Class:
Public with sharing class classname{
@future (callout=true)
    public static void updatemethod(Sring data) {
//send data to external system
}

We running a batch job daily on opportunity and updating the check__c field based on some condition.

So basically, if the batch job update the check__c = true then the trigger in managed package fire and collect the info and send to the external system by future callout.

Please refer the error message below:
Update failed. First exception on row 0 with id 0066000000Qzl22AAB; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, triggername: execution of BeforeUpdate caused by: System.AsyncException: Future method cannot be called from a future or batch method: Classname.updatemethod(data);

How do we resolve this kind of issues between client’s batch job and appExchange’s future callout during an update operation.

Thanks and regards
Govinda
  • October 08, 2014
  • Like
  • 0

Hi,

I am an experienced Salesforce.com independent administrator/developer for implementing solutions on the force.com platform.

My expertise is in the following areas:

- Gather business requirements and convert to technical solutions
- Take initiative in implementing solutions on the force.com platform
- Custom development using Apex classes, triggers and Visualforce
- Configuring and customizing Customer and Partner Portals (PRM)
- Automating business processes using triggers, workflows, Email Services and Outbound Messaging
- Creating rich user interfaces using visualforce pages
- Installing applications from AppExchange and customizing them
- Performing Quality Assurance (regressing, functionality and performance testing) of applications before deployment to production environments
- Entire end-to-end administrative functionalities on the force.com platform
- Data analysis and data migration between systems using Data Loader tools and Apex Explorer
- Creating custom reports and dashboards and complex reporting
- Development expertise using Apex and Visualforce
- Deployment strategies and processes using the force.com Migration tools
- Provide 24X7 production support and accountability for resolving support related issues

 

Skill set: Apex triggers and classes, Visualforce, SControls, Web Services, SOQL, SOSL, Oracle SQL, PLSQL, HTML, Javascript, Access, Excel and its data cleansing functions

 

Rates: negotiable
Current Location: Fremont, California

 

Please contact me at 510-209-3152 or send me an email at govindarasuk@yahoo.com if you need more information.

 

Thank you

Govindarasu

  • October 30, 2009
  • Like
  • 0

Hi,

 

I am an experienced Salesforce.com independent administrator/developer for implementing solutions on the force.com platform.

 

My expertise is in the following areas:

 

- Gather business requirements and convert to technical solutions
- Take initiative in implementing solutions on the force.com platform
- Custom development using Apex classes, triggers and Visualforce
- Configuring and customizing Customer and Partner Portals (PRM)
- Automating business processes using triggers, workflows, Email Services and Outbound Messaging
- Creating rich user interfaces using visualforce pages

- Installing applications from AppExchange and customizing them
- Performing Quality Assurance (regressing, functionality and performance testing) of applications

before deployment to production environments
- Entire end-to-end administrative functionalities on the force.com platform
- Data analysis and data migration between systems using Data Loader tools and Apex Explorer

- Creating custom reports and dashboards and complex reporting
- Development expertise using Apex and Visualforce
- Deployment strategies and processes using the force.com Migration tools
- Provide 24X7 production support and accountability for resolving support related issues

 

Skill set: Apex triggers and classes, Visualforce, SControls, Web Services, SOQL, SOSL, Oracle SQL, PLSQL, HTML, Javascript, Access, Excel and its data cleansing functions

 

Rates: negotiable
Current Location: Fremont, California

 

Please contact me at 510-209-3152 or send me an email at govindarasuk@yahoo.com if you need more information.

 

Thank you

Govindarasu

 

 

 

Message Edited by kgrasu on 08-08-2009 01:11 PM
Message Edited by kgrasu on 08-10-2009 02:09 PM
  • August 08, 2009
  • Like
  • 0
Hi,
 
We have a visualforce page that has a javascript function which initializes a var to some value. We need to pass this value to the controller of the visualforce page "without" any user interaction like onclick, onkeypress etc. How can we acheive this? Is there an equivalent functionality like *page onload* that can invoke a controller method?
 
Thanks and regards
Rasu
  • December 17, 2008
  • Like
  • 0
Hi,
 
We need to use salesforce email templates from a trigger or Apex class. The template has most of the merge fields from a custom object named "Assignment__c" and the email needs to be sent to the custom email field in another custom object named "Contractor__c".
 
Is this possible using the following code snippet?  We tried it but was throwing exception saying that it supports only standard objects by Users, Lead and Contacts.
 
   mail.setTemplateId(templateId);
   mail.setTargetObjectId ('01I700000002M9A');
   mail.setWhatId(AssignmentId);
 
Any help or guidelines with some sample code on how this can be done will be greatly appreciated. Thanks and let me know if you need any other information.
 
Regards,
Rasu
  • November 20, 2008
  • Like
  • 0
Hi,
I am creating a VF page for creating "New" Log a Call or New Task. I have the following code in VF. The issue is that it is not saving the information for the custom fields when entered, but the data from standard fields like ActivityDate data is saved when the new log a call or task record is inserted.
 
Appreciate all help. Thanks

VF Code:
<apex:page  controller="conTaskNew">
<apex:form >
<apex:pageBlock id="mypageblock" title="Task Edit" mode="new">
<apex:pageBlockButtons >
<apex:commandButton onclick="return lsave()" action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Task Information" columns="2" id="theSection">
<apex:inputField id="vDisposition" value="{!task.Disposition__c}"/>
<apex:inputField id="vActDate" value="{!task.ActivityDate}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 
Controller Code:
public class conTaskNew {
private Task taskobj;
private String vleadid;
private String vOwner;
private String vemail;
private String vwholead;
private String vwhatid;
private String vdisposition;
private String vactionbynewten;
private Date vactivitydate;
private String vsubject;
private String vdesc;
private String vstatus;
String vid;


public conTaskNew(){
this.vleadid = ApexPages.currentPage().getParameters().get('lid');
this.vOwner= ApexPages.currentPage().getParameters().get('assignedTo');
}


public String getOwner(){
return this.vOwner;
}


public void setOwner(String pown){
this.vOwner = pown;
}

public Task getTask() {
return taskobj;
}

public void setTask(Task taskdet) {
taskobj = taskdet;
}



public String getWhoId(){
return this.vwholead;
}


public void setWhoId(String pwholead){
this.vwholead = pwholead;
}

public String getWhatId(){
return this.vwhatid;
}


public void setWhatId(String pwhatid){
this.vwhatid = pwhatid;
}
public String getDisposition(){
return this.vdisposition;
}


public void setDisposition(String pdisposition){
this.vdisposition = pdisposition;
}


public Date getActivityDate(){
return this.vactivitydate;
}


public void setActivityDate(Date pactivitydate){
this.vactivitydate = pactivitydate;
}


public PageReference save() {



Lead leadrec=[Select ownerid from Lead where Id=:this.vleadid];
this.vOwner = leadrec.Ownerid;
Task newtask= new Task(
Subject=this.vsubject,
WhoId= this.vleadid,
Ownerid= this.vOwner,
disposition__c= this.vdisposition,
activityDate= this.vactivitydate

);
try{
insert newtask;
}catch(Exception e){
throw e;
}
PageReference secondPage = new PageReference('/'+vleadid);
secondPage.setRedirect(true);
return secondPage;

}
}
  • September 05, 2008
  • Like
  • 0
Hi,
 
I am overriding the "Log a Call " new page in visualforce.
 
How can I add the "Send Notification Email" checkbox that in the standard new page for "Log A Call"  to my custom visualforce edit page for "Log A Call"? I dont see the API name for this field anywhere in the Task object definition.
 
Appreciate if soemone can comment on this issue.
 
Thanks
  • September 05, 2008
  • Like
  • 0
Hi
I am trying to override the edit page for "Log a Call" or task with a custom visualforce page. I am having trouble getting some of the fields like
Assigned To,
Related To and
the checkbox "Send Notification Email".
I was able to add other fields uisng the API names.
 
Appreciate if anyone can help with the right way to adding the above fields in VF page.

When I add the following for the Assigned To, it throws the error "Assigned To ID: owner cannot be blank". Basiaclly I want to display the Assigned To field as it appears in the standard Log a Call edit page. Is there some reference available somewhere for converting all these fields in the standard page into a VF page?
 
VF Code:
<apex:page standardController="Task" extensions="conTaskNew">
<apex:form >
<apex:pageBlock id="mypageblock" title="Task Edit" mode="new">

<apex:pageBlockButtons >
<apex:commandButton onclick="return lsave()" action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Task Information" columns="2" id="theSection">
<apex:inputField id="vOwner" value="{!task.OwnerId}"/>
<apex:inputField id="vActDate" value="{!task.ActivityDate}"/>
<apex:inputField id="vsubject" value="{!task.Subject}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 Appreciate all your valuable feedbacks.
  • September 05, 2008
  • Like
  • 0
Hi,
I am creating a VF page for creating "New" Log a Call or New Task. I have the following code in VF. The issue is that it is not saving the information for the custom fields when entered, but the data from standard fields like ActivityDate data is saved when the new log a call or task record is inserted.
 
Appreciate all help. Thanks

VF Code:
<apex:page  controller="conTaskNew">
<apex:form >
       <apex:pageBlock id="mypageblock" title="Task Edit" mode="new">  
            <apex:pageBlockButtons >                    
            <apex:commandButton onclick="return lsave()"   action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Task Information" columns="2" id="theSection"> 
            <apex:inputField id="vDisposition" value="{!task.Disposition__c}"/> 
            <apex:inputField id="vActDate" value="{!task.ActivityDate}"/> 
     </apex:pageBlockSection>               
</apex:pageBlock>
</apex:form>
</apex:page>

 
Controller Code:
public class conTaskNew {
   private Task taskobj;
        private String vleadid;
        private String vOwner;
        private String vemail;
        private String vwholead; 
        private String vwhatid;
        private String vdisposition;
        private String vactionbynewten;
        private Date vactivitydate;
        private String vsubject;
        private String vdesc;
        private String vstatus;
        String vid;
       
        
     public   conTaskNew(){  
               this.vleadid = ApexPages.currentPage().getParameters().get('lid');  
               this.vOwner= ApexPages.currentPage().getParameters().get('assignedTo'); 
     }
        
        
       public String getOwner(){
            return this.vOwner;
            }          
        
            
        public void setOwner(String pown){
            this.vOwner = pown;
            }
        
             public Task getTask() {                     
                     return taskobj;
                }
 
                public void setTask(Task taskdet) {
                      taskobj = taskdet;
                }
                                
        
       
        public String getWhoId(){
            return this.vwholead;
            }          
        
            
        public void setWhoId(String pwholead){
            this.vwholead = pwholead;
            }            

        public String getWhatId(){
            return this.vwhatid;
            }          
        
            
        public void setWhatId(String pwhatid){
            this.vwhatid = pwhatid;
            } 
        public String getDisposition(){
            return this.vdisposition;
            }          
        
            
        public void setDisposition(String pdisposition){
            this.vdisposition = pdisposition;
            }             
            

         public Date getActivityDate(){
            return this.vactivitydate;
            }          
        
            
        public void setActivityDate(Date pactivitydate){
            this.vactivitydate = pactivitydate;
            }  
            
       
        public PageReference save() {    
         
              
                
                 Lead leadrec=[Select ownerid from Lead where Id=:this.vleadid];     
                 this.vOwner = leadrec.Ownerid;   
                 Task newtask= new Task(
                 Subject=this.vsubject,  
                 WhoId= this.vleadid,
                 Ownerid= this.vOwner,                 
                 disposition__c= this.vdisposition,                 
                 activityDate= this.vactivitydate              
                 
                 );
                  try{
                      insert newtask;                     
                  }catch(Exception e){
                   throw e;
                  }
                     PageReference secondPage = new PageReference('/'+vleadid);
                     secondPage.setRedirect(true);
                     return secondPage;             
                 
       } 
}

 



Message Edited by kgrasu on 09-05-2008 11:20 AM
  • September 05, 2008
  • Like
  • 0
Hi,
 
I am overriding the "Log a Call " new page in visualforce.
 
How can I add the "Send Notification Email" checkbox that in the standard new page for "Log A Call"  to my custom visualforce edit page for "Log A Call"? I dont see the API name for this field anywhere in the Task object definition.
 
Appreciate if soemone can comment on this issue.
 
Thanks
 
  • September 04, 2008
  • Like
  • 0
Hi
I am trying to override the edit page for "Log a Call" or task with a custom visualforce page. I am having trouble getting some of the fields like
Assigned To,
Related To and
the checkbox "Send Notification Email".
I was able to add other fields uisng the API names.
 
Appreciate if anyone can help with the right way to adding the above fields in VF page.

When I add the following for the Assigned To, it throws the error "Assigned To ID: owner cannot be blank". Basiaclly I want to display the Assigned To field as it appears in the standard Log a Call edit page. Is there some reference available somewhere for converting all these fields in the standard page into a VF page?
 
VF Code:
<apex:page standardController="Task" extensions="conTaskNew">
<apex:form >
       <apex:pageBlock id="mypageblock" title="Task Edit" mode="new">       
     
            <apex:pageBlockButtons >                    
            <apex:commandButton onclick="return lsave()"   action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Task Information" columns="2" id="theSection">  
           <apex:inputField id="vOwner" value="{!task.OwnerId}"/>             
            <apex:inputField id="vActDate" value="{!task.ActivityDate}"/>     
            <apex:inputField id="vsubject" value="{!task.Subject}"/>                
     </apex:pageBlockSection>               
</apex:pageBlock>
</apex:form>
</apex:page>

 Appreciate all your valuable feedbacks.
  • September 04, 2008
  • Like
  • 0
Hi,
 
I have a very basic question in Visualforce. I need to have a parameter in the VF page, assign a value to it using javascript and then retrieve the parameter values from the controller.
 This is my part VF code:
 
Code:
<apex:page controller="conLeadTab" action="{!validate}">
<apex:pageBlock id="mypageblock" mode="new">
                 <apex:param id="vesg"   name="vesg" value=""/>
     </apex:pageBlock>
<script language="javascript">
var vesgval = 'SOme value';
//The line below does not work, but here I need to assign the value of vesgval to the parameter vesg
//{!$CurrentPage.parameters.vesg}=vesgval;
</script>  
</apex:page> 

 

   
//My controller method 
 
Code:
  public PageReference validate() {
      this.pesgval = System.currentPageReference().getParameters().get('vesg');
      System.debug('this.pesgval--->>>'+this.pesgval);
               if(pesgval==null || pesgval.length()==0){
                    PageReference secondPage1 = new PageReference('/apex/editLeadError');
                        secondPage1.setRedirect(true);
                  return secondPage1; 
                  
                 } else{//do something else, but the execution never comes here as the value of pesgval is always NULL}          
            return null;      
                }

 
The system.debug in the controller for this.pesgval always return null and the value is not fetched from the VF page.

All that I am struggling to achieve here is:
1. Creating a parameter (not query string) in the VF page
2. Assigning a value to it within javascript on pageload
3. Retrieving the parameter value from the controller
 
Appreciate if anyone can give their feedbacks on this or send some sample code for the same.
Thanks and regards,
Rasu
  • August 28, 2008
  • Like
  • 0
Hi,
 
I am trying to deploy a set of Apex Classes and triggers from sandbox to production. Although the apex classes and triggers have >85% test coverage each, when I try to deploy them together using ant , it throws the following exception:
Code:
*** Ending Workflow Evaluation*** Beginning Test 1: AccountScheduler.static testMethod void testAccountScheduler()
System.QueryException: List has no rows for assignment to SObject

Class.AccountScheduler.getLocation: line 84, column 25
Class.AccountScheduler.createNew: line 700, column 19
Trigger.TgrAssignmentDupCheck: line 22, column 24

20080805070410.845:Class.AccountScheduler.testAccountScheduler: line 1113, column 5: Insert failed. First exception on row 0; 
first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TgrAssignmentDupCheck: execution of BeforeInsert

caused by: System.QueryException: List has no rows for assignment to SObject

Class.AccountScheduler.getLocation: line 84, column 25
Class.AccountScheduler.createNew: line 700, column 19
Trigger.TgrAssignmentDupCheck: line 22, column 24
System.Exception: Assertion Failed

Class.AccountScheduler.testAccountScheduler: line 1114, column 5

*** Ending Test AccountScheduler.static testMethod void testAccountScheduler()


Two of the apex triggers has a dependency on two of the apex classes as it invokes a method from those two classes.

I have successfully deployed the apex classes to production, but I need help to figure out how I can deploy the triggers to production which currently throws the abovesaid error.

Appreciate all your feedback on this.

Thanks and regards,Rasu

  • August 05, 2008
  • Like
  • 0
Hi,
 

We have created a time based workflow (to trigger say 2 days before scheduled date, a custom datetime field). After activating this workflow,  we are not able to convert leads to accounts and the system throws the following error message in the convert lead page:

Error: Unable to convert lead that is in use by workflow"

Is there a way to fix this issue as we need to convert the leads even if the workflow has not been triggerd for a particular lead.

Appreciate all your response.

Thanks

Hi,
 
Is there a way to capture the windows login "username" into salesforce.com when user logs in to salesforce?
 
Any feedback is greatly appreciated.
 
Regards
Rasu
Hi,
 
Say Windows returns a Pop-up box with Customer Identifier.
Can we have SalesForce.com do a search on the Customer Identifier automatically?
Our marketing partner uses a dialer to make calls. Leads are fed into this box which makes calls, screening out bad number/faxes etc. before connecting LIVE calls to the Customer Service Rep.
Their existing Customer Information System (CIS) would pop up with the correct customer information on the screen.
Can we do this with SalesForce?
The dailer is AVAYA.
 
Appreciate if anyone could provide some feedback on this.
 
Thanks
Hi everyone!
I have a problem with the challenge, my App work fine but I don´t pass the challenge. This is my code:

campingList.cmp:
 
<aura:component controller="CampingListController">
    
    <ltng:require styles="/resource/SLDS105/assets/styles/salesforce-lightning-design-system-ltng.css"/>

	<aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    
     <aura:attribute name="newItem" type="Camping_Item__c"
     default="{ 'sobjectType': 'Camping_Item__c',
                    'Price__c': 0,
                    'Quantity__c': 0}"/>
    
    <div class="slds-card slds-p-top--medium">
    <ui:inputText aura:id="campname" label="Camping Name"
        value="{!v.newItem.Name}" required="true"/>
    <ui:inputCheckbox aura:id="packed" label="Packed?"
        value="{!v.newItem.Packed__c}"/>
     <ui:inputCurrency aura:id="price" label="Price"
        value="{!v.newItem.Price__c}" required="true"/>
     <ui:inputNumber aura:id="quantity" label="Quantity"
        value="{!v.newItem.Quantity__c}" required="true"/>
    
    <ui:button label="Create Camping" press="{!c.clickCreateCamping}"/>
    </div>
    
    <aura:attribute name="items" type="Camping_Item__c[]"/>	 
    <div class="slds-card slds-p-top--medium">
        <header class="slds-card__header">
            <h3 class="slds-text-heading--small">Campings</h3>
        </header>
        <section class="slds-card__body">
            <div id="list" class="row">
                <aura:iteration items="{!v.items}" var="item">
                    <c:campingListItem item="{!item}"/>
                </aura:iteration>
            </div>
        </section>
    </div>
</aura:component>

campingListController.js:
 
({
    
    // Load expenses from Salesforce
	doInit: function(component, event, helper) {

    // Create the action
    var action = component.get("c.getItems");

    // Add callback behavior for when response is received
    action.setCallback(this, function(response) {
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            component.set("v.items", response.getReturnValue());
        }
        else {
            console.log("Failed with state: " + state);
        }
    });

    // Send action off to be executed
    $A.enqueueAction(action);
	},
    
    clickCreateCamping: function(component, event, helper) {
        
        if(helper.validateCampingForm(component)){
	        // Create the new expense
	        var newCamping = component.get("v.newItem");
	        helper.createItem(component, newCamping);
	    }
    }
})
campingListHelper.js
 
({
    
    createItem: function(component, camping) {
        
        var action = component.get("c.saveItem");
        action.setParams({
            "item": camping
        });
    	action.setCallback(this, function(response){
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            var campings = component.get("v.items");
            campings.push(response.getReturnValue());
            component.set("v.items", campings);
        }
    	});
    	$A.enqueueAction(action);
    },
    
    validateCampingForm: function(component) {
      
     	var validQuantity = true;
        var validPrice = true;

        var nameField = component.find("campname");
        var campname = nameField.get("v.value");
        
        var quantityField = component.find("quantity");
        var quantity = quantityField.get("v.value");
        
        var priceField = component.find("price");
        var price = priceField.get("v.value");
        
        if ($A.util.isEmpty(campname) || $A.util.isEmpty(quantity) || $A.util.isEmpty(price)){
            validQuantity = false;
            validPrice = false;
            nameField.set("v.errors", [{message:"Camping name, quantity or price can't be blank."}]);
        }
        else {
            nameField.set("v.errors", null);
        }
		
		return(validQuantity && validPrice);        
	}
})
CampingListController.apxc:
 
public with sharing class CampingListController {

    @AuraEnabled
    public static List<Camping_Item__c> getItems() {
    
        // Check to make sure all fields are accessible to this user
        String[] fieldsToCheck = new String[] {
            'Id', 'Name', 'Packed__c', 'Price__c', 'Quantity__c'
        };
        
        Map<String,Schema.SObjectField> fieldDescribeTokens = 
            Schema.SObjectType.Camping_Item__c.fields.getMap();
        
        for(String field : fieldsToCheck) {
            if( ! fieldDescribeTokens.get(field).getDescribe().isAccessible()) {
                throw new System.NoAccessException();
                return null;
            }
        }        
        
        // Perform isAccessible() checking first, then
        return [SELECT Id, Name, Packed__c, Price__c, Quantity__c 
                FROM Camping_Item__c];
    }
    
    @AuraEnabled
    public static Camping_Item__c saveItem(Camping_Item__c item) {
        // Perform isUpdatable() checking first, then
        upsert item;
        return item;
    }
}
I am still getting this error:

Challenge Not yet complete... here's what's wrong:
The campingList JavaScript helper isn't saving the new record to the database or adding it to the 'items' value provider.


My App save the new record into the database and add it to the "items" list.
Thanks for your answers!




 
Hi,
 
I have a custom button that executes a javascript code when clicked. It works fine for all user profiles in production, but does not work in sandbox and throws the following error message:
 
[object Error]-sforce.apex is null or not an object
It works in sanbox only for administrator profile.

Appreciate is anyone can help identify the cause for this. This is my js code for the custom button:
 
Javascript Code for the custom button:
{!requireScript("/soap/ajax/11.1/connection.js")}
try{
var userid = '{!User.Id}';
var username='{!User.Name}'; 
var userEmail='{!User.Email}'; 
var apprId='{!Fixture_Order__c.Approver_Name__c}';
var fixOrder='{!Fixture_Order__c.Id }'; 
var vtoemailid='BHN.fixtures@bhnetwork.com';


var args = {puser:userid,pusername:username,puseremail:userEmail,pfixorderno:fixOrder,papprId:apprId,pemailtype:2,ptoEmailid:vtoemailid,pisruntest:false}; 
var result = sforce.apex.execute('HandlerFOSendEmail' , 'sendMail', args);

if(vCardKitsNeeded==1){
var args = {puser:userid,pusername:username,puseremail:userEmail,pfixorderno:fixOrder,papprId:apprId,pemailtype:3,ptoEmailid:vtoemailid,pisruntest:false}; 
var result = sforce.apex.execute('HandlerFOSendEmail' , 'sendMail', args);
}

if(vMerchReq==1){
var args = {puser:userid,pusername:username,puseremail:userEmail,pfixorderno:fixOrder,papprId:apprId,pemailtype:4,ptoEmailid:vtoemailid,pisruntest:false}; 
var result = sforce.apex.execute('HandlerFOSendEmail' , 'sendMail', args);
}

alert("The fixture order has been sent to BHN Fixtures.");

}catch(e)
 {
  alert("Send Email has failed. Please contact your system administrator with this screeshot or error message: "+e + "-" + e.message);
 }

 
  • September 04, 2008
  • Like
  • 0
Hi
I am trying to override the edit page for "Log a Call" or task with a custom visualforce page. I am having trouble getting some of the fields like
Assigned To,
Related To and
the checkbox "Send Notification Email".
I was able to add other fields uisng the API names.
 
Appreciate if anyone can help with the right way to adding the above fields in VF page.

When I add the following for the Assigned To, it throws the error "Assigned To ID: owner cannot be blank". Basiaclly I want to display the Assigned To field as it appears in the standard Log a Call edit page. Is there some reference available somewhere for converting all these fields in the standard page into a VF page?
 
VF Code:
<apex:page standardController="Task" extensions="conTaskNew">
<apex:form >
       <apex:pageBlock id="mypageblock" title="Task Edit" mode="new">       
     
            <apex:pageBlockButtons >                    
            <apex:commandButton onclick="return lsave()"   action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Task Information" columns="2" id="theSection">  
           <apex:inputField id="vOwner" value="{!task.OwnerId}"/>             
            <apex:inputField id="vActDate" value="{!task.ActivityDate}"/>     
            <apex:inputField id="vsubject" value="{!task.Subject}"/>                
     </apex:pageBlockSection>               
</apex:pageBlock>
</apex:form>
</apex:page>

 Appreciate all your valuable feedbacks.
  • September 04, 2008
  • Like
  • 0
Hi,
 
I have a very basic question in Visualforce. I need to have a parameter in the VF page, assign a value to it using javascript and then retrieve the parameter values from the controller.
 This is my part VF code:
 
Code:
<apex:page controller="conLeadTab" action="{!validate}">
<apex:pageBlock id="mypageblock" mode="new">
                 <apex:param id="vesg"   name="vesg" value=""/>
     </apex:pageBlock>
<script language="javascript">
var vesgval = 'SOme value';
//The line below does not work, but here I need to assign the value of vesgval to the parameter vesg
//{!$CurrentPage.parameters.vesg}=vesgval;
</script>  
</apex:page> 

 

   
//My controller method 
 
Code:
  public PageReference validate() {
      this.pesgval = System.currentPageReference().getParameters().get('vesg');
      System.debug('this.pesgval--->>>'+this.pesgval);
               if(pesgval==null || pesgval.length()==0){
                    PageReference secondPage1 = new PageReference('/apex/editLeadError');
                        secondPage1.setRedirect(true);
                  return secondPage1; 
                  
                 } else{//do something else, but the execution never comes here as the value of pesgval is always NULL}          
            return null;      
                }

 
The system.debug in the controller for this.pesgval always return null and the value is not fetched from the VF page.

All that I am struggling to achieve here is:
1. Creating a parameter (not query string) in the VF page
2. Assigning a value to it within javascript on pageload
3. Retrieving the parameter value from the controller
 
Appreciate if anyone can give their feedbacks on this or send some sample code for the same.
Thanks and regards,
Rasu
  • August 28, 2008
  • Like
  • 0
Hello everyone, just wanted to share with the community this custom component I made and give something back for the help I've received. :smileyhappy:

The purpose of the component is to enable autocomplete in lookup fields. I used the autocomplete js created by Jim Roos:
(http://www.jimroos.com/2007/05/ajax-autocomplete.html) but made some modifications to it so that it could interact with an Apex controller among some other things...

So my idea was that if you were making a VF page that had an inputfield that was related to a lookupfield you would just insert this autocomplete component to that inputfield. Something like this:

Code:
           <apex:inputField value="{!Contact.accountid}" id="accname" styleClass="cField">
<c:autocomplete ObjectName="Accounts" InputId="{!$Component.accname}" AutoCompleteId="accACid" ClassName="autocomplete300"/>
</apex:inputField>

The component has 4 parameters:

The name of the object or custom object that the inputfield relates to (new objects must be added inside the apex classes since i had some problems constructing a dynamic query).
The InputId which is used to relate the component to the input field
The id for the Component
A classname parameter that basically just defines the width of the suggestions menu.

Here's a screenshot of how it looks like in action:




Here's a link to the file containing the required files:

AutoCompleteComponent



Jonathan.


Message Edited by jonathan rico on 08-16-2008 01:55 PM

Message Edited by jonathan rico on 08-17-2008 09:04 AM
Message Edited by jonathan rico on 01-02-2010 05:01 PM
Hi,
 
I am trying to deploy a set of Apex Classes and triggers from sandbox to production. Although the apex classes and triggers have >85% test coverage each, when I try to deploy them together using ant , it throws the following exception:
Code:
*** Ending Workflow Evaluation*** Beginning Test 1: AccountScheduler.static testMethod void testAccountScheduler()
System.QueryException: List has no rows for assignment to SObject

Class.AccountScheduler.getLocation: line 84, column 25
Class.AccountScheduler.createNew: line 700, column 19
Trigger.TgrAssignmentDupCheck: line 22, column 24

20080805070410.845:Class.AccountScheduler.testAccountScheduler: line 1113, column 5: Insert failed. First exception on row 0; 
first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TgrAssignmentDupCheck: execution of BeforeInsert

caused by: System.QueryException: List has no rows for assignment to SObject

Class.AccountScheduler.getLocation: line 84, column 25
Class.AccountScheduler.createNew: line 700, column 19
Trigger.TgrAssignmentDupCheck: line 22, column 24
System.Exception: Assertion Failed

Class.AccountScheduler.testAccountScheduler: line 1114, column 5

*** Ending Test AccountScheduler.static testMethod void testAccountScheduler()


Two of the apex triggers has a dependency on two of the apex classes as it invokes a method from those two classes.

I have successfully deployed the apex classes to production, but I need help to figure out how I can deploy the triggers to production which currently throws the abovesaid error.

Appreciate all your feedback on this.

Thanks and regards,Rasu

  • August 05, 2008
  • Like
  • 0
Hi,
 
Is there a way to capture the windows login "username" into salesforce.com when user logs in to salesforce?
 
Any feedback is greatly appreciated.
 
Regards
Rasu
Hi, I need to over write the Contact Home page because I don't want some profiles can see the Report and Tools sections. I have created my own Visual Force page but I would like now to over write the Contact home page just for those profiles.

So, Can we over write the client account tab, so that sys admin’s see the standard page, other users see the visualforce page? If so how?

Any help?

Thanks!
Hi,
 
Say Windows returns a Pop-up box with Customer Identifier.
Can we have SalesForce.com do a search on the Customer Identifier automatically?
Our marketing partner uses a dialer to make calls. Leads are fed into this box which makes calls, screening out bad number/faxes etc. before connecting LIVE calls to the Customer Service Rep.
Their existing Customer Information System (CIS) would pop up with the correct customer information on the screen.
Can we do this with SalesForce?
The dailer is AVAYA.
 
Appreciate if anyone could provide some feedback on this.
 
Thanks