• Cable Guy.ax375
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 10
    Replies

The operation only involves with a trigger and a class. I already grant all the profiles to the class for the security. But I still got the following error. Any thoughts would be greatly appreciated.

 

Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

I store the email content in the email template in Salesforce. In my java program, I can get the email template but it missing the letterhead. Letterhead is stored in letterhead file and includes the company logo. In email template, I specify the letterhead in the detail of email template. When my java program sends out the email, the recipient only receives the body of the email and the letterhead is missing.

 

In my java program, does it need specific code to set the letterhead? Please advise.

 

 

 

 

 

 

Can anyone help me for the syntax of changing the background color of row in the tag of apex:pageBlockTable?

 

 <apex:pageBlockTable value="{!forecastUser.manager2OWrappersFiltered}" var="o" id="oppTable">
                    <apex:column headerValue="Sales Rep">
                        <apex:outputField value="{!o.manager2Owners.Sales_Rep__c}" />
                    </apex:column>
                    <apex:column headerValue="Account Name">
                        <apex:outputField value="{!o.manager2Owners.Opportunity__r.AccountId}" />
                    </apex:column>
                    <apex:column headerValue="Opportunity Name">
                        <apex:outputLink value="/{!o.manager2Owners.Opportunity__r.Id}">{!o.manager2Owners.Opportunity__r.Name}</apex:outputLink>
                    </apex:column>

 </apex:pageBlockTable>

Can anyone point out where I can reduce the state size in my code:

 

 

<apex:page standardController="Forecast__c" extensions="EditForecastContExt" id="wfPage" sidebar="false" tabStyle="Forecasts__tab" action="{!creatManagerOwnerWrappers}">
    <apex:form >
        <apex:sectionHeader title="{!user.Name}'s Forecast" id="header" />
        <apex:commandLink action="{!returnToForecast}" value="Back to Forecast"/>
        <apex:actionStatus id="loadingStatus" onStart="showStatus();" onStop="hideStatus();"/>
        <apex:outputPanel id="oppPanel">
            <div id="oppFiltersDiv">
              
                <span class="filterLabel">Filter By User:&nbsp;&nbsp;</span>
                <apex:selectList size="1" value="{!forecastUser.oppFilterUserId}">
                    <apex:selectOptions value="{!opportunityManagerUserFilter}" />
                    <apex:actionSupport event="onchange"
                        action="{!forecastUser.filterManagerOpportunities}"
                        status="loadingStatus" rerender="oppPanel,msgs" />
                </apex:selectList>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <span class="filterLabel">Filter By Director&#39;s Category:&nbsp;&nbsp;</span>
                <apex:selectList size="1" value="{!forecastUser.oppFilterCategory}">
                    <apex:selectOptions value="{!opportunityCategoryFilter}" />
                    <apex:actionSupport event="onchange"
                        action="{!forecastUser.filterManagerOpportunities}"
                        status="loadingStatus" rerender="oppPanel,msgs" />
                </apex:selectList>
                 
            </div>
            <br/>
            <apex:pageBlock mode="edit">
                <apex:pageBlockTable value="{!forecastUser.managerOWrappersFiltered}" var="o" id="oppTable">
                    <apex:column headerValue="Sales Rep">
                        <apex:outputField value="{!o.managerOwners.Sales_Rep__c}" />
                    </apex:column>
                  
                    <apex:column headerValue="Opportunity Name">
                        <apex:outputLink value="/{!o.managerOwners.Opportunity__r.Id}">{!o.managerOwners.Opportunity__r.Name}</apex:outputLink>
                    </apex:column>
                 
                 
                    <apex:column headerValue="{!$ObjectType.Opportunity.Fields.CloseDate.Label}">
                        <apex:inputField value="{!o.managerOwners.Opportunity__r.CloseDate}" >
                            <apex:actionSupport event="onchange" rerender="changed">
                                <apex:param name="changeParam"
                                            assignTo="{!o.IsChanged}"
                                            value="true" />
                            </apex:actionSupport>
                        </apex:inputField>                  
                    </apex:column>
                    <apex:column headerValue="ESP">
                        <apex:outputField value="{!o.managerOwners.ESP__c}"/><br/>
                    </apex:column>
                   
                    <apex:column headerValue="Split Amount">
                        <apex:outputField value="{!o.managerOwners.Split_Amount__c}"/><br/>
                    </apex:column>
                 
                    
                    <apex:column headerValue="Ready To Update">
                        <apex:outputPanel id="changed">
                            <apex:image value="{!$Resource.check}" rendered="{!o.IsChanged}" height="15px" width="15px" id="check"/>
                            <apex:image value="{!$Resource.xmark}" rendered="{!NOT(o.IsChanged)}" height="15px" width="15px" id="x"/>
                        </apex:outputPanel>
                         <br/>
                    </apex:column>
                    
                    
                </apex:pageBlockTable>
                 
                 
                <apex:pageBlock >
                <apex:outputPanel id="totalPanel">
                    <table style="width: 100%">
                         
                        <tr>
                            <td width = "75%"></td>
                            <td class="numericalColumn"></td>
                            <td>Total ESP: ${!forecastUser.totalESP}</td>
                            <td>Total Split Amount: ${!forecastUser.totalSplitAmount}</td>
                        </tr>
                    </table>
                </apex:outputPanel>
            </apex:pageBlock>
                  
               
                <apex:pageblockButtons location="bottom">
                    <apex:commandButton action="{!forecastUser.updateOpps}" value="Update Opportunity" status="loadingStatus"
                                        rerender="oppPanel, msgs"  rendered="{!OR(hasPermission, $User.Id == forecastUser.manager.Id)}"/>
                </apex:pageblockButtons>
            </apex:pageBlock>
        </apex:outputPanel>
    </apex:form>
    <apex:pageMessages id="msgs"/>
    <apex:outputPanel id="popup">
    <apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopUp}"/>
        <apex:outputPanel styleClass="customPopup" layout="block" rendered="{!displayPopUp}">
            <div style="text-align:center; font-size: 1.5em; font-weight: bold; vertical-align:middle">
                LOADING <apex:image value="{!$Resource.AjaxLoader}" style="margin-left:15px" />
            </div>
        </apex:outputPanel>
    </apex:outputPanel>            
</apex:page>

Does anyone have existing code of dynamically building a dropdown in controller so that on the visualforce page would look like this (it always starts from current month and current year) for the next 24 months:

 

Aug-2010

Sep-2010

Oct -2010

Nov-2010

Dec-2010

Jan-2011

Feb-2011

Mar-2011

...

...

 

with value:

8-2010

9-2010

10-2010

11-2010

12-2010

1-2011

2-2011

3-2011

...

...

 

 

Any help will be greatly appreciated.

Does anyone have existing code of dynamically building a dropdown in controller so that on the visualforce page would look like this (it always starts from current month and current year) for the next 24 months:

 

Aug-2010

Sep-2010

Oct -2010

Nov-2010

Dec-2010

Jan-2011

Feb-2011

Mar-2011

...

...

 

with value:

8-2010

9-2010

10-2010

11-2010

12-2010

1-2011

2-2011

3-2011

...

...

 

 

Any help will be greatly appreciated.

I have a dropdown on Visual Force page with the options look like the following:

 

January -- FY 2010

February -- FY 2010

March -- FY 2010

April -- FY 2010

......

......

 

On the visual force page, how should I parse the selected option to pass them to two hidden fields: hiddenMonth, hiddenYear so that hiddenMonth will have value of month and hiddenYear will have value of year?

 

Any help will be greatly appreciated.

I need to disable the past months in the dropdown so that user can only select the current month and future month as the criteria for searching on Visual Force page. Any help will be greatly appreciated. 

 

<apex:selectList value="{!month}" multiselect="false" size="1">
<apex:selectOption itemValue="1" itemLabel="January" />
<apex:selectOption itemValue="2" itemLabel="February" />
<apex:selectOption itemValue="3" itemLabel="March" />
<apex:selectOption itemValue="4" itemLabel="April" />
<apex:selectOption itemValue="5" itemLabel="May" />
<apex:selectOption itemValue="6" itemLabel="June" />
<apex:selectOption itemValue="7" itemLabel="July" />
<apex:selectOption itemValue="8" itemLabel="August" />
<apex:selectOption itemValue="9" itemLabel="September" />
<apex:selectOption itemValue="10" itemLabel="October" />
<apex:selectOption itemValue="11" itemLabel="November" />
<apex:selectOption itemValue="12" itemLabel="December" />

 

I want to implement the following logic:

 

If A == 'Off', then don't display inputField;

if A == 'On', then display inputField but make inputField not required

If A=='On/Required', then display inputField and make inputField required

 

I have the following code:

 

<apex:inputField value="{!B}" required="{IF(A =='On/Required', true, false)}" rendered="{!A != 'Off'}" />

 

It doesn't work. Can anyone point out where it went wrong?

 

Thanks in advance,

I have a java application and I try to set the date field in salesforce.com to null.

 

java.util.Date litDate = null;

updateBuilding.setLit_Date__c(litDate);

 

It doesn't work. How will I be able to achieve the goal? Any code samples?

 

Thanks in advance.

I have a SFDC update job and what the job does is query opportunity object and pass the building id from opportunity object to building object and update the corresponding building. When I ran the job, I constantly got the following error:

 

AxisFault:

faultCode:{http://schemas.xmlsoap.org/soap/envelope/}Server.userException

faultSubcode:

faultString:java.net.ConnectException:Connection timed out:connect

.......................

.......................

 

Is this a common error? Any easy fix? Please advise.

 

Thanks,

How can I modify the following code so it can insert 200 records each time? I'm using API version 7.
 
Assume I already have a recordset of 50000 records from Oracle database.
 
public void updateEquipment(ID buildingID, String clliCode, String equipSpecType, String vendorName,
      String vendorPartNum, String materialCode, String vendorCommCode, String vendorIssueNum,
      String equipSpecID, String equipAcronym, String equipDesc, Double equipCount)
 
    {
      
     Equipment__c eq = new Equipment__c();
    
      eq.setBuilding__c(buildingID);
      eq.setCLLI_code__c(clliCode);
      eq.setEquipspec_Type__c(equipSpecType);
      eq.setVendor_Name__c(vendorName);
      eq.setVendor_Part_Number__c(vendorPartNum);
      eq.setMaterial_Code__c(materialCode);
      eq.setVendor_Comm_Code__c(vendorCommCode);
      eq.setVendor_Issue_Number__c(vendorIssueNum);
      eq.setEquipment_Spec_ID__c(equipSpecID);
      eq.setEquipment_Acronym__c(equipAcronym);
      eq.setDescription__c(equipDesc);
      eq.setQuantity__c(equipCount);
      eq.setName(equipSpecType);
    
    
      SObject[] sObjects = new SObject[1];
     
      sObjects[0] = eq;
        
      
      try {
       
       
       SaveResult[] saveResults = binding.create(sObjects);
    
     
        for (int i=0; i<saveResults.length; i++) {
         
          if (saveResults[i].isSuccess()) {
            
           Logger.log("updateEquipment() - " + saveResults[i].getId(),true);
            System.out.println("insert equipment " + saveResults[i].getId());
          }
          else {
               
           Logger.log("updateEquipment() - " + saveResults[i].getErrors()[i].getMessage(),true);
          }
         
        }
      } catch (InvalidSObjectFault e) {
       Logger.log("updateEquipment() - invalid object exception encountered:\n\n" + e.getMessage(),true);
    
      } catch (UnexpectedErrorFault e) {
       Logger.log("updateEquipment() - Unexpected error exception encountered:\n\n" + e.getMessage(),true);
     
      } catch (RemoteException e) {
       Logger.log("updateEquipment() - Remote exception encountered:\n\n" + e.getMessage(),true);
  
      }
      
    }
 
 
Can anyone give me the sample code of deleting 200 records each time for a table of 50000 records? I'm using SFDC Java API version 7.
 
Thanks, 
Does anyone know how to drop the object and re-create the same object through the JAVA API?
Can I execute a delete query through SFDC API by using java like how java using the jdbc connection? If it's doable, anyone has any sample code for that?
 
Thanks.
I'm dealing with a massive data deletion. I have an object called Equipment and it holds 50000 records. I have a java application using SFDC API version 7. It only allows maximum 200 records for each deletion. How should I make it work to delete 50000 records? Is there any quicker way to do this?
 
Thanks,

Does anyone have existing code of dynamically building a dropdown in controller so that on the visualforce page would look like this (it always starts from current month and current year) for the next 24 months:

 

Aug-2010

Sep-2010

Oct -2010

Nov-2010

Dec-2010

Jan-2011

Feb-2011

Mar-2011

...

...

 

with value:

8-2010

9-2010

10-2010

11-2010

12-2010

1-2011

2-2011

3-2011

...

...

 

 

Any help will be greatly appreciated.

I want to implement the following logic:

 

If A == 'Off', then don't display inputField;

if A == 'On', then display inputField but make inputField not required

If A=='On/Required', then display inputField and make inputField required

 

I have the following code:

 

<apex:inputField value="{!B}" required="{IF(A =='On/Required', true, false)}" rendered="{!A != 'Off'}" />

 

It doesn't work. Can anyone point out where it went wrong?

 

Thanks in advance,

I have a java application and I try to set the date field in salesforce.com to null.

 

java.util.Date litDate = null;

updateBuilding.setLit_Date__c(litDate);

 

It doesn't work. How will I be able to achieve the goal? Any code samples?

 

Thanks in advance.

How can I modify the following code so it can insert 200 records each time? I'm using API version 7.
 
Assume I already have a recordset of 50000 records from Oracle database.
 
public void updateEquipment(ID buildingID, String clliCode, String equipSpecType, String vendorName,
      String vendorPartNum, String materialCode, String vendorCommCode, String vendorIssueNum,
      String equipSpecID, String equipAcronym, String equipDesc, Double equipCount)
 
    {
      
     Equipment__c eq = new Equipment__c();
    
      eq.setBuilding__c(buildingID);
      eq.setCLLI_code__c(clliCode);
      eq.setEquipspec_Type__c(equipSpecType);
      eq.setVendor_Name__c(vendorName);
      eq.setVendor_Part_Number__c(vendorPartNum);
      eq.setMaterial_Code__c(materialCode);
      eq.setVendor_Comm_Code__c(vendorCommCode);
      eq.setVendor_Issue_Number__c(vendorIssueNum);
      eq.setEquipment_Spec_ID__c(equipSpecID);
      eq.setEquipment_Acronym__c(equipAcronym);
      eq.setDescription__c(equipDesc);
      eq.setQuantity__c(equipCount);
      eq.setName(equipSpecType);
    
    
      SObject[] sObjects = new SObject[1];
     
      sObjects[0] = eq;
        
      
      try {
       
       
       SaveResult[] saveResults = binding.create(sObjects);
    
     
        for (int i=0; i<saveResults.length; i++) {
         
          if (saveResults[i].isSuccess()) {
            
           Logger.log("updateEquipment() - " + saveResults[i].getId(),true);
            System.out.println("insert equipment " + saveResults[i].getId());
          }
          else {
               
           Logger.log("updateEquipment() - " + saveResults[i].getErrors()[i].getMessage(),true);
          }
         
        }
      } catch (InvalidSObjectFault e) {
       Logger.log("updateEquipment() - invalid object exception encountered:\n\n" + e.getMessage(),true);
    
      } catch (UnexpectedErrorFault e) {
       Logger.log("updateEquipment() - Unexpected error exception encountered:\n\n" + e.getMessage(),true);
     
      } catch (RemoteException e) {
       Logger.log("updateEquipment() - Remote exception encountered:\n\n" + e.getMessage(),true);
  
      }
      
    }
 
 
Can anyone give me the sample code of deleting 200 records each time for a table of 50000 records? I'm using SFDC Java API version 7.
 
Thanks, 
I'm dealing with a massive data deletion. I have an object called Equipment and it holds 50000 records. I have a java application using SFDC API version 7. It only allows maximum 200 records for each deletion. How should I make it work to delete 50000 records? Is there any quicker way to do this?
 
Thanks,