• SFF
  • SMARTIE
  • 650 Points
  • Member since 2012

  • Chatter
    Feed
  • 25
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 227
    Replies

I'm working on part of an account object trigger we've got and keep getting a compile error.  

 

issue is this line

 

                String rddTerritory = userToRddTerritory.get(account.BillingPostalCode);

 

trigger is below.  any ideas how to fix this?

 

 

    // ------------------------------------------------------------------------
    // RDD Territory processing
    // ------------------------------------------------------------------------

 if ((Trigger.isInsert || Trigger.isUpdate) && Trigger.isBefore) {
        
        List<Account> postalCodeAccountsToProcess = new List<Account>();
        List<Account> ownerAccountsToProcess = new List<Account>();
        Set<String> postalCodes = new Set<String>();
        Set<String> ownerIds = new Set<String>();
        
        Id accountRddRecordTypeId = CSUtils.getRecordTypeId('Account', 'RDD');
        
        for (Account account : Trigger.new) {
            if (account.BillingPostalCode != null && account.RecordTypeId != accountRddRecordTypeId) {
                if (Trigger.isInsert || (Trigger.isUpdate && Trigger.oldMap.get(account.Id).BillingPostalCode != account.BillingPostalCode)) {
                    postalCodeAccountsToProcess.add(account);
                    postalCodes.add(account.BillingPostalCode);
                }
            } else if (account.RecordTypeId == accountRddRecordTypeId) {
                if (Trigger.isInsert || (Trigger.isUpdate && Trigger.oldMap.get(account.Id).OwnerId != account.OwnerId)) {
                    ownerAccountsToProcess.add(account);
                    ownerIds.add(account.OwnerId);
                }
            }
        }

        if (postalCodeAccountsToProcess.size() > 0) {
            Map<String, RDD_Territory__c> postalCodeToRddTerritory = new Map<String, RDD_Territory__c>();
            for (RDD_Territory__c  rddTerritory : [select Zip_Code__c, Name from RDD_Territory__c where Zip_Code__c in :postalCodes]) {
                postalCodeToRddTerritory.put(rddTerritory.Zip_Code__c, rddTerritory);
            }
            
            for (Account account : postalCodeAccountsToProcess) {
                String rddTerritory = postalCodeToRddTerritory.get(account.BillingPostalCode);
                
                if (rddTerritory != null) {
                    account.RDD_Territory__c = rddTerritory;
                }
            }         
            
        }

        if (ownerAccountsToProcess.size() > 0) {
            Map<String, String> userToRddTerritory = new Map<String, String>();
            for (User  user : [select Id, RDD_Territory__c from User where Id in :ownerIds and RDD_Territory__c != null]) {
                userToRddTerritory.put(user.Id, user.RDD_Territory__c);
            }
            
            for (Account account : ownerAccountsToProcess) {
                String rddTerritory = userToRddTerritory.get(account.BillingPostalCode);

                if (rddTerritory != null) {
                    account.RDD_Territory__c = rddTerritory;
                }
            }
        }

    }

 

Im trying to create a VF Component and it keeps throwing me this error.

 

Error: Unknown property 'MultiSelectComponentController.options'

 

Thanks for the help, 

hkp716

 

Heres my component:

 

<apex:component controller="MultiSelectComponentController">
<apex:attribute name="AvailableList" type="selectOption[]" description="Available List from the Page" assignTo="{!options}" required="true"/>
<apex:attribute name="ChosenList" type="selectOption[]" description="Chosen List from the Page" assignTo="{!selectedOptions}" required="True"/>
<!-- <apex:attribute name="AvailableTitle" type="String" description="Title for Available List" assignTo="{!selectedTitle}"/> -->
<!-- <apex:attribute name="ChosenTitle" type="String" description="Title for Chosen List" assignTo="{!deSelectedTitle}"/> -->

<apex:outputPanel id="panel">
<apex:pageBlockSection columns="4" >
<apex:selectList multiselect="true" size="5" value="{!selected}" >
<apex:selectOptions value="{!options}" />
<apex:actionSupport event="ondblclick" action="{!selecting}" rerender="panel" status="waitingStatus" />
</apex:selectList>
<apex:pageBlockSection columns="1">
<!-- <apex:outputText value="{!selectedTitle}" /> -->
<apex:commandButton reRender="panel" id="select" action="{!selecting}" value=">" status="waitingStatus"/>
<!-- <apex:outputText value="{!delectedTitle}" /> -->
<apex:commandButton reRender="panel" id="deselect" action="{!deselecting}" value="<" status="waitingStatus"/>
</apex:pageBlockSection>
<!-- An action status to show that the operation of moving between the lists is in progress--->
<apex:actionStatus id="waitingStatus" startText="Please wait..." stopText=""/>
<apex:selectList multiselect="true" size="5" value="{!deselected}">
<apex:selectOptions value="{!selectedOptions}"/>
<apex:actionSupport event="ondblclick" action="{!deselecting}" rerender="panel" status="waitingStatus"/>
</apex:selectList>
</apex:pageBlockSection>
</apex:outputPanel>
</apex:component>

 

 

  • November 20, 2012
  • Like
  • 0

Hello everyone,

 

I am facing problem with exposing the salesforce events and calender to the customer portal as a tab.

I think it's not possible for now.

Still I am in doubt.

 

Please share you opinion on this.

 

Thanks,

Smarjit Debata

  • November 20, 2012
  • Like
  • 0

Hi,

 

for each report, is it possible to get a count of how many times it was ran for this year? 

 

What i have got so far,

 

Created a matrix report on reports with report name in the y-axis and last run in the x-axis. Everything's cool, but i am not satisfied with the numbers thats being displayed. Almost all the reports are ran either 1 or 2 times for the whole year which is absolutely wrong. 

 

Few reports that are associated to dashbaords dont even show up in the list. Can anyone tell me if there is a way to get the count of how many times each report was ran and why the reports associated to dashboards dont show up in the list.

 

FYI, i just made sure i clicked on "Run Report" button few dozen times for a report that was on the list. Then i re-ran the report and the last ran count still shows 1 only, why?

 

Thanks.

  • November 15, 2012
  • Like
  • 0

I have a big problem:

 

We wrote some code in a Sandbox org that uses the Service Contract object. We created a Change Set with all of the necessary components for deployment into the Production org.

 

However, we'd obviously like to be able to undo the deployment in case it causes problems. You cannot undo outbound change sets.

 

So i thought of packaging everything up into a managed package in a developer org, but that's impossible because the Service Contract object doesn't exist in the Developer Edition environment. Why not!? I haven't found any documentation that states this or why.

 

So i'm currently stuck.

 

Does anybody have any more relevant info or any advice on how to proceed - or if you've been in this situation yourself?

 

Thanks,

 

Robin

Hi at all,

i have this little problem on my org: i have a parent custom oject "Order__c" that have the related Notes and Attachments.

I create one trigger that fire before the delete of the attachment and prevent the delete for certain Profile.

But if the same profile can delete the parent record (and he is able to do it through the Object level security by this profile) the trigger doesn't fire!

How can i fire again the same trigger? should i fire it by the delete of Parent record?

Thanks in advance
Regards
Luca

Hi All, I kept required=" true" only vf page where it shows red mark on it. but i need to display custom error message on top of vf page if field is not filled.....

I am trying to right justify my amounts in a page block section.  I am doing a single column display.  I have set <Right> for the entire block, but all the values are left justified.  Any ideas?

 here is a sample of the code:

 

<divid="caseInfo2"style="float:left;width:7%">

 <apex:pageBlockSectionTitle="Budget %"columns="1">

 

<Right>

            

<apex:outputTextvalue="{0, number, 0,000}">

             

<apex:paramvalue="{!Budgets[0].Jan_Amount__c}"/>

             

</apex:outputText>

  • November 09, 2012
  • Like
  • 0

I'd like to display a value calculated from custom fields in a visualforce page without resorting to writing a custom controller. I tried writing a javascript function with no luck. Any help would be greatly appreciated.

 

below is my code for the page. when I try to save i get the error, "Error: The value attribute on <apex:outputText> is not in a valid format. It must be a positive number, and of type Number, Date, Time, or Choice."

 

<apex:page standardController="Property__c">
<script type="text/javascript"> 
function totalCost() {
    var price = {!Property__c.PurchPrice__c};
    var rehab = {!Property__c.TotalRehab__c};
    var totCost = price + rehab;
    return totCost;
    }
</script>
  <apex:outputText value="Purchase: "/><apex:outputText value="{0, number, $###,###}"><apex:param value="{!Property__c.PurchPrice__c}" /></apex:outputText><br/>
  <apex:outputText value="Rehab: "/><apex:outputText value="{0, number, $###,###}"><apex:param value="{!Property__c.TotalRehab__c}" /></apex:outputText><br/>
  <apex:outputText value="Total: "/><apex:outputText value="{0, number, $###,###}"><apex:param value="totalCost()" /></apex:outputText><br/>
</apex:page>

 

Hi All,

 

I'm trying to write my first test class for a an extension to a controller. 

 

The class is simple - update the account information listed on the account form that's related to the contract object. I'm having trouble figuring out how to pass an updated value from the form over into the account object within the test class. When I run the test class it says that my account name is being updated to null.

 

System.DmlException: Update failed. First exception on row 0 with id 001E000000PNqdrIAD; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Name]: [Name]

 Can someone help please? 

 

public class updateAccountFromContract {

    public final Contract contract {get; set;}
    
    public updateAccountFromContract(ApexPages.StandardController controller) {
        this.contract = (Contract) controller.getRecord();
    }
    
    public pageReference updateAccount() {
        Account account = new Account(Id = contract.AccountId);
        account.Name = Contract.Account.Name;
        update account;
        
        pageReference pageRef = new PageReference('/apex/FC_Contract_Account_Mini_Page_Display?id='+ contract.Id);
        pageRef.setRedirect(true);
        return pageRef;
    }     
    
    //Test Class
    public static testMethod void testupdateAccountFromContract() {

        PageReference pageRef = Page.FC_Contract_Account_Mini_Page_Edit_Mode;
        Test.setCurrentPage(pageRef);

        Account account = new Account(name = 'test Account');
        insert account;
        
        Contract contract = new Contract(AccountId = account.Id, Status = 'Draft', StartDate = system.today(), ContractTerm = 1);
        insert contract;

        //Contract.Account.Name = 'Updated';
        ApexPages.currentPage().getParameters().put('id', contract.Id);
    
        ApexPages.StandardController stdController = new ApexPages.StandardController(contract);
        updateAccountFromContract controller = new updateAccountFromContract(stdController);
        
        controller.updateAccount();
        
        String nextPage = controller.updateAccount().getURL();
        System.assertEquals('/apex/FC_Contract_Account_Mini_Page_Display?id='+ contract.Id, nextPage);

    }
}

 

Here's the actual visualforce if you're interested. It's housed as a service could console component (a side window view with the contract object as the primary tab).

<apex:page standardController="Contract" extensions="updateAccountFromContract">
<apex:form >
<apex:pageblock tabStyle="Account" id="pageblock" mode="inlineEdit" title="Account Edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!updateAccount}" id="Save" value="Save" />
<apex:commandButton action="{!Cancel}" id="cancelButton" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Account Details" columns="1" ShowHeader="false" collapsible="false">
<apex:inputField style="text-align:left" value="{!Contract.AccountId}"/>
<apex:inputField style="text-align:left" value="{!Contract.Account.Name}" />
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>

Hello, colleagues,

I am attempting to retrieve Page Layout of Account object via Migration Tool.

in package.xml I have added the following:

<types>
    <members>Account Layout</members>
    <name>Layout</name>
</types>

 

but I'm getting error:

[sf:retrieve] Retrieve warnings (1):
[sf:retrieve] package.xml - Entity of type 'Layout' named 'Account Layout' cannot be found
[sf:retrieve] Finished request 04sE0000001HboGIAS successfully.

 What may be the cause?

Thank you, 

Mike

I'm a beginner VisualForce user. On my front burner is the challenge of customizing my New Event "Related To" field -- I need to remove some of the Drop Down options and default to a custom object, as show in the picture. Would greatly appreciate help pointing me toward a solution.


 

 

Thanks in advance.

 

Does the workbench keep record of deleted items indefinitely, or will they only show up in SOQL results if they are still in the recycle bin?

When an opportunity hits a certain stage, we want the opportunity owner to be able to notify our Accounting department. The Accounting dept would then review the Opportunity and approve it or not. If they do not approve it, a dialog between the Owner and Accounting will ensue. We want to capture this dialog.

 

What is the best Salesforce mechanism to implement this requirement; hopefully involving the least amount of customization/development?

 

I tried Create an Open Activity, but that does not generate an email. I tried "Send an Email" under "Activity History" but that creates a "Task" with a status of "Complete". I suppose after sending the Email, the Owner could Edit the Task and set the status to "In Process", but that seems rather awkward.

Thanks,

Mike

In the List view if the records are 2000+ , i notice that the ability to jump to last page is disabled. I can navigate to previous, next, first page but can't jump to last page.

 

Is there any setting I am missing?

hi  

apex tag was like this previously 

 

 <apex:inputField id="ABCLOB" value="{!wrapper.ocr.ABC_Line_of_Business__c}" required="true" /> 

the the problem was on the vf page abc line of business was not appearing in a single line 

 

then i came up with this which solved my looking good on the vf page in a single line

 

<apex:pageBlockSectionItem >
<Apex:outputLabel value="ABC Line of Business" style="white-space:nowrap;"></Apex:outputLabel>
<apex:inputField id="ABCLOB" value="{!wrapper.ocr.ABC_Line_of_Business__c}" required="true" />
</apex:pageBlockSectionItem>

 

WIth this i lost my help text on the fields on VF page how to get back help text

 

Thanks 

Akhil

  • September 28, 2012
  • Like
  • 0

I was wondering if there was to lock users from editing Setup->Develop->custom settings I don't see a option anywhere. This does exactly what we want but if any user is able to change the settings its kind of useless. Thanks in advance

Hi All,

 

           i have a custom object oragnaizer__c , i created record types on this object but they are not in functioning mean when i click new button on organizer tab record types which created are not coming....why

 

 

Hi

 

I have added a link to an external webpage on to one of our dashboards using a visual force page,

 

clicking on the link opens the page, however it opens it within the component, can you tell me how to open it in a new window?

 

<apex:page >
<apex:outputLink value="http://developer.force.com">Click me</apex:outputLink>
</apex:page>

Thanks

 

JK

 

 

 

  • September 19, 2012
  • Like
  • 0

Hi all,

 

I was wondering if it was possible to calculate the total change in Close Date somehow from the field history. I know I could do it for future opportunities by invoking some kind of workflow that fires upon Opportunity creation, but I'd like to be able to subtract the first Close Date entered for the Opportunity from the current Close Date to give a total Close Date change for historic data (Opportunities created before I thought to create this workflow). Bear in mind, the Close Date may have changed three or four times, so the "previous" or "old" Close Date is of no use -- it needs to be the first one entered for that Opportunity.

 

Ideally, I'd like the answer to be displayed in months, if possible, and by months I mean actual months (i.e. a move from 31/07/12 to 01/09/12 is two months, even though it's only 31 days).

 

Thanks in advance for any help you can give.

It is sort of available via the user interface, and sort of available via API calls (after v21), and sort of available via reports - but I want to actually query the object directly and drive functionality based on that. Is there any way to do this?

If not, how can I most effectively create and populate a parallel object that allows me to drive this functionality?

 

Thanks!

  • December 26, 2012
  • Like
  • 0

Please note that I don't want to know the interval between logins - I want to know how many minutes (or hours) elapsed between a login and the subsequent logout. Is it possible to calculate this in SFDC, using any combination of technologies?

 

Thanks,

  • December 20, 2012
  • Like
  • 0

I have a client who wants to use Connect For Office to implement some Excel integration with SFDC. On the Connect For Office link (Setup > Desktop Integration > Connect For Office) it says very clearly that this tool does not support Windows 7 or Windows 8, nor Office 2010. Since my client is using Windows 7 and Office 2010, I am a bit concerned about this.

 

Additionally, the cheatsheet (https://cs3.salesforce.com/help/doc/en/salesforce_office_edition_cheatsheet.pdf) clearly states that this tool is only supported for 32-bit systems. (Can you even buy a 32-bit system anymore?)

 

Googling shows that many, many people have asked about this over the past two years, with no official answers from SFDC.

 

Does anyone know if SFDC will be upgrading this tool to support modern versions of the Office or Windows?

 

Thanks,

  • November 27, 2012
  • Like
  • 1

How do SFDC projects fail? Let's start a discussion on the kinds of issues we've seen when designing, developing, and delivering Salesforce. Understanding what CAN go wrong helps us all ensure that risk mitigation plans are in place BEFORE things go wrong.

 

Off the top of my head I've seen:

 

  • A consultant who accidentally deleted all of the Accounts from production
  • A PM who took vacation the week before the implementation was supposed to go live
  • An offshore developer who neglected to mention that she was nine months pregnant and her delivery date was three days before her part of the project was due
  • A director of sales who could not identify what products his company sold

What about you?

  • September 21, 2012
  • Like
  • 0

I have a client who wants to use Connect For Office to implement some Excel integration with SFDC. On the Connect For Office link (Setup > Desktop Integration > Connect For Office) it says very clearly that this tool does not support Windows 7 or Windows 8, nor Office 2010. Since my client is using Windows 7 and Office 2010, I am a bit concerned about this.

 

Additionally, the cheatsheet (https://cs3.salesforce.com/help/doc/en/salesforce_office_edition_cheatsheet.pdf) clearly states that this tool is only supported for 32-bit systems. (Can you even buy a 32-bit system anymore?)

 

Googling shows that many, many people have asked about this over the past two years, with no official answers from SFDC.

 

Does anyone know if SFDC will be upgrading this tool to support modern versions of the Office or Windows?

 

Thanks,

  • November 27, 2012
  • Like
  • 1

Objective:  Sales Reps only See Accounts They Own or Are In Same Role.  

 

Account Security:  Private.

Profile Object Security:  "View All" and "Modify All"  DESELECTED

 

Situation:  I have a group of sales reps that are all in the same role.  Everyone can see each other's records.  From here I want to change the system so each sales rep can only see the account records they own.  I also want to be able to add a read-only user to certain sales reps.  So that read only user will be able to see accounts and contacts belonging to a certain single sales rep.  

 

Plan:  Create a role for each individual salesrep at the same level of the hierarchy.  For the read only user, create a read only profile and assign it the same role for as the desired sales rep.  

 

Source of Confustion (please help):  

 

When i create a new level of the heirarchy it automatically says: "Sharing Groups: Role, Role and Subordinates"  I would assume that means that anyone in that role would be able to see the same records.  

 

However, inorder for the records to be visiable to the two users, I also need to create a sharing setting for that specific role.  this seems wrong.  

 

Can you help?

 


Many Thanks in Advance and Happy Hoildays!  

 

  • December 24, 2012
  • Like
  • 0
Hi I have 6 buttons on my visualforce page Now when I click first button it should get higlighted in colour like wise when i click other buttons they should get highlighted how can i do that

I need the apex code for insert field option that applies in a formula field ...the same functionality on select a value it has to show be the fields in it and at final using insert button it should be inserted 

How to cache logged-in user information(e.g. user profile,userID,country) to current session in salesforce?

How do you deactivate a class that has been pushed to Production?

 

Don't get me wrong I've got some really good unit test results but before I release, I just have gotta ask, if things do go wrong how do I pull back and deactivate a class, a service class, and trigger that have been pushed to production from the force IDE?

 

Thank you,

Steve Laycock

I'm working on part of an account object trigger we've got and keep getting a compile error.  

 

issue is this line

 

                String rddTerritory = userToRddTerritory.get(account.BillingPostalCode);

 

trigger is below.  any ideas how to fix this?

 

 

    // ------------------------------------------------------------------------
    // RDD Territory processing
    // ------------------------------------------------------------------------

 if ((Trigger.isInsert || Trigger.isUpdate) && Trigger.isBefore) {
        
        List<Account> postalCodeAccountsToProcess = new List<Account>();
        List<Account> ownerAccountsToProcess = new List<Account>();
        Set<String> postalCodes = new Set<String>();
        Set<String> ownerIds = new Set<String>();
        
        Id accountRddRecordTypeId = CSUtils.getRecordTypeId('Account', 'RDD');
        
        for (Account account : Trigger.new) {
            if (account.BillingPostalCode != null && account.RecordTypeId != accountRddRecordTypeId) {
                if (Trigger.isInsert || (Trigger.isUpdate && Trigger.oldMap.get(account.Id).BillingPostalCode != account.BillingPostalCode)) {
                    postalCodeAccountsToProcess.add(account);
                    postalCodes.add(account.BillingPostalCode);
                }
            } else if (account.RecordTypeId == accountRddRecordTypeId) {
                if (Trigger.isInsert || (Trigger.isUpdate && Trigger.oldMap.get(account.Id).OwnerId != account.OwnerId)) {
                    ownerAccountsToProcess.add(account);
                    ownerIds.add(account.OwnerId);
                }
            }
        }

        if (postalCodeAccountsToProcess.size() > 0) {
            Map<String, RDD_Territory__c> postalCodeToRddTerritory = new Map<String, RDD_Territory__c>();
            for (RDD_Territory__c  rddTerritory : [select Zip_Code__c, Name from RDD_Territory__c where Zip_Code__c in :postalCodes]) {
                postalCodeToRddTerritory.put(rddTerritory.Zip_Code__c, rddTerritory);
            }
            
            for (Account account : postalCodeAccountsToProcess) {
                String rddTerritory = postalCodeToRddTerritory.get(account.BillingPostalCode);
                
                if (rddTerritory != null) {
                    account.RDD_Territory__c = rddTerritory;
                }
            }         
            
        }

        if (ownerAccountsToProcess.size() > 0) {
            Map<String, String> userToRddTerritory = new Map<String, String>();
            for (User  user : [select Id, RDD_Territory__c from User where Id in :ownerIds and RDD_Territory__c != null]) {
                userToRddTerritory.put(user.Id, user.RDD_Territory__c);
            }
            
            for (Account account : ownerAccountsToProcess) {
                String rddTerritory = userToRddTerritory.get(account.BillingPostalCode);

                if (rddTerritory != null) {
                    account.RDD_Territory__c = rddTerritory;
                }
            }
        }

    }

 

Hi,

I just installed version 1.61 of Milestones PM. I created a new project with milestones & tasks. Whenever I try to change the deadline of a milestone, I get the following error:

Does anyone know how I could fix this?

Thanks!

 

 

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger Milestone1_Milestone_Trigger caused an unexpected exception, contact your administrator: Milestone1_Milestone_Trigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0A6000000DN97PEAT; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Milestone1_Milestone_Trigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0A6000000DN97yEAD; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Milestone1_Milestone_Trigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0A6000000DN98DEAT; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Milestone1_Milestone_Trigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0A6000000DN98IEAT; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Milestone Kickoff must not be earlier than its Predecessor's Deadline.: [Kickoff__c] Class.Milestone1_Milestone_Trigger_Utility.checkSuccessorDependencies: line 103, column 1 Trigger.Milestone1_Milestone_Trigger: line 24, column 1: [] Class.Milestone1_Milestone_Trigger_Utility.checkSuccessorDependencies: line 103, column 1 Trigger.Milestone1_Milestone_Trigger: line 24, column 1: [] Class.Milestone1_Milestone_Trigger_Utility.checkSuccessorDependencies: line 103, column 1 Trigger.Milestone1_Milestone_Trigger: line 24, column 1: []: Class.Milestone1_Milestone_Trigger_Utility.checkSuccessorDependencies: line 103, column 1

Hi,

 

Currently trying to create a list view with roman numerics on a view page. Currently have this code in place:

 

<apex:pageBlockSection id="confsection" collapsible="false" showHeader="true" title="Confirmation" columns="1">
                    <p>The Sponsor confirms that:</p>
                    <!--  STYLE type ="text/css">
                    	ol.withroman {list-style-type: lower-roman}
                    </STYLE-->
                    <BODY>
                    <!-- ol class="withroman"-->
                    <!-- ol type="text/css"-->
                    <ol id="confirm:list">
                    <li id="confirm:list:i"> some text1;</li>
                    <li id="confirm:list:ii"> some text2:</li>
                         <apex:pageBlockSectionItem >
	                    <apex:outputLabel for="meetstandard">
	                         some text; 
	                    </apex:outputLabel>
	                    <apex:inputField value="{!Aform.Afield1__c}" id="meetstandard"/>
	                </apex:pageBlockSectionItem>
	                
	                <apex:pageBlockSectionItem >
	                    <apex:outputLabel for="exceedstandard">
	                         some more text;
	                    </apex:outputLabel>
	                    <apex:inputField value="{!Aform.Afield2__c}" id="exceedstandard"/>
	                </apex:pageBlockSectionItem>
	           <li id="confirm:list:iii"> some text3;</li>
	           <li id="confirm:list:iv"> some text4.</li>	                
                    </ol>
                    </BODY>
                 </apex:pageBlockSection>     

 

Unfortunately it displays incorrectly. The first two points show as 1. and 2. then displays the two check boxes and then the last two points are displayed in bullets.

 

Any ideas?

Person who did this is gone, everthing works in this Apex Class but the referred PDF does not show Account, Account Contacts or custom field Age__c information, Case Request auto number appears and so does Shopping_List_Notes__c.

 

Need Account, Contacts, Ages to populate.

 

public class GroceryUpdate {
//VERSION 1: SORT GROCERY LIST BY CATEGORY
//  PDF: INCLUDE THE Contact/Account Name
//  Account Members Ages
//VERSION 2: CHANGE QUANTITY TO INTEGER TO REMOVE DECIMAL POINT
//VERSION 3: GET TYPE OF FOOD ORDER and SHOPPING NOTES FROM REQUEST (CASE)
  
  Case request;
  //Name crequest;
  List <Grocery_Request__c> GRList;
  List <Name> AList;
  //List <Account> atmplist;
  Account aMembers;
  Set<Id> GItemIdSet           = new Set<Id>();
  Set<Id> gIdSet             = new Set<Id>();
  Map<Id,wGrocery> gMap         = new Map<Id,wGrocery>();
  Map<Integer,Id> gSortMap       = new Map<Integer,Id>();
  Map<Integer,wGrocery> pdfGSortMap   = new Map<Integer,wGrocery>();
  Map<Id,Integer> pdfIdxMap       = new Map<Id,Integer>();
  List<wGrocery> gList         = new List<wGrocery>();
  List<Grocery_Item__c> gItemList;
  List<Grocery_Item__c> pdfGItemList;
  String Aid;
  String AName;
  // Contact c;     //LG
  
//****************
// CONSTRUCTOR
//****************
  
  public GroceryUpdate() {
    Integer idx = 0;
    
    //VERSION 1: SORT BY CATEGORY AFTER WAREHOUSE ORDER
    pdfGItemList = [Select g.Warehouse_Order__c, g.Name, g.Id, 
      g.Grocery_Category__c, g.Available__c 
      From Grocery_Item__c g
      order by Warehouse_Order__c, Grocery_Category__c, Name ASC nulls last
      limit 1000];

    for (Grocery_Item__c gi : pdfGItemList) {
      pdfGSortMap.put(idx,new wGrocery(gi));
      pdfIdxMap.put(gi.id,idx);
      idx++;
    }
    system.debug('@@@pdfGSortMap=' + pdfGSortMap);
    system.debug('@@@pdfIdxMap=' + pdfIdxMap);
    
    //VERSION 1: SORT BY CATEGORY AFTER AVAILABLE
    gItemList = [Select g.Warehouse_Order__c, g.Name, g.Id, 
      g.Grocery_Category__c, g.Available__c 
      From Grocery_Item__c g
      order by Available__c, Grocery_Category__c, Name ASC nulls last
      limit 1000];
    
    idx = 0;
    String s = null;
    String oldHighlight = '#BDBDBD';
    
    for (Grocery_Item__c gi : gItemList) {
      gMap.put(gi.id,new wGrocery(gi));
      
      if (gi.Grocery_Category__c != s ) {
        s=gi.Grocery_Category__c;
        if (oldHighlight == null) oldHighlight = '#BDBDBD';
        else oldHighlight = null;
      }
      
      gMap.get(gi.id).highlight = oldHighlight;
      
      if (gi.Available__c == true) {
        gSortMap.put(idx,gi.id);
        idx++;
      }
    }
    
    for (Grocery_Item__c gi : gItemList) {
      if (gi.Available__c == false) {
        gSortMap.put(idx,gi.id);
        idx++;
      }
    }
    
    //VERSION 3: GET Type_of_Food_Order__c and Shopping_List_Notes__c
    
    //request = [Select c.Id, c.Subject, c.Contact.Name, c.ContactId, c.CaseNumber,
    //  c.Type_of_Food_Order__c, c.Shopping_List_Notes__c,  
    //  (Select Id, IsDeleted, Name, Request__c, Grocery_Item__c, Quantify__c 
    //    From Grocery_Requests__r) 
    //  From Case c
    //  where id = :ApexPages.currentPage().getParameters().get('id')];
    
    //GRList = request.Grocery_Requests__r;
    //system.debug('@@@GRList=' + GRList);

    //for (Grocery_Request__c GR : GRList) {
    //  gMap.get(GR.Grocery_Item__c).quantity = GR.Quantify__c.intValue();
    //  gIdSet.add(GR.Grocery_Item__c);
      
    //  pdfGSortMap.get(pdfIdxMap.get(GR.Grocery_Item__c)).quantity = GR.Quantify__c.intValue();
    //}
    
    request = [Select c.Id,c.Account, c.Subject, c.Name, c.ContactId, c.CaseNumber,
      c.Type_of_Food_Order__c, c.Shopping_List_Notes__c,  
      (Select Id, IsDeleted, Name, Request__c, Grocery_Item__c, Quantify__c 
        From Grocery_Requests__r) 
      From Case c
      where id = :ApexPages.currentPage().getParameters().get('id')];
    Aid=request.Account;
    GRList = request.Grocery_Requests__r;
    
    system.debug('@@@GRList=' + GRList);

    for (Grocery_Request__c GR : GRList) {
      gMap.get(GR.Grocery_Item__c).quantity = GR.Quantify__c.intValue();
      gIdSet.add(GR.Grocery_Item__c);
      
      pdfGSortMap.get(pdfIdxMap.get(GR.Grocery_Item__c)).quantity = GR.Quantify__c.intValue();
    }
    
    //if (Aid<>''){
      Account[] AL=[Select a.name,(select name, age__c,Order by age__c desc) from Account a where id=:request.Account];
      If (AL.size()>0){
        AName=AL[0].name;
        If (AL[0].Contacts__r.size()>0){
          AList=AL[0].__r;
        }
        
      }
      
      
      //ctmplist=[Select name,(select name, age__c from Account.Contacts__r) from Account where id=:request.Account];
       //if (ctmplist[0].Contacts__r.size() > 0){
        
      
      //}
        
      //AList=ctmplist[0].Contacts__r;
    //}
    
    
    //AList=[Select name, age__c from Contact where Account like '%a0fA00000022ltLIAQ%'];
    
  
    
    
    //VERSION 1: GET Contact INFO
    // a = [Select a.Social_Security_Number__c, a.SC_Photo_ID__c, a.Name, a.Id,    LG
    //  From Contact a
    //  where id = :request.ContactId
    //  limit 1];
      
  }
  


//**************************
// GETTER AND SETTER METHODS
//**************************
  
  //VERSION 1: GET CONTACT INFO
  //public Contact getContact(){return a;}    //LG
  public Case getRequest(){return request;}
  public List<wGrocery> getpdfGRItemList() {
    List<wGrocery> pdfGRItemList = new List<wGrocery>(); 
    for (Integer i = 0; i<pdfGSortMap.size(); i++) {
      if (pdfGSortMap.get(i).quantity > 0) pdfGRItemList.add(pdfGSortMap.get(i));
      
    }
    return pdfGRItemList;
  }
  
  public List<Account> getCHList() {
    return CHList;
  }
  
  public string getHName(){
    return HName;
  }
  
  public List<wGrocery> getGList(){
    List<wGrocery> displayGList = new List<wGrocery>();
    for (Integer idx = 0; idx<gSortMap.size(); idx++) {
      displayGList.add(gMap.get(gSortMap.get(idx)));
    }
    return displayGList;
  }
  
  public void setGList(List<wGrocery> GList){
    for (wGrocery gr : GList) gMap.put(gr.GI.id,gr);
  }
  
  public pageReference save() {
    List<Grocery_Request__c> insertGList = new List<Grocery_Request__c>();
    
    for (Grocery_Request__c gr : GRList) gr.Quantify__c = GMap.get(gr.Grocery_Item__c).quantity;
    if (GRList.size()>0) update GRList;
    
    for (wGrocery wGr : GMap.values()) {
      if (wGr.quantity > 0 && gIdSet.contains(wGr.GI.Id)== false) {
        Grocery_Request__c gr = new Grocery_Request__c(Request__c=request.id, 
          Grocery_Item__c=wGr.GI.Id, Quantify__c=wGr.quantity);
        
        insertGList.add(gr);
      }
    }
    
    if (insertGList.size()>0) insert insertGList;
    
    
    PageReference pRef = new PageReference('/' + ApexPages.currentPage().getParameters().get('id'));
    pRef.setRedirect(true);
    return pRef;
    
  }
//************
//PAGE METHODS
//************

  public pageReference cancel() {  
    
    PageReference pRef = new PageReference('/' + ApexPages.currentPage().getParameters().get('id'));
    pRef.setRedirect(true);
    return pRef;
    
  }

  public pageReference pdfPage() {  
    
    PageReference pRef = page.GroceryUpdatePDFPage;
    pRef.getParameters().put('id',ApexPages.currentPage().getParameters().get('id'));
    pRef.setRedirect(true);
    return pRef;
    
  }
  
  //WRAPPER CLASS FOR GROCERY
  public class wGrocery{
    public Integer quantity {get; set;}
    public Grocery_Item__c GI {get; set;}
    public String highlight {get;set;}
           
    public wGrocery(Grocery_Item__c GI){
      quantity = 0;
      this.GI = GI;
      highlight=null;
    }
  }
  
  //TEST METHOD    
  static testMethod void T1() {
    //
    Grocery_Request__c qGR = [Select Id, IsDeleted, Name, Request__c, Grocery_Item__c, Quantify__c 
        From Grocery_Request__c
        where IsDeleted = false
        and Grocery_Item__c != null 
        limit 1];
        
    Case qRequest = [Select c.Id, 
      (Select Id, IsDeleted, Name, Request__c, Grocery_Item__c, Quantify__c 
        From Grocery_Requests__r) 
      From Case c
      where id = :qGR.Request__c
      limit 1];
      
      //INITIALIZE PAGE AND STANDARD CONTROLLER      
      PageReference pageRef = Page.GroceryUpdatePage;
      Test.setCurrentPageReference(pageRef);
      ApexPages.currentPage().getParameters().put('id', qRequest.Id);    
 
     GroceryUpdate stdCon = new GroceryUpdate();
     
    Case tgetRequest = stdCon.getRequest();
     List<wGrocery> tgetGList = stdCon.getGList();
     stdCon.setGList(tgetGList);
    List<wGrocery> tgetpdfGItemList  = stdCon.getpdfGRItemList();
     pageReference tpref = stdCon.save();
    tpref = stdCon.cancel();
    tpref = stdCon.pdfPage();
    // Account tA = stdCon.getAccount();
  }  
}

Im trying to create a VF Component and it keeps throwing me this error.

 

Error: Unknown property 'MultiSelectComponentController.options'

 

Thanks for the help, 

hkp716

 

Heres my component:

 

<apex:component controller="MultiSelectComponentController">
<apex:attribute name="AvailableList" type="selectOption[]" description="Available List from the Page" assignTo="{!options}" required="true"/>
<apex:attribute name="ChosenList" type="selectOption[]" description="Chosen List from the Page" assignTo="{!selectedOptions}" required="True"/>
<!-- <apex:attribute name="AvailableTitle" type="String" description="Title for Available List" assignTo="{!selectedTitle}"/> -->
<!-- <apex:attribute name="ChosenTitle" type="String" description="Title for Chosen List" assignTo="{!deSelectedTitle}"/> -->

<apex:outputPanel id="panel">
<apex:pageBlockSection columns="4" >
<apex:selectList multiselect="true" size="5" value="{!selected}" >
<apex:selectOptions value="{!options}" />
<apex:actionSupport event="ondblclick" action="{!selecting}" rerender="panel" status="waitingStatus" />
</apex:selectList>
<apex:pageBlockSection columns="1">
<!-- <apex:outputText value="{!selectedTitle}" /> -->
<apex:commandButton reRender="panel" id="select" action="{!selecting}" value=">" status="waitingStatus"/>
<!-- <apex:outputText value="{!delectedTitle}" /> -->
<apex:commandButton reRender="panel" id="deselect" action="{!deselecting}" value="<" status="waitingStatus"/>
</apex:pageBlockSection>
<!-- An action status to show that the operation of moving between the lists is in progress--->
<apex:actionStatus id="waitingStatus" startText="Please wait..." stopText=""/>
<apex:selectList multiselect="true" size="5" value="{!deselected}">
<apex:selectOptions value="{!selectedOptions}"/>
<apex:actionSupport event="ondblclick" action="{!deselecting}" rerender="panel" status="waitingStatus"/>
</apex:selectList>
</apex:pageBlockSection>
</apex:outputPanel>
</apex:component>

 

 

  • November 20, 2012
  • Like
  • 0

Hi Team,

 

I want to create a validation that only current year and next year values can be created on a object,

 

I am trying in with below way, but it is showing error Missig )'

 

OR (
YEAR(Sales_Plan__c ) <> YEAR (today().year() ),
YEAR(Sales_Plan__c ) <> YEAR (today().year() + 1 )
)

 

Can any one help me on the same

  • November 20, 2012
  • Like
  • 0

Hi,

 

We are getting the error below in a visualforce page because we have exceeded the API limit.

How can we use/visualize the page again? Should we contact salesforce support?

 

 

Uncaught {faultcode:’sf:REQUEST_LIMIT_EXCEEDED’, faultstring:’REQUEST_LIMIT_EXCEEDED: TotalRequests Limit exceeded.’, detail:{UnexpectedErrorFault:{exceptionCode:’REQUEST_LIMIT_EXCEEDED’, exceptionMessage:’TotalRequests Limit exceeded.’, }, }, }

 

 

Many Thanks,

Altran

 

 

 

  • November 20, 2012
  • Like
  • 0

Hello everyone,

 

I am facing problem with exposing the salesforce events and calender to the customer portal as a tab.

I think it's not possible for now.

Still I am in doubt.

 

Please share you opinion on this.

 

Thanks,

Smarjit Debata

  • November 20, 2012
  • Like
  • 0
I have to write a script to synchronize some data in salesforce with our MIS. This should be done when new records are inserted or existing records are edited on both sides. Therefore I have a new field Synced__c which holds the timestamp of the last synchronisation with our MIS.
To get all changed records wouldn't be any great problem for someone who knows SQL (and really isn't a problem in our MIS):

select [...] where SystemModstamp > Synced__c

Unfortunately this doesn't work in salesforce because I cannot use fieldnames on the right side of logical statements - I was told that in another thread and the solution was to use an Apex Trigger to set Synced__c = null when the record was modified so that I can write

select [...] where Synced__c = null

So I prepared the whole synchronisation skripts tested it in my testaccount and when I wanted to go live it doesn't work because we have a "Professional Edition+API" which doesn't support Apex Triggers. **bleep**!

After being miffed for two months with the support which only has the solution to upgrade to a Developer Account I'm opening that thread (should have done that before!). Has anyone an idea how to get this working WITHOUT upgrading to a Developer Account?
Parameters are:
- Select all records that have been modified since they were synchronized the last time
- Timestamp of synchronisation ist stored per record in Synced__c
- Synced__c will be updated from my script when synchronized - that works anyway

This thing is getting me mad...

Can we modify appexchange code as per our requirement after installing it. 

 

 

 

  • November 20, 2012
  • Like
  • 0

HOW TO CREATE TREEVIEW IN VISUALFORCE  LET ME KNOW PLZ

Hello,

 

I've just hit the 1000 VF record limit on a page where I pull all my organization's accounts, to then tie them to contacts.

 

The page is used to organize a heirarchy of our client portfolios, so that my employees can easily tie descision makers to the proper accounts. For instance, if the client has a regional and local manager, the regional manager would be tied to 100 accounts, and the local manager tied to only 1 or 2 accounts. 

 

Right now, we have a custom field on an Account called Billing Contact. This is the contact related to that location. 

 

In our Org, we have a very accurate Parent/Child account hierarchy. For instance, if Hilton Hotels was a client of ours, there is a 'Hilton Parent' account, and then hundreds/thousands of Accounts that have 'Hilton Parent' account listed as their parent. Also, contacts are only ever listed as Billing Contacts in one hierarchy structure. For instance, 'Jane Doe' is never going to be listed as the Billing Contact for a Marriot Hotel, or any other account outside the Hilton Parent/Child tree.

 

So here is what I'd like to do, but given my generally poor SOQL knowledge, I'm struggling:

 

1) Find an Account that the contact is listed as the BIlling Contact for. 

2) Find the Parent Account of that Account

3) Display ALL child accounts of that parent account. 

 

If anyone has an example to lead me towards, I'd appriciate it! 

 

Charlie

  • November 19, 2012
  • Like
  • 0

I have developed a custom button that executes JavaScript that queries the QuoteLineItem standard object.   This custom button has been included in a managed package, and distributed to a client.  The client reports that the custom button is throwing an "INVALID_TYPE: sObject 'QuoteLineItem' is not supported." error message.  Any idea why this error occurs?  They have enabled quotes and it does not occur on several other SFDC accounts.

 

Thank you.

Hi All, does anyone know if its possible to do a select from one salesforce org to the other?

 

So for example an account is shared from org1 to org2 could i then run a trigger on org2 to select all related opportunities on that account from org1? and then get org1 to share them with org2?

 

thanks all

 

 Hi,

 

Will salesforce allow "null" values for External ID and Unique fields.

 

Thanks