• shashi kanaparthi
  • NEWBIE
  • 35 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 5
    Replies
Hi,

The below query is returning zero records when i log in as partner community user. This query is being execute from a helper class which is being called from a trigger. The helper class and trigger are running in system mode.

Query below:
NameSet='Developer Test'
List<User> userList = new List<User>();
        userList = [Select Id, name from User where name in :nameSet]
system.debug('### SOQL Query is ####'+''+ [Select Id, name from User where name in :nameSet]);
when i use debug log for the user, the above soql query is not even being printed in the debuglog

Let me know what the issue could be.
       
Hi, 

Getting the below error notification from wave when the data flow runs:

Found a Derived Dimension which has the same field name as a non-derived Dimension: CallDisc.Nephrologix_Subtopic__c

Below is the JSON which is being used:
{
   "dataset": {},
   "dates": [
      {
         "alias": "Date",
         "fields": {
            "day": "Call_Date_vod__c_Day",
            "epochDay": "Call_Date_vod__c_day_epoch",
            "epochSecond": "Call_Date_vod__c_sec_epoch",
            "fullField": "Call_Date_vod__c",
            "hour": "Call_Date_vod__c_Hour",
            "minute": "Call_Date_vod__c_Minute",
            "month": "Call_Date_vod__c_Month",
            "quarter": "Call_Date_vod__c_Quarter",
            "second": "Call_Date_vod__c_Second",
            "week": "Call_Date_vod__c_Week",
            "year": "Call_Date_vod__c_Year"
         },
         "firstDayOfWeek": -1,
         "fiscalMonthOffset": 0,
         "isYearEndFiscalYear": true,
         "label": "Date",
         "showInExplorer": true
      }
   ],
   "derivedDimensions": [
      {
         "customActions": [],
         "customActionsEnabled": true,
         "field": "CallDisc.Nephrologix_Subtopic__c",
         "isMultiValue": false,
         "label": "Nephrologix Subtopic",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true,
         "showInExplorer": false
      },
      {
         "customActions": [],
         "customActionsEnabled": true,
         "field": "ca",
         "isMultiValue": false,
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true,
         "showInExplorer": false
      }
   ],
   "derivedMeasures": [],
   "dimensions": [
      {
         "customActions": [],
         "field": "CallOwner.Name",
         "label": "CallOwner.Name",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "CallOwner.Profile_Name_vod__c",
         "label": "CallOwner.Profile_Name_vod__c",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.Type",
         "label": "Account.Type",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.Physician_Group_fmcna__c",
         "label": "Account.Physician_Group_fmcna__c",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Call_Date_vod__c_Second",
         "label": "Call_Date_vod__c_Second",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Opportunity_fmcna__c",
         "label": "Opportunity",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Completion_fmcna__c",
         "label": "% Completion",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Status_vod__c",
         "label": "Status",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.NPI_vod__c",
         "label": "Account.NPI_vod__c",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Owner_Name_fmcna__c",
         "label": "Owner Name",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.HPSM_Owner__c",
         "label": "Account.HPSM_Owner__c",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Name",
         "label": "Call Name",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.DMD_Owner__c",
         "label": "Account.DMD_Owner__c",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.Id",
         "label": "Account.Id",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "OwnerId",
         "label": "Owner ID",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.Primary_Address_State_fmcna__c",
         "label": "Account.Primary_Address_State_fmcna__c",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.Status_fmcna__c",
         "label": "Account.Status_fmcna__c",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.AcctAffil.To_Account_vod__c",
         "label": "Account.AcctAffil.To_Account_vod__c",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.AcctAffil.To_Account_Name_vod__c",
         "label": "Account.AcctAffil.To_Account_Name_vod__c",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.AcctRecType.Name",
         "label": "Account.AcctRecType.Name",
         "linkTemplateEnabled": true,
         "members": [
            {
               "label": "Hospital",
               "member": "Hospital_vod"
            },
            {
               "label": "Phys Group",
               "member": "Practice_vod"
            }
         ],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Call_Date_vod__c_Hour",
         "label": "Call_Date_vod__c_Hour",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account_vod__c",
         "label": "Account",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "CallOwner.Title",
         "label": "CallOwner.Title",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Director_of_Call_Owner__c",
         "label": "Director of Call Owner",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "VP_of_Call_Owner__c",
         "label": "VP of Call Owner",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Call_Date_vod__c_Day",
         "label": "Call_Date_vod__c_Day",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.Specialty_1_vod__c",
         "label": "Account.Specialty_1_vod__c",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Call_Date_vod__c_Week",
         "label": "Call_Date_vod__c_Week",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "isAdmin",
         "label": "isAdmin",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.VP_Owner__c",
         "label": "Account.VP_Owner__c",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "CallDisc.Discussion_Topics__c",
         "label": "Discussion Topics",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Call_Date_vod__c_Year",
         "label": "Call_Date_vod__c_Year",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.Name",
         "label": "Account.Name",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Call_Date_vod__c_Quarter",
         "label": "Call_Date_vod__c_Quarter",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Call_Date_vod__c_Minute",
         "label": "Call_Date_vod__c_Minute",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Id",
         "label": "Record ID",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Account.Credentials_vod__c",
         "label": "Account.Credentials_vod__c",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Call_Date_vod__c",
         "label": "Call_Date_vod__c",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      },
      {
         "customActions": [],
         "field": "Call_Date_vod__c_Month",
         "label": "Call_Date_vod__c_Month",
         "linkTemplateEnabled": true,
         "members": [],
         "recordDisplayFields": [],
         "salesforceActions": [],
         "salesforceActionsEnabled": true
      }
   ],
   
   "organizations": [],
   "showDetailsDefaultFields": []
}
Hi,

I am trying to use JQuery date picker in visualforce page. The JQuery date picker is not overwriting the standard salesforce style for apex:input field. Code below:

<apex:page id="thePage" standardController="Interaction__c">
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" target="_blank" rel="nofollow"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css</a>" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" target="_blank" rel="nofollow">
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js</a>"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" target="_blank" rel="nofollow">
  <script src="<a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js</a>"></script>  
  
   <script>
    jQuery(function(){
            var $j = jQuery.noConflict();
            $j("input[id$=datepicker]").datepicker({
               changeYear: true,
               changeMonth: true,
               dateFormat: "mm/dd/yy"
            });
          });
</script>
</head> 
  <apex:form >
  <apex:pageBlock >

  <apex:pageblockSection >
  <apex:inputfield value="{!Interaction__c.Call_Date__c}" id="datepicker"/>
  <apex:pageBlockSectionItem />
  </apex:pageblockSection>
  </apex:pageBlock>

  
  </apex:form>

</apex:page>

Let me know if some thing else needs to be done.
Hi,

I have time dependent workflow on the opportunity which should send an email 30 days before the opportunity close date. But the email alert is being sent when ever an opportunity is created with a close date of next week. Let me  know what the issue could be. Below are screenshots of the time dependent workflow:-

I am using the below trigger condition, 

30 Days before opportunity close date.

Let me know what the issue could be.
Hi,

I have a command button "Export To Excel" on the edit screen. This button when clicked should export the data to excel. For this purpose i created another visualforce page to which the user is redirected after the button is clicked. But when the button is clicked, the user is not redirected to another page and the data is not being downloaded in the excel format. Both the VF Pages share the same controller.


Below is the method for the button and the vf page.

 public PageReference ExportToExcel(){
   
       PageReference exdownload=new PageReference('apex/ExportAsExcel');
        exdownload = Page.ExportAsExcel;
        OpportunityData();
        exdownload.setRedirect(true);
        return exdownload;
       
   
   }


<apex:page controller="ManageListController" id="page" showHeader="false" Sidebar="false" cache="true" expires="1200" contentType="application/vnd.ms-excel#Candidate.xls" > <!-- Schema added to add autofilter for header row in Excel sheet --> <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"> <head></head> <body > <apex:pageBlock id="results" > <!-- HTML Table used to display Candidate Data in Excel Sheet with Grid Lines --> <table border="1" cellpadding="1" cellspacing="0" style="width:100%;border:1px solid #000000;font-familyans-serif;font-size:10px"> <tr style="font-family:verdana;color:Black;font-size:12px;height=18px;width:100%" > <!-- Autofilter added for header row in Excel sheet --> <td x:autofilter='all' style="background-color: #DAFFFF" ><b> <apex:outputText value="Id" /></b> </td> <td x:autofilter='all' style="background-color: #DAFFFF" ><b><apex:outputText value="Name"/></b> </td> </tr> <apex:repeat value="{!OppList}" var="opp"> <tr border="1" style="font-family:verdana;color:Black;font-size:12px;width:100%" > <td ><apex:outputText value="{!opp.Id}"/></td> <td><apex:outputText value="{!opp.Name}"/></td> </tr> </apex:repeat> </table> <br/> <br/> <br/> <br/> <br/> <apex:outputtext > Confidential Information - Do Not Distribute</apex:outputtext> <br/> <apex:outputtext >Generated By: {!$User.FirstName} {!$User.LastName} {!Now()} </apex:outputtext> <br/> <apex:outputtext value="Your Company" /> </apex:pageBlock> </body > </html> </apex:page>
Hi,

I am working on a requirement where once the user clicks on  a button, it opens up a form known as "ISR Form". When the form opens up, the form should show previously entered input values, i am able to achieve this. But when the user changes the input value in "Number of Drug Libraries", then the value is not being updated in the database. Below is the code for the VF Page and the controller class. Let me know what the issue could be?


VF Page Code:

<apex:page standardController="ISR__c" extensions="ISRFormController" sidebar="false" language="en-US" >
    <Apex:form onreset="false">
    <apex:pageBlock mode="edit" title="ISR Edit" id="pb">
     <apex:pageBlockButtons >
    <apex:commandButton value="Save" action="{!Save}"/>
    <apex:commandButton value="Export To Excel"/>
    <apex:commandButton value="Cancel" action="{!Cancel}"/>
    </apex:pageBlockButtons>
    <apex:pageBlockSection title="General Information" columns="2" >
    <apex:repeat var="opp" value="{!opplst}" >
    <apex:pageBlockSectionitem >
         <apex:outputText value="Implementation Type "/> 
         <apex:outputText value="{!opp.Implementation_Type__c}" style="background-color:#F4F6F6;"/> 
     </apex:pageBlockSectionitem>
      <apex:pageBlockSectionitem >
         <apex:outputText value="Contract Signed "/> 
         <apex:outputField value="{!opp.Contract_Signed__c}" style="background-color:#F4F6F6;"/> 
     </apex:pageBlockSectionitem>
         <apex:inputText value="{!ISR.Number_of_Drug_Libraries__c}"/> 
      <apex:inputfield value="{!ISR.Integration_Partner__c}"/>
</apex:form>



Controller Class:-

public class ISRFormController {
public Opportunity opp{get;set;}

public ISRFormController(ApexPages.StandardController controller) {
  
    ISRSales = new ISR_Sales_Team__c ();
    opporid= ApexPages.currentPage().getParameters().get('oppid');
    Accid=ApexPages.currentPage().getParameters().get('accountid');
    ISRId=ApexPages.currentPage().getParameters().get('ISRId');
}

 public ISR__c ISR{
                get{
                    if(ISRId!=null)
                    //ISR=new ISR__c();
                    ISR=[Select Id,Number_of_Drug_Libraries__c,Integration_Partner__c,Other__c,Comments__c,Address__c,Nearest_Airport__c,Nearest_Hotel_Area__c,
                        Amount_of_Integrated_Implementation_Fees__c,Does_contract_include_Data_Analytics_Ser__c,customer_ACA_language_contract__c,
                        Vendor_Credentialing__c,customer_using_Third_Party_Financ__c,contract_signed_for_third__c,Customer_USing_UHS__c,
                        If_yes_have_the_devices_been_ordered__c,Rental_Program__c,Did_the_customer_participate_in_a_MedNet__c,
                        If_yes_please_indicate_device_type__c,If_Yes_please_indicate_MM_YYYY__c,
                        Other_Comments__c,Form_Completed_by__c,Date__c,Implementation_Model__c,Project_Manager__c,Hospira_Pharmacy_Consultant__c,
                        RNE_Regional_Nurse_Executive__c,CC_Designated_Lead__c,Email_Received_from_DM_Date__c,Project_Back_to_Sales_Date__c,
                        Data_Entered_In_By_Virtual_Server_IT_Tea__c,Customer_Log_in__c,Customer_Password__c,Data_Entered_In_By_Portal_Admin_Team__c,
                        ACA_Service_Login__c,ACA_Service_Password__c,Target_Go_Live_Date__c
                           from ISR__c where Id=:ISRId];
                    return ISR;
                   }
                set;}

public PageReference Save(){
           if(ISRId==null){
           insert ISR;
           }

        if(ISRId!=null){
       update ISR;
}



}

 
Hi,

I have a form which opens up on click of a custom button "Generate Service" on opportunity. After the form is Saved, the user is redirected to the opportunity detail page. When the Button "Generate Service" is clicked again, I want the old form which was saved before to open up again instead of the brand new form. Let me know if this can be done.
  
Hi,

I am trying to render output panel based on multiple conditions. I am using the below syntax in the output panel, its not working. 

Let me know what the issue is.

       rendered ="IF{(!Qlist[0].Conversion_Status__C!='Sent' AND !Qlist[0].IsSyncing==true),true,false}">
Hi,

I am trying to display the web service response to the end user before page navigation. But its not working. I am retrieving the body in the public String xmlContent{get;set;} in the below class and in the VF Page i am refrencing int the outputtext:-

public class Quote_To_CW_Test {
    
    public List<Quote> Qlist{get;set;}
    
    public String xmlContent{get;set;}
    
    public Quote_To_CW_Test() {
    
        qid=[Select Id from Quote where Id=:ApexPages.currentPage().getParameters().get('quoteId')].id;
        
        Qlist=[Select Conversion_Status__c,Id,IsSyncing from Quote where Id=:ApexPages.currentPage().getParameters().get('quoteId')];

system.debug('////////////' +Qlist[0].Conversion_status__c);
    }
    
 private final Quote q;string qid;
          
public PageReference invokeMule(){
    

/*redirect user to another page*/


/*logic for web service call out here*/
if(Qlist[0].Conversion_Status__c!='Sent'){

String url;

url='https://xxxxxx:10000/QuoteToCW/' + Qlist[0].Id;

HttpRequest req = new HttpRequest();
Http http = new Http();
req.setMethod('GET');
req.setEndpoint(url);

//req.setHeader('Content-Type', 'application/x-www-form-urlencoded');  


// create the response object
HTTPResponse resp;

 resp = http.send(req);

 /*catch(System.CalloutException e) {
        System.debug('Callout error: '+ e);
        System.debug('**************' +resp.toString());
    }*/
 
String xmlContent=String.valueOf(resp.getBody());

System.debug('////////' +resp.getBody());


System.debug('+++++++++ XMLContent is'+ xmlContent);


system.debug('The request end point is ++++' + url);
 
req.setEndpoint(url);

}

  //disabl = true;

PageReference qPage= new PageReference('/' +qid);


apexpages.Message msg = new Apexpages.Message(ApexPages.Severity.Info,'Status of the response ' + xmlContent);
        apexpages.addmessage(msg);
        
        
        
    
return qPage;

}


/* Cancel to return to the previous page*/

public PageReference Cancel() {
    
PageReference qPage = new PageReference('/' +qid);
        
return qPage;
   
    }
}




VF Page:-

<apex:page controller="Quote_To_CW_Test" sidebar="false" id="page">

<apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
 
  

<apex:form id="form">

<apex:outputText value="{!xmlContent}" />
  
  <apex:pageBlock id="pageblock">
  
    <style>
            body .bPageBlock .pbBody .red .pbSubheader{
                background-color:#c00000;
            }
            body .bPageBlock .pbBody .grey .pbSubheader{
                background-color:#c0c0c0;
            }
            body .bPageBlock .pbBody .grey .pbSubheader h3{
                color:#000;
            }
            
            {
         text-align:center;
}
            
           </style>
    
    
    <style type="text/css">

.wrapper {
         text-align:center;
}
</style>

  <script>
  
  
      
      function validateFunction(paramval,paramval1){
      
      if(paramval=='Sent'){
      
      alert('The quote has already been sent to CW. You cannot send this Quote to CW.This page will now redirect to the Quote Detail Page');
      
    return false;
      }
      
      
      if(paramval1=='false'){
      
      alert("Your Quote has not been synced. Please sync your quote before continuing");
      
     return false;
      
      }
                  
      }
          
</script>

<apex:actionStatus id="SaveButtonStatus">

<apex:facet name="stop">
       
  <apex:outputPanel styleClass="red" id="outputpanel">
  
  <apex:pageBlockSection title="Click on the Quote>CW button below to send the Quote to CW"  id="pbSection">
  
 <apex:pageMessages id="showmsg"/>
             <div align="center" draggable="false">                    
<apex:commandbutton onclick="validateFunction('{!Qlist[0].Conversion_Status__c}','{!Qlist[0].IsSyncing}')"
action="{!invokeMule}"  
styleclass="commandbutton" value="Quote>CW" status="SaveButtonStatus"
style="margin-left:800px;float:center;"
id="saveButtonId" 
rerender="showmsg"/> 
 
<apex:commandButton action="{!Cancel}" style="float:center;"
      value="Cancel" disabled="false" id="theCancelButton"/>
      
      </div>

       </apex:pageBlockSection>
           
          
   </apex:outputPanel>
  
  </apex:facet>
 
  <apex:facet name="start">
  
       <apex:outputPanel styleClass="red" rendered="{!Qlist[0].Conversion_Status__C!='Sent'}">
       <div align="center" draggable="false">
       <apex:pageBlockSection title="Your Quote is being sent to CW. You will be redirected back to the Quote screen">
       
      <apex:pageMessages id="showmsg"/>
        <apex:commandButton styleclass="commandbutton" 
        onclick="validateFunction('{!Qlist[0].Conversion_Status__c}','{!Qlist[0].IsSyncing}')"
        rendered="{!Qlist[0].Conversion_Status__C!='Sent'}"
        style="margin-left:800px;float:center;"
        value="Sending Quote to CW..." disabled="true"  rerender="showmsg"/>
         
          <apex:commandButton action="{!Cancel}" value="Cancel" disabled="true" id="theCancelButton" immediate="true"
         style="margin-left:1000px;float:center;"/>
         
        </apex:pageBlockSection>
        
         </div>
       </apex:outputPanel> 
      
      </apex:facet>
  
  </apex:actionStatus>
  
  </apex:pageBlock>
   </apex:form>
</apex:page>
Hi, 

I have a button which used the below java script code, when i click on the button i get the error "undefined", i am unable to identify the line at which this error is occuring, can you let me know if there is a way to identify the line which is causing this error:-

{!RequireScript("/soap/ajax/33.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")} 
{!REQUIRESCRIPT("//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js")} 
{!REQUIRESCRIPT("//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js")}  

try{ 
jQuery(function() { 
/*Append the jQuery CSS CDN Link to the Head tag.*/ 
jQuery('head').append('<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/start/jquery-ui.css" type="text/css" />'); 

/*Create the HTML(DIV Tag) for the Dialog.*/ 
var html = 
'<div id="dialog" title="Go To Opportunity"><p>Do you want to go to the Opportunity Home Page? Click continue or this page will redirect automatically </p></div>'; 

/*Check if the Dialog(DIV Tag) already exists if not then Append the same to the Body tag.*/ 
if(!jQuery('[id=dialog]').size()){ 
jQuery('body').append(html); 


/*Open the jQuery Dialog.*/ 
jQuery( "#dialog" ).dialog({ 
autoOpen: true, 
modal: true, 
show: { 
effect: "bounce", 
duration: 1000 
}, 
hide: { 
effect: "bounce", 
duration: 1000 
}, 
buttons: { 
"Continue": function() { 
parent.location.href= '/' + '{!Quote.Opportunity_ID_18_Char__c}' ; /* redisplay the detail page */ 
jQuery( this ).dialog( "close" ); 
}, 
Cancel: function() { 
jQuery( this ).dialog( "close" ); 


}); 
}); 

catch(e){ 
alert('An Error has Occured. Error: ' + e); 



var sync = '{!Quote.IsSyncing }' 
var conversion = '{!Quote.Conversion_Status__c}' 

var QuoteObj = new sforce.SObject("Quote"); 
QuoteObj.Id='{!Quote.Id}'; 

var OppId='{!Quote.Opportunity_ID_18_Char__c}' 

var Q='{!Quote.Quote_CW__c}' 

if( sync == false) 

alert("Please sync your quote before continuing"); 

else if( conversion == 'Sent') 

alert("Your Quote has already been sent to CW"); 

else if(Q==true) { 

alert("You already have clicked on the Button once"); 

else 

var r = confirm("Note that you can only send Quote to CW one time. Are you sure you want to send?"); 




/*var query="select id,Quote_CW__c from Quote where Id='{!Quote.Id}' "; 

var records = sforce.connection.query(query); 

var records1 = records.getArray("records"); */ 

//alert(records); 



if(r==true) 



QuoteObj.Quote_CW__c=true; 
var result = sforce.connection.update([QuoteObj]); 

//alert(result); 

var quoteID = '{!Quote.Id}' 

postParams = {} 
postParams.url = 'https://servicesuat.restorationhardware.com:10000/QuoteToCW/' + quoteID 
postParams.method = 'GET' 
postParams.requestHeaders = {} 
postParams.requestData = '' 
postParams.requestHeaders['Content-Type'] = 'application/x-www-form-urlencoded' //or another mime-type 
postParams.requestHeaders['Content-Length'] = postParams.requestData.length //required for POST 
postParams.onSuccess = processSuccess 
postParams.onError = processError 
sforce.connection.remoteFunction(postParams) 

if (result[0].success == 'false') { 
alert(result[0].errors.message); 

else { 
parent.location.href= '/' + OppId; /* redisplay the detail page */ 

function processSuccess(message) 
{ // do something with results 
alert(message); 
/*alert("Don't click on the Quote>CW again, it will be duplicate orders. This page will now redirect"); */ 

//document.getElementsByName("Quote>CW")[0].disabled = true; 
 


function processError(message) 
{ // do something with the error 
alert('error'); 
}}
Hi,

I am trying to show the user an alert message if the user has double clicked on a button. The button uses the java script code below. In order to do this, i created a checkbox field. I am updating it to true once the user clicks the button. Based on this, i am trying to show an alert. But the alert is not being shown to the user on the second click. I am also updating the checkbox to false, before navigating user to other page.

Let me know if this could be done with Java Script.

{!RequireScript("/soap/ajax/33.0/connection.js")}


var QuoteObj = new sforce.SObject("Quote");
QuoteObj.Id = '{!Quote.Id}';

var url = parent.location.href;


var OppId='{!Quote.Opportunity_ID_18_Char__c}'

var sync = '{!Quote.IsSyncing }'
var conversion = '{!Quote.Conversion_Status__c}'
var Q='{!Quote.Quote_CW__c}'

if( sync == false)
{
alert("Please sync your quote before continuing");
}
else if( conversion == 'Sent')
{
alert("Your Quote has already been sent to CW");
}
else
{
var r = confirm("Do not click the Quote to CW Button more than once.Note that you can only send Quote to CW one time. Are you sure you want to send? Once you click Ok, this page will redirect");

QuoteObj.Quote_CW__c = 'true';
var result = sforce.connection.update([QuoteObj]);


}


if(r==true)
{

var quoteID = '{!Quote.Id}'

postParams = {}
postParams.url = 'https://servicesuat.restorationhardware.com:10000/QuoteToCW/' + quoteID
postParams.method = 'GET'
postParams.requestHeaders = {}
postParams.requestData = ''
postParams.requestHeaders['Content-Type'] = 'application/x-www-form-urlencoded' //or another mime-type
postParams.requestHeaders['Content-Length'] = postParams.requestData.length //required for POST
postParams.onSuccess = processSuccess
postParams.onError = processError
sforce.connection.remoteFunction(postParams)


function processSuccess(message)
{ do something with results¨
alert("Quote has been synced to CW, don't click the Quote>CW Button Again. This //page will now redirect");

if(Q=='true'){
alert("Don't click on the button again you have already clicked once");

}



QuoteObj.Quote_CW__c = 'false';
var result = sforce.connection.update([QuoteObj]);


parent.location.href= '/' + OppId;
}
function processError(message)
{ // do something with the error
alert('error');
}
}
Hi,

I am gettign the error "Field Quote.OpportunityId does not exist." when i use the below code.. let me know what the issue could be.


{!RequireScript("/soap/ajax/33.0/connection.js")}

var url = parent.location.href;

var OppId='{!Quote.OpportunityId}'

var sync = '{!Quote.IsSyncing }'
var conversion = '{!Quote.Conversion_Status__c}'

if( sync == false)
{
alert("Please sync your quote before continuing");
}
else if( conversion == 'Sent')
{
alert("Your Quote has already been sent to CW");
}
else
{
var r = confirm("Do not click the Quote to CW Button more than once.Note that you can only send Quote to CW one time. Are you sure you want to send? Once you click Ok, this page will redirect");
}

if(r==true)
{

var quoteID = '{!Quote.Id}'

postParams = {}
postParams.url = 'https://servicesuat.restorationhardware.com:10000/QuoteToCW/' + quoteID
postParams.method = 'GET'
postParams.requestHeaders = {}
postParams.requestData = ''
postParams.requestHeaders['Content-Type'] = 'application/x-www-form-urlencoded' //or another mime-type
postParams.requestHeaders['Content-Length'] = postParams.requestData.length //required for POST
postParams.onSuccess = processSuccess
postParams.onError = processError
sforce.connection.remoteFunction(postParams)


function processSuccess(message)
{ // do something with results¨
//alert("Quote has been synced to CW, don't click the Quote>CW Button Again. This //page will now redirect");

parent.location.href= '/' + OppId;
}
function processError(message)
{ // do something with the error
alert('error');
}
}
Hi,
I am tring to redirect users to Opportunity tab after saving the record. Wanted to construct the generic URL instead of hard coding the value, let me know what the generic URL should be so that it wroks in produciton too.
Hi,

i have a button on quotes, the button needs to be disabled after the user clicks once. Let me know if this can be done with JavaScript itself rather than create a VF page.

Code Below :-

{!RequireScript("/soap/ajax/33.0/connection.js")}

var sync = '{!Quote.IsSyncing }'
var conversion = '{!Quote.Conversion_Status__c}'

if( sync == false)
{
alert("Please sync your quote before continuing");
}
else if( conversion == 'Sent')
{
alert("Your Quote has already been sent to CW");
}
else
{
var r = confirm("Note that you can only send Quote to CW one time. Are you sure you want to send?");
}

if(r==true)
{

var quoteID = '{!Quote.Id}'

postParams = {}
postParams.url = 'https://servicesuat.restorationhardware.com:10000/QuoteToCW/' + quoteID
postParams.method = 'GET'
postParams.requestHeaders = {}
postParams.requestData = ''
postParams.requestHeaders['Content-Type'] = 'application/x-www-form-urlencoded' //or another mime-type
postParams.requestHeaders['Content-Length'] = postParams.requestData.length //required for POST
postParams.onSuccess = processSuccess
postParams.onError = processError
sforce.connection.remoteFunction(postParams)


function processSuccess(message)
{ // do something with results¨
alert(message);
window.location.reload();
}
function processError(message)
{ // do something with the error
alert('error');
}}

 
Hi,

I have time dependent workflow on the opportunity which should send an email 30 days before the opportunity close date. But the email alert is being sent when ever an opportunity is created with a close date of next week. Let me  know what the issue could be. Below are screenshots of the time dependent workflow:-

I am using the below trigger condition, 

30 Days before opportunity close date.

Let me know what the issue could be.
Hi,

I have a form which opens up on click of a custom button "Generate Service" on opportunity. After the form is Saved, the user is redirected to the opportunity detail page. When the Button "Generate Service" is clicked again, I want the old form which was saved before to open up again instead of the brand new form. Let me know if this can be done.
  
Hi,

I am trying to render output panel based on multiple conditions. I am using the below syntax in the output panel, its not working. 

Let me know what the issue is.

       rendered ="IF{(!Qlist[0].Conversion_Status__C!='Sent' AND !Qlist[0].IsSyncing==true),true,false}">
Hi,

I am trying to display the web service response to the end user before page navigation. But its not working. I am retrieving the body in the public String xmlContent{get;set;} in the below class and in the VF Page i am refrencing int the outputtext:-

public class Quote_To_CW_Test {
    
    public List<Quote> Qlist{get;set;}
    
    public String xmlContent{get;set;}
    
    public Quote_To_CW_Test() {
    
        qid=[Select Id from Quote where Id=:ApexPages.currentPage().getParameters().get('quoteId')].id;
        
        Qlist=[Select Conversion_Status__c,Id,IsSyncing from Quote where Id=:ApexPages.currentPage().getParameters().get('quoteId')];

system.debug('////////////' +Qlist[0].Conversion_status__c);
    }
    
 private final Quote q;string qid;
          
public PageReference invokeMule(){
    

/*redirect user to another page*/


/*logic for web service call out here*/
if(Qlist[0].Conversion_Status__c!='Sent'){

String url;

url='https://xxxxxx:10000/QuoteToCW/' + Qlist[0].Id;

HttpRequest req = new HttpRequest();
Http http = new Http();
req.setMethod('GET');
req.setEndpoint(url);

//req.setHeader('Content-Type', 'application/x-www-form-urlencoded');  


// create the response object
HTTPResponse resp;

 resp = http.send(req);

 /*catch(System.CalloutException e) {
        System.debug('Callout error: '+ e);
        System.debug('**************' +resp.toString());
    }*/
 
String xmlContent=String.valueOf(resp.getBody());

System.debug('////////' +resp.getBody());


System.debug('+++++++++ XMLContent is'+ xmlContent);


system.debug('The request end point is ++++' + url);
 
req.setEndpoint(url);

}

  //disabl = true;

PageReference qPage= new PageReference('/' +qid);


apexpages.Message msg = new Apexpages.Message(ApexPages.Severity.Info,'Status of the response ' + xmlContent);
        apexpages.addmessage(msg);
        
        
        
    
return qPage;

}


/* Cancel to return to the previous page*/

public PageReference Cancel() {
    
PageReference qPage = new PageReference('/' +qid);
        
return qPage;
   
    }
}




VF Page:-

<apex:page controller="Quote_To_CW_Test" sidebar="false" id="page">

<apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
 
  

<apex:form id="form">

<apex:outputText value="{!xmlContent}" />
  
  <apex:pageBlock id="pageblock">
  
    <style>
            body .bPageBlock .pbBody .red .pbSubheader{
                background-color:#c00000;
            }
            body .bPageBlock .pbBody .grey .pbSubheader{
                background-color:#c0c0c0;
            }
            body .bPageBlock .pbBody .grey .pbSubheader h3{
                color:#000;
            }
            
            {
         text-align:center;
}
            
           </style>
    
    
    <style type="text/css">

.wrapper {
         text-align:center;
}
</style>

  <script>
  
  
      
      function validateFunction(paramval,paramval1){
      
      if(paramval=='Sent'){
      
      alert('The quote has already been sent to CW. You cannot send this Quote to CW.This page will now redirect to the Quote Detail Page');
      
    return false;
      }
      
      
      if(paramval1=='false'){
      
      alert("Your Quote has not been synced. Please sync your quote before continuing");
      
     return false;
      
      }
                  
      }
          
</script>

<apex:actionStatus id="SaveButtonStatus">

<apex:facet name="stop">
       
  <apex:outputPanel styleClass="red" id="outputpanel">
  
  <apex:pageBlockSection title="Click on the Quote>CW button below to send the Quote to CW"  id="pbSection">
  
 <apex:pageMessages id="showmsg"/>
             <div align="center" draggable="false">                    
<apex:commandbutton onclick="validateFunction('{!Qlist[0].Conversion_Status__c}','{!Qlist[0].IsSyncing}')"
action="{!invokeMule}"  
styleclass="commandbutton" value="Quote>CW" status="SaveButtonStatus"
style="margin-left:800px;float:center;"
id="saveButtonId" 
rerender="showmsg"/> 
 
<apex:commandButton action="{!Cancel}" style="float:center;"
      value="Cancel" disabled="false" id="theCancelButton"/>
      
      </div>

       </apex:pageBlockSection>
           
          
   </apex:outputPanel>
  
  </apex:facet>
 
  <apex:facet name="start">
  
       <apex:outputPanel styleClass="red" rendered="{!Qlist[0].Conversion_Status__C!='Sent'}">
       <div align="center" draggable="false">
       <apex:pageBlockSection title="Your Quote is being sent to CW. You will be redirected back to the Quote screen">
       
      <apex:pageMessages id="showmsg"/>
        <apex:commandButton styleclass="commandbutton" 
        onclick="validateFunction('{!Qlist[0].Conversion_Status__c}','{!Qlist[0].IsSyncing}')"
        rendered="{!Qlist[0].Conversion_Status__C!='Sent'}"
        style="margin-left:800px;float:center;"
        value="Sending Quote to CW..." disabled="true"  rerender="showmsg"/>
         
          <apex:commandButton action="{!Cancel}" value="Cancel" disabled="true" id="theCancelButton" immediate="true"
         style="margin-left:1000px;float:center;"/>
         
        </apex:pageBlockSection>
        
         </div>
       </apex:outputPanel> 
      
      </apex:facet>
  
  </apex:actionStatus>
  
  </apex:pageBlock>
   </apex:form>
</apex:page>
Hi,
I am tring to redirect users to Opportunity tab after saving the record. Wanted to construct the generic URL instead of hard coding the value, let me know what the generic URL should be so that it wroks in produciton too.