• APat
  • NEWBIE
  • -1 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 18
    Replies

Hi,

 

We have customized the Quote PDF preview button. So basically, I have added a new Button to my Quote preview window. I call it as "Call Test Function". On click of this button, I call my java script function. However when i click the button, I get an java script error which says "Object Expected"... Not sure what that means...

 

Can someone please advice how to proceed ahead.

 

 The code is given below.

 

javascript: var pdfOverlay = QuotePDFPreview.quotePDFObjs['quotePDFOverlay'];

 

function test(){
alert('hello');
}

 

pdfOverlay.dialog.buttonContents =

'<input value=\"Save to Quote\"  class=\"btn\" name=\"save\"
onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'0\',\'0\');\"
title=\"Save to Quote\" type=\"button\" />

<input value=\"Save and Email\"  class=\"btn\" name=\"saveAndEmail\"
onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'1\');\"
title=\"Save and Email Quote\" type=\"button\" />

<input value=\"Cancel\"  class=\"btn\" name=\"cancel\"
onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').close();\"
title=\"Cancel\" type=\"button\" />

<input value=\"Call TEST function\"  class=\"btn\" name=\"cancel\"
onclick=\"test();\"
title=\"CallTest\" type=\"button\" />';

  • January 17, 2013
  • Like
  • 0

Hi All,

 

I'm trying to create an approval request via Apex code... Stuck with below mentioned error:

 

System.DmlException: Process failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, missing required field: []

Error is in expression '{!submitAndProcessApprovalRequest}' in component <apex:page> in page testapproval

     

 

   Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
        req1.setComments('Submitting Multiple request for approval.');
        req1.setObjectId('00Q9000000A4LXg');
        List<string> idList = new List<string>();
        idList.add('00590000000j0fM');
        idList.add('00590000000j0yU');

        req1.setNextApproverIds(idList);
        Approval.ProcessResult result = Approval.process(req1);

 

Need Help..

 

Thanks

  • August 21, 2012
  • Like
  • 0

Hi,

 

Is there any documentation that can help us understand that how can one connect to force.com via Database.com SDK? I have gone through the SDK API page but they have not explained in details.

 

Request your help.

 

-APat

  • June 20, 2012
  • Like
  • 0
hi my batchclass test not working.
@isTest
private class TesttaskAssignBatch {
    static testmethod void test(){
           
            List<User> lstUser = new List<User>([SELECT Username,ContactId ,Email,profile.name from USER where profile.name = 'Custom Partner Community Login']);

            if(!lstUser.isEmpty())
            {
             tast t = new task();
   t.Subject  = 'Weekly Status Report & Meeting - '+date.today();
            t.Description = 'Test';
            t.OwnerId = lstUser[0].id;
            t.ActivityDate=date.today();
            t.priority = 'High';
            t.Type = 'Email';
            t.Status = 'In Progress';  
            t.WhoID = lstUser[0].ContactId ;
            Database.DMLOptions dmlOptions = new Database.DMLOptions();
            dmlOptions.EmailHeader.TriggerUserEmail = TRUE;
            Database.Insert(t,dmlOptions);
            insert t;          
            }  
   
        Test.startTest();
       
        Database.executeBatch(new taskAssignBatch(), 1);

        Test.stopTest();      
    }
}
 this code not working ?
Hello 
can we controll the execution of a trigger, If we create two triggers on the same object
Is there any way to control the execution order
Hi All , 

I am hoping you can help me.

Requirements; 
Once the Obligiations is  complete, the ‘Complete Obligiation’ button should be clicked by the User and the following should happen:
  1. The "Obligation Next Due" field should never fall on a weekend or any date which is referenced in the "business hours"
  2. The "Obligation Next Due" field  should calculate the next "date value" based on the Frequency and
    Deadline Date 
  3. Update the ‘Obligation Last Completed on" with the data of the button execution. 


Object Name    Client_Obligations
API Name    Client_Obligations__c

field: frequency
api : Frequency__c
data type : picklist 
value : Monthly_BD

Business hours name : Client Obligations
id : https://emea.salesforce.com/01m200000000VjK

Expected out come : 

frequency : Monthly_BD
Deadline Date 9/16/2016 (12th business day of september)
User pushes the button "Complete Obligiation’ the "Obligation Next Due" should be "10/17/2016" (12th business day of october)

Really appreciate your help and advice 

Hello, 
 I am using Ellipse Neon. I was wondering if someone could help me to figure out where to find log file when deploying a project in production. I am getting a failure in deployment and not able to figure out why.
Hi, 


I'm having 15 boxes(Pick list) .I'm adding order line items into those 15 boxes... For ex: I'm selecting box 1 and adding values in supplied quantity field. and clicking on save.. when I select the box in other page values are not showing... but here in the previous page values are displaying. Please help me
<apex:selectList value="{!SelectedBox}" size="1">

                    <apex:selectOptions value="{!Boxoptions}"></apex:selectOptions>
                </apex:selectList>   


public bulkff(){
    Boxoptions=new list<SelectOption>();
    lineItemName=new set<String>();
       orderItemsList=new list<Order_Line_Items__c>();
       OrderLineItems();
       String boxnm='';
        Boxoptions.add(new SelectOption('--None--', '--None--'));
        for(integer i=1;i<=15;i++)
        {
            boxnm = 'Box '+i;
            Boxoptions.add(new SelectOption(boxnm, boxnm));
        }
       }
     public void OrderLineItems(){
      Set<id> oid = new Set<id>();
        List < Order_Line_Items__c > listOfItems = new List < Order_Line_Items__c > ();
        order = [SELECT name, Total_supplied_quantity__c, Location__c, From_Date__c, To_Date__c, id, Status__c, Submitted_On__c, SystemModstamp, Total_Quantity__c, Total_Units__c FROM Orders__c Where Id = : ApexPages.currentPage().getParameters().get('id') ];
        for(Orders__c o : order)
        {
            oid.add(o.id);
        }
      
      orderItemsList = [Select Id, Name, Difference__c, Order__c, Quantity__c, Select_Box__c, Supplied_Quantity__c, Type__c from Order_Line_Items__c where Order__c=:Apexpages.currentpage().getParameters().get('id')];
       
        
        for(Order_Line_Items__c old : orderItemsList)
        {
            
             //   selectedbox.add(orderItemsList);
                     
             
        }
}





Unable to add orderitems list into selected box

 
Hi Everyone,

I am new in salesforce development and I want to create a trigger on Task, when I create a task and Choose an Account, after choose an Account and now I choose a Contact then Contact lookup only display  contacts in lookup window that are related to that particular account rather than all contacts related to all accounts.

I need your help, please suggest me.

thanks,
Ghulam

 
Why I got zero result in other account when I'm accessing other's connected app? I'm using SOQL with the host user account and I get the right result but when I use other account I succeeded in authentication with the right clientId and right clientsecret but when I do SOQL I got this 

{
    "done": true,
    "records": [],
    "totalSize": 0
}

When I'm using the HOST account which is the creator of the connected app I get the right result. Also, I put the "FULL ACCESS" when authentication is success and yet no result.

Can somebody help me? I use two developer's edition account.

 
I am trying to connect to a sandbox REST webservice from a Java application. Howevere I am getting "An internal server error has occurred".

Have used the TokenUrl :: https://vha--devops.cs81.my.salesforce.com/services/oauth2/token

Below is the complete error message ;

<html>
<head><title>An internal server error has occurred</title></head>
<body>
<div style="display:none;" id="errorTitle">An internal server error has occurred</div>
<div style="display:none;" id="errorDesc">An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact <a href="https://help.salesforce.com/apex/hthome">Salesforce Support</a>. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. <br/><br/>Thank you again for your patience and assistance. And thanks for using salesforce.com!</div>
<table cellspacing=10>
<tr><td><span style="font-weight: bold; font-size: 12pt;">An internal server error has occurred</span></td></tr>
<tr><td>
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact <a href="https://help.salesforce.com/apex/hthome">Salesforce Support</a>. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. <br/><br/>Thank you again for your patience and assistance. And thanks for using salesforce.com!
<br><br>
Error ID: 752922053-131984 (925905458)
</td>
</tr>
<tr><td>
<br clear="all"><br><br></td></tr>
</table></td></tr></table></body></html>
when i provide the ip address and hit the button i am getting this response 
ip:: 8.8.8.8, country_code:: US, country_name:: United States, region_code:: CA, region_name:: California, city:: Mountain View, zip_code:: 94040, time_zone:: America/Los_Angeles, latitude:: 37.386, longitude:: -122.084, metro_code:: 807
how to deserialize and move it into an object 
  • March 11, 2015
  • Like
  • 0


APEX CLASS:

public class sendEmailobject {

    public sendEmailobject(ApexPages.StandardController controller) {

    }

    public String subject { get; set; }
    public String body { get; set; }

    private final Account account;

    // Create a constructor that populates the Account object
    public sendEmailobject () {
        
    }

    public Account getAccount() {
        return account;
    }

    public PageReference send() {
        // Define the email
   Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 

// Reference the attachment page and pass in the account ID
PageReference pdf =  Page.attachmentPDF;
pdf.getParameters().put('id','0019000000GFM34'); 
pdf.setRedirect(true);

// Take the PDF content
Blob b = pdf.getContent();

// Create the email attachment
Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
efa.setFileName('attachment.pdf');
efa.setBody(b);



list<string> toAddresses = new list<string>();
toAddresses.add('mpriyajose10@gmail.com');
  

// Sets the paramaters of the email
email.setSubject( 'Hi');
email.setToAddresses( toAddresses );
email.setPlainTextBody( 'Hi');

email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});

// Sends the email
Messaging.SendEmailResult [] r = 
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});  
return null; 
    }
}

BUTTON ONCLICK JS:


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

var retStr; 
retStr = sforce.apex.execute("sendEmailobject","send{}); 

alert('The method returned: ' + retStr); 

document.location = '/{!Account.Id}';

But it showing error ..please help me

Hi,


I am trying to create a url in my class
it gets created corectly and i am able to see it in debug log
but when i pass it to the pagereference it does not redirect correctly. and it strips the parameters out of the url
this is in my sandbox (Full). Please help.

it should redirect to
/merge/accmergewizard.jsp?goNext=+Next+&cid=001b000000Fva5qAAB&cid=001b000000RvToJAAV&cid=001g000000RUAhaAAH


but it redirects to
/merge/accmergewizard.jsp?cid=001b000000Fva5qAAB&goNext=+Next+

please let me know why this is happening and steps to resolve it

thank you so much

Sumit
I am working on writing apex sharing anonymous code,
for(Account abc: [select Owner, CreatedBy, LastModifiedBy from account where CALENDAR_YEAR(createddate) = 2014]

How to assign UserOrGroupId with Owner, CreatedBy, LastModifiedBy for one account record. Pls suggest.

 

I know there is an option to specify whether the approval step "Requires UNANIMOUS

approval from all selected approvers" or "Approve or reject based on the FIRST response" for the "Automatically assignApprovers" option when multiple approvers are selected.

 

I have couple of questions.  Why are these options not available for the "Let the submitter choose the approver manually" and "Automatically assign to queue", becuase both are supporting multiple approvers?

 

The scenario is I want the user to choose a sub-set of users from a Queue while submitting for approval and also specify whetherapproval requires approval from all or any user in the subset.

 

Is this possible programmatically (via Salesforce API)?