• turbo2oh
  • NEWBIE
  • 5 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 1
    Likes Given
  • 20
    Questions
  • 37
    Replies
I've tried importing 2 of the sample projects into xcode generated via 'forceios create samples'. They both have the same 5 errors when I try to build the project.

Here's an example of one: 
Apple Mach-O Linker Error "_OBJC_CLASS_$_SFKeyStoreManager", referenced from:

objc-class-ref in libSalesforceOAuth.a(SFOAuthCredentials.o)

It then has several very similiar ones for SFPasscodeManager, SFSDKCryptoUtils, _kSFPassCodeProviderPBKDF2, and the last is Linker command failed with excit code 1.

Any suggestions on how to fix this? I've tried removing and re-adding the www folder as suggested in a read.me file.

I'm using custom VF for all my community pages. One of these is the registration page. Currently the user fills out the registration form, the controller creates their account, contact, and user. They then receive an email, click the link and it takes them to the change password page, they change their password and they're in.

 

I'd like to skip the email link step. I'd like to allow the user to register, then go directly the the change password page. 

 

The link in the welcome email looks something like (https://<mysite>.force.com/landing/login?<longstringofchars>) I'm assuming this <longstringofchars>  an authentication token. 

 

Is there any way for me to replicate this link and simply direct the user to it immediately after registering without forcing them to go to their email first?

 

Thanks!

Using the new Customer Community License, is it possible to add that user to a Chatter Group? They're not showing up in the user list. 

 

Alternatively, is there any way to have a non-public chatter conversation in the Community with the Customer Community license?

I've created a new list view for Contacts and made it available to all Users. When I run .getListViewOptions() it only returns 'All'. I'm also logged in as the admin user. Any idea why no others are showing up?

 

public class Ctl_CreateContactsForms {

    public ApexPages.StandardSetController setCtrl{get; set;}
    public string filterOption {get;set;}
    
    public Ctl_CreateContactsForms () {
    	setCtrl = new ApexPages.StandardSetController(Database.getqueryLocator([Select Id,Name FROM Contact]));
 		setCtrl.setPageSize(5); 		
    }  
	
	public list<SelectOption> getallListViewOptions () {
		system.debug('setCtrl.getListViewOptions()'+setCtrl.getListViewOptions());
		return setCtrl.getListViewOptions();
	}
	
    // Initialize setCon and return a list of records
    public List<Contact> getcontactList() {
        return (list<Contact>) setCtrl.getRecords();
    }
}

 

Could someone please explain the difference between the salesforce mobile SDK and the new mobile packs? I understand the mobile packs are geared towards specific frameworks but what are the uses cases for each? 

 

Thanks!

Has anyone created a hybrid mobile app without utilizing jquery mobile or remoteAction? I know the AJAX calls will make it seem much more native but I'd like to test without it.

 

Right now I've setup a responsive VF page with twitter bootstrap. Couldn't I just use a template app and point bootconfig.js to my VF page and thats it? Does anyone with more experiene have any suggestions? Input?

 

Thanks! 

What is wrong with this syntax inside a before insert/before update trigger please?

 

set <id> locationIds= new set<id>{ trigger.newMap.keySet()};

 

 

I'm getting the error: Invalid initial value type SET<Id> for SET<Id> which isn't very helpful. I'm just trying to define a variable name for the trigger.newMap.keySet() so its more readable.

I have a force.com external site page. My idea is after the user is done the task I want them to have the ability to return to the beginning and do it again. To do this I'm trying to refresh the current page and re-run the constructor so they'll see the new information they had just added.

 

I have following button:

<apex:commandButton styleClass="btn  btn-large" action="{!cancelThis}"	value="Add/Edit More Sites" />

 That launches this method that should be returning to the same page and refreshing it after re-inserting the URL paremeters:

 

public PageReference cancelThis() {
		PageReference currPage1 =  new PageReference('http://MYSITE.COM/MYVFPAGE');
		currPage1.getParameters().put('accountId',urlAccountId);
		currPage1.getParameters().put('contactId',urlContactId);
		currPage1.setRedirect(true);
		return currPage1;
	}

 

The issue I'm running into is its not re-running the constructor. I have a debug statement at the top of my constructor that doesn't show up when cancelThis() runs. If I manually refresh the page after the 'redirect' it does.

 

Any idea why the constructor isn't re-running when I'm setting redirect=true? Is it because it knows its going back to itself instead of a new page?

 

Thanks!

Is there a difference between installing the Force.com IDE vs. installing eclipse seperately and then installing the force.com IDE plugin? I'm currently using the Force.com IDe standalone, but having issues with syntax highlight in visualforce I heard was fixed in newer versions of eclipse.

 

http://wiki.developerforce.com/page/Force.com_IDE_Installation

 

If it is preferred to install eclipse then install the plugin for force.com? If so, which version of eclipse should I be using?

After reviewing this page: http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_image.htm I've found that isn't holding true in my situation for some example.

 

When I set the id attribute of an apex:image it is adding a prefix to the id. I thought I had found away around this awhile ago but I can't seem to remember what it is. Is there a way to get the id in the rendered html to be the same as the one I set in the apex:image tag?

 

Thanks!

I've encountered an odd issue. 

 

I seem to be able to query owner.alias and owner.custom_field__c on the Contact object.

 

I'm also able to query owner.alias on the Event object. However, I'm unable to query owner.custom_field__c on the Event object.

 

Does anyone have an idea why this is? Obviously the relationship is in place because I'm able to pull through other fields via the owner relationship just not custom fields on Event owners.

 

Any help is appreciated!

I have a large app that is being pushed out into a production environment. It will live alongside many other existing apps. Is there a best practice order of deployment? I haven't been able to find one.


I'm looking for something like

Custom Object Fields -> Page Layouts -> Apex Classes -> VF Pages


Any help is appreciated!


Thanks!

I have a standard object page with an embedded visualforce section. I've written CSS for tooltip type functionality (when the user hovers over text it displays another div). The problem is the div is larger than the visualforce page section and it is being cropped off once it overflows outside of the visualforce section.

 

I've tried playing with overflow and z-index and no such luck so far. Any ideas?

Is there any way to get a chatter plus user to be able to view Opps. ex. through a report run on Opps?

 

Thanks!

I'm developing a VF email template and I'm showing various related list info via the relatedTo field for an Account but want to limit the number of records shown. Is this possible?

 

Example code

 

<messaging:emailTemplate subject="Call Report" recipientType="User" relatedToType="Account">

  #lots of other stuff here

 

<apex:outputpanel rendered="{!!ISBLANK(relatedTo.Contacts)}">
        <h2>Contacts</h2>
        <apex:dataTable var="c" value="{!relatedTo.Contacts}" columnClasses="columnheaders">
             <apex:column headerValue="Name">{!c.Name} {!c.Suffix__c}</apex:column>
             <apex:column headerValue="Title">{!c.title}</apex:column>
             <apex:column headerValue="Email">{!c.email}</apex:column>
             <apex:column headerValue="Phone">{!c.phone}</apex:column>
        </apex:dataTable>
    </apex:outputpanel>

 Thanks!

I'm trying to use a VF email template in conjuction with a button on the Contact detail page to launch an email template prepopulated with various Contact fields. I've already done this successfully with Opportunities but I can't get it to work with Contacts.

 

I'm getting the error:

The value of the "p3_lkid" parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information. 

 

The parameters I'm passing are:

/_ui/core/email/author/EmailAuthor?
&rtype=00Q 
&p24=test@test.com
&p3_lkid={!Contact.Id}
&retURL=%2F{!Contact.Id}
&template_id=00XE0000000Ydm5


I've tried rtype=003 as well since thats what most people use. Though the only difference is hiding or showing the related to field I believe. Apparently, it won't accept  contact ID in the p3_lkid parameter. It doesn't seem to have an issue getting an Opportunity ID.

 

Has anyone else encountered this? Is there any other way I can get the contact object in there in a way I can reference it? I've been able to reference it when I put it in the To: field using p2_lkid, but I don't want to actually send it to the Contact.


Thanks!

Hi All:

 

I'm trying to capture the onclick event for the current date text link on a date inputfield. The issue I'm having is if I place the onclick event on the inputfield it applies to the generated text field in the HTML but not the link with the current date. Is there a way to get an onclick event on the generated date text link?

 

Thanks!

 

I have a list of objects and I need to be able to remove a specific object from the list. I've been trying to remove it by the ID or the object itself but neither seem to be working. 

 

I've seen it suggested on here that the best practice is to just move everything to a new list and exclude the unwanted object, but this list can be changed as many times as the user changes their mind which could get ugly fast. Is there no better solution?

 

Thanks!

Phil

I have a tab panel with iframes for each tab. After a lookup field is selected I want to render hidden content within the iframe.  It toggles the hidden outputpanel to visible correctly but it will break out of the frame and no longer show the tabs at the top. Any ideas what might be causing this?

 

To test I'm simply using <apex:actionSupport event="onchange" action="{!testView}"/> on a inputfield lookup.

 

The testview method just toggles a boolean 'showit) to true to display:

 

<apex:outputPanel rendered="{!showit}">test1</apex:outputPanel>

 

It then appears correctly but I've lost my tabs.

I'm trying remove the delete functionality from the quote pdf preview. To do this I'm trying to recreate the functionality in a VF page. I'm having a hard time recreating the preview functionality. I've found this function /jslibrary/1320195877000/Quote.js but not sure if thats what I should be using or what arguments its expecting.

 

I've also tried using this:

 javascript&colon; var pdfOverlay = QuotePDFPreview.quotePDFObjs['quotePDFOverlay2'];pdfOverlay.dialog.buttonContents = '&lt;input value=\&quot;Email Quote\&quot;  class=\&quot;btn\&quot; name=\&quot;emailQuote\&quot; onclick=\&quot;javascript&colon;navigateToUrl(\'/_ui/core/email/author/EmailAuthor?p2_lkid=00190000003iCaY&amp;amp;rtype=003&amp;amp;p3_lkid=0Q0900000004H5G&amp;amp;doc_id=0QD900000004CTm&amp;amp;retURL=%2F0Q0900000004H5G\',\'RELATED_LIST\');\&quot; title=\&quot;Email Quote\&quot; type=\&quot;button\&quot; /&gt;&lt;input value=\&quot; Close \&quot;  class=\&quot;btn\&quot; name=\&quot;close\&quot; onclick=\&quot;QuotePDFPreview.quotePDFObjs[\'quotePDFOverlay2\'].close();\&quot; title=\&quot;Close\&quot; type=\&quot;button\&quot; /&gt;';
pdfOverlay.setContents('/servlet/servlet.FileDownload?file=0QD900000004CTm');
pdfOverlay.display();
"

 Unfortunately I'm getting  a jscript error Cannot read property 'dialog' of undefined

 

Any ideas? Has anyone done this before?

I've tried importing 2 of the sample projects into xcode generated via 'forceios create samples'. They both have the same 5 errors when I try to build the project.

Here's an example of one: 
Apple Mach-O Linker Error "_OBJC_CLASS_$_SFKeyStoreManager", referenced from:

objc-class-ref in libSalesforceOAuth.a(SFOAuthCredentials.o)

It then has several very similiar ones for SFPasscodeManager, SFSDKCryptoUtils, _kSFPassCodeProviderPBKDF2, and the last is Linker command failed with excit code 1.

Any suggestions on how to fix this? I've tried removing and re-adding the www folder as suggested in a read.me file.

Using the new Customer Community License, is it possible to add that user to a Chatter Group? They're not showing up in the user list. 

 

Alternatively, is there any way to have a non-public chatter conversation in the Community with the Customer Community license?

I've tried importing 2 of the sample projects into xcode generated via 'forceios create samples'. They both have the same 5 errors when I try to build the project.

Here's an example of one: 
Apple Mach-O Linker Error "_OBJC_CLASS_$_SFKeyStoreManager", referenced from:

objc-class-ref in libSalesforceOAuth.a(SFOAuthCredentials.o)

It then has several very similiar ones for SFPasscodeManager, SFSDKCryptoUtils, _kSFPassCodeProviderPBKDF2, and the last is Linker command failed with excit code 1.

Any suggestions on how to fix this? I've tried removing and re-adding the www folder as suggested in a read.me file.

I've created a new list view for Contacts and made it available to all Users. When I run .getListViewOptions() it only returns 'All'. I'm also logged in as the admin user. Any idea why no others are showing up?

 

public class Ctl_CreateContactsForms {

    public ApexPages.StandardSetController setCtrl{get; set;}
    public string filterOption {get;set;}
    
    public Ctl_CreateContactsForms () {
    	setCtrl = new ApexPages.StandardSetController(Database.getqueryLocator([Select Id,Name FROM Contact]));
 		setCtrl.setPageSize(5); 		
    }  
	
	public list<SelectOption> getallListViewOptions () {
		system.debug('setCtrl.getListViewOptions()'+setCtrl.getListViewOptions());
		return setCtrl.getListViewOptions();
	}
	
    // Initialize setCon and return a list of records
    public List<Contact> getcontactList() {
        return (list<Contact>) setCtrl.getRecords();
    }
}

 

I am using remote action method to call the method from script.But its not working.

 

Here is my code:

 

VF page:

<apex:page controller="remotingController" sidebar="false" showHeader="false" standardStylesheets="false">
<apex:includescript value="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"/>

<script>
function Save(){
var textvalue = $('.texts').text();
remotingController.renameAlert(textvalue);
return false;
}
</script>

<apex:form >
<div class = "position">
<apex:outputLabel value="TextInput"></apex:outputLabel>
<apex:inputText styleclass = "texts" style="margin-left:30px;" />
<button onclick="Save();">Save </button>
</div>
</apex:form>
</apex:page>

 

Class:

global without sharing class remotingController  {
    public remotingController(){
    }
    
  @RemoteAction  
   global static void  renameAlert(string text){ 
       system.debug(':::::::text:::::::::::');
   }

}

 

 

Could someone please explain the difference between the salesforce mobile SDK and the new mobile packs? I understand the mobile packs are geared towards specific frameworks but what are the uses cases for each? 

 

Thanks!

Hi All, 

 

 I am crating a new package, once the package is installed, I would like to run the post install script that should automatically add the custom List buttons to the Search Layouts for the objects(Custom/Standard). Please post any idea to accomplish this. 

 

An Immediate help would be greately helpful. 

  • January 03, 2013
  • Like
  • 0

Hi,

 

I have a trouble while using Ajax Toolkit in my javascript.

 

My desire is to connect to another salesforce org from the currently logged in org.

 

for this, below is the javascript code that i am making use of

<script src="../../soap/ajax/25.0/connection.js" type="text/javascript"></script>

<script type="text/javascript">
window.onload = synchronousCall;
function synchronousCall(){
	try{
		var result = sforce.connection.login("username","**password***securitytoken***");
		alert(sforce.connection.serverUrl);
		alert(result.sessionId);	
	}
	catch(error){
		alert(error);
	}
}

 This code works absolutely fine, when the salesforce instance of currently logged in org is same as that of the org which is required to be connected.

 

But it gives the following exception, when the instances are different.

 

{faultcode:'sf:INVALID_LOGIN', faultstring:'INVALID_LOGIN: Invalid username, password, security token; or user locked out.', detail:{LoginFault:{exceptionCode:'INVALID_LOGIN', exceptionMessage:'Invalid username, password, security token; or user locked out.', }, }, }

 

Please let me know if i am missing something.

 

Anticipating your help

Thanks in advance

 

 

What is wrong with this syntax inside a before insert/before update trigger please?

 

set <id> locationIds= new set<id>{ trigger.newMap.keySet()};

 

 

I'm getting the error: Invalid initial value type SET<Id> for SET<Id> which isn't very helpful. I'm just trying to define a variable name for the trigger.newMap.keySet() so its more readable.

I have a force.com external site page. My idea is after the user is done the task I want them to have the ability to return to the beginning and do it again. To do this I'm trying to refresh the current page and re-run the constructor so they'll see the new information they had just added.

 

I have following button:

<apex:commandButton styleClass="btn  btn-large" action="{!cancelThis}"	value="Add/Edit More Sites" />

 That launches this method that should be returning to the same page and refreshing it after re-inserting the URL paremeters:

 

public PageReference cancelThis() {
		PageReference currPage1 =  new PageReference('http://MYSITE.COM/MYVFPAGE');
		currPage1.getParameters().put('accountId',urlAccountId);
		currPage1.getParameters().put('contactId',urlContactId);
		currPage1.setRedirect(true);
		return currPage1;
	}

 

The issue I'm running into is its not re-running the constructor. I have a debug statement at the top of my constructor that doesn't show up when cancelThis() runs. If I manually refresh the page after the 'redirect' it does.

 

Any idea why the constructor isn't re-running when I'm setting redirect=true? Is it because it knows its going back to itself instead of a new page?

 

Thanks!

Hi All,

This is driving me round the bend and I think i need a new perspective on it if at all possible?

My trigger has been designed to catpure very high level product information from a custom object and create an opportuntiy invoice with an associated price book and line items.

The trigger works every time on the sandbox and I really have put it through its paces hower I simply cannot get my Test Class to run

Trigger Code:

trigger insertNewOpportunity on Items_Used__c (before insert) {
// Create Variables
List<Opportunity> listOppor = new List<Opportunity>();
List<OpportunityLineItem> oliList = new List<OpportunityLineItem>();
Set<Id> SetAccId = new Set<Id>();
 
// Create Opportunity If required
if(trigger.New[0].RelatedTo__c != null) {
  Opportunity[] exOppo = [SELECT Id from Opportunity where Customer_Ref__c = :Trigger.New[0].RelatedTo__c]; // Find an Opportunity with the same Customer Reference as the product being inserted
  
    if(exOppo.IsEmpty()){ // If no Opportunity exisits for this record
      for(Items_used__c item : Trigger.new){      
        if(item.Account__c != null){ 
          Opportunity OppNew = new Opportunity(Customer_Ref__c = item.RelatedTo__c,AccountId = item.Account__c,StageName = 'Closed Won',CloseDate = System.today(),Type = 'Existing Business',Name = 'Invoice for Visit' +' '+ item.RelatedTo__c, RecordTypeID = '01220000000UWCK',Division__c = item.Division__c,Amount = 0.00,Quote_Due_By__c = System.today(),Referred_By__c = item.ReferredBy__c,LeadSource = 'Technician Sale');
         listOppor.add(OppNew);          
        }
       insert listOppor;  // Create Opportunity 
      }
    }
}
// Insert Opportunity Line Items
 for(Items_used__c lineitem : Trigger.new){ // For all the items being inserted
  List<PriceBook2> pbook = new List<PriceBook2>();
  if((lineitem.Account__c != null) && (lineitem.RelatedTo__c != null)){
  SetAccId.add(lineitem.Account__c);
   Map<Id, Account> MapAccount = new Map<Id, Account>([select Division__c, Price_Band__c from Account where Id IN :SetAccId]);
   if(MapAccount.get(lineitem.Account__c).Price_Band__c != null){ // If the Price Band picklist for the Account is not Empty
    pbook = [Select Id from PriceBook2 where Name = :MapAccount.get(lineitem.Account__c).Price_Band__c]; 
   } // Else if the Division picklist for the Account is one of the following:
   else if(lineitem.Division__c == 'Pest'){ pbook = [Select Id from PriceBook2 where Id = '01s20000000PuSW'];} // Select the Pest Division Standard Price Book
   else if(lineitem.Division__c == 'Fire') { pbook = [Select Id from PriceBook2 where Id = '01s20000000Pz7tAAC'];} // Select the Fire Division Standard Price Book
   else if(lineitem.Division__c == 'Water') { pbook = [Select Id from PriceBook2 where Id = '01s20000000PvJCAA0'];} // Select the Pest Division Standard Price Book
   List<PriceBookEntry> pbe = new List<PriceBookEntry>(); // Get the Price Book Id
   pbe = [select Id, Pricebook2Id, UnitPrice from PriceBookEntry where Name = :lineitem.Item_Used__c AND PriceBook2Id = :pbook[0].Id];
   List<Opportunity> Opp = New List<Opportunity>(); // Get the related Opportunity Record
   Opp = [Select Id from Opportunity where Customer_ref__c = :lineitem.RelatedTo__c];
   Double q = Double.valueOf( lineitem.Quantity__c ); // Change the QTY Picklist to a numeric
   // Add all the Line item information to the List
   OpportunityLineItem oli = new OpportunityLineItem (OpportunityId = Opp[0].Id,PricebookEntryId = pbe[0].Id,Quantity = q, UnitPrice = pbe[0].UnitPrice);
   oliList.add(oli);
   insert oliList; // Insert the Line Item
   }  
 } 
}

Test Code:

@istest
private class testItemsUsed{
static testMethod void testItemsUsed1(){
 Account a1 = new Account(Name = 'Test Account', Division__c = 'Fire', Price_Band__c ='Fire Division Band C', Phone = '029208622998', RecordTypeId = '01220000000UVOw', Status__c='Active', Type = 'Customer');
 insert a1;
 Items_used__c i1 = new Items_Used__c(Quantity__c = '1', RelatedTo__c = 'A', Division__c = 'Fire', Account__c = a1.Id, ReferredBy__c='TEST USER', Item_Used__c = '1 Kg Powder Extinguisher');
 insert i1;
}
static testMethod void testItemsUsed2(){
 Account a2 = new Account(Name = 'Test Account', Division__c = 'Water', Phone = '029208622998', RecordTypeId = '01220000000UVOw', Status__c='Active', Type = 'Customer');
 insert a2;
 Items_used__c i2 = new Items_Used__c(Quantity__c = '1', RelatedTo__c = 'B', Account__c = a2.Id, Division__c = 'Water', ReferredBy__c='TEST USER', Item_Used__c = 'MISC');
 insert i2;
 Items_used__c i3 = new Items_Used__c(Quantity__c = '2', RelatedTo__c = 'B', Account__c = a2.Id, Division__c = 'Water', ReferredBy__c='TEST USER', Item_Used__c = 'MISC');
 insert i3;
}

}

Failure Warning:

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, insertNewOpportunity: execution of BeforeInsert caused by: System.ListException: List index out of bounds: 0 Trigger.insertNewOpportunity: line 34, column 1: []

I have run the query that pulls through the records that should populate in line 34 throught eh developer console (Select Id from PriceBook2 where Id = '01s20000000PuSW' and also Select Id from PriceBook2 where Name = 'Fire Division Band A') and it brings back records.

I have tested and tested but cannot get this List index out of bounds issue to resolve itself

PLEASE HELP!!!!!

Thanks

Mike

Hi,

 

I am currently trying to retrieve a set of list view options for a Lead object from a StandardSetController. When I look at the SelectOptions that are returned (from getLeadExistingViews) I only recieve the All option in my list. The end result I would like is the list view options for the standard Lead page (All Open Leads etc.) Your help would be much appreciated. Markup and code below.

 

Gaz

 

EmailPreferenceAddMembers.page

<apex:page standardController="Email_Preference_Member__c" recordSetVar="members" extensions="EmailPreferenceAddMembersExtensions">
  <apex:sectionHeader title="{!$ObjectType.Email_Preference__c.Label}" subtitle="Add Members" />
  <apex:form >
  <apex:outputPanel style="margin-bottom: 1em;" layout="block">&laquo;&nbsp;<apex:outputLink value="http://example.org" style="color: #015BA7; text-decoration: none;">Back to Email Preference: My Email Preference</apex:outputLink></apex:outputPanel>
  <apex:pageBlock >
      <apex:pageBlockSection title="Step 1: Choose Member Type to Search">
          <apex:selectRadio >
              <apex:selectOption itemLabel="Leads" itemValue="Leads" ></apex:selectOption>
              <apex:selectOption itemLabel="Contacts" itemValue="Contacts" ></apex:selectOption>
          </apex:selectRadio>
      </apex:pageBlockSection>
      <apex:pageBlockSection title="Step 2: Specify Filter Criteria">
          <apex:pageBlockSectionItem >
          <apex:outputLabel value="Use Existing View" />
              <apex:selectList value="{!leadFilterId}" size="1">
              <apex:selectOptions value="{!LeadExistingViews}"></apex:selectOptions>
              </apex:selectList>
          </apex:pageBlockSectionItem>
      </apex:pageBlockSection>
      <apex:facet name="footer">
          <apex:commandButton value="Go!" style="margin: 1em; width: 3em;" />
      </apex:facet>
  </apex:pageBlock>
  </apex:form>
</apex:page>

 EmailPreferenceAddMembersExtensions.cls

public with sharing class EmailPreferenceAddMembersExtensions {

    public ApexPages.StandardSetController leadsController {get; set;}
    public String leadFilterId {get; set;}

    public EmailPreferenceAddMembersExtensions(ApexPages.StandardSetController controller) {
        leadsController = new ApexPages.StandardSetController(Database.getQueryLocator([select Id, Name from Lead]));
        leadFilterId = leadsController.getFilterId();
    }
    
    public SelectOption[] getLeadExistingViews() {
        return leadsController.getListViewOptions();
    }
}

 


Hello,

 

          I have a custom button on a object which open a visual force page pop-up.

Can some body please help me or let me know. Is there any way I can close the window thorough the controller itself.

 

As I Do have validation in which if the data inserted is correct. The windows will close and save the data. And if the data is incorrect the class return a error message. If I write a Ajax close whenever the the call come back with message it close the window without showing the message.

 

Please help me and let me know if we can close the window in apex class (Controller) ???

Hi,

 

I am writing an Apex trigger which contains code to match a phone number to a contact phone number. It should match numbers that contain different spaces between the digits (when people store them they may store them in different formats).

 

First I thought of pulling out all the contacts in a query, then cyling through them using the trim() function on a string to match them. This seems wasteful though and there might be more contacts than the maximum number of records you are allowed to return.

 

So I then thought of creating a new string from the phone number I am matching with a '%' before and after each digit. 

Eg. '07734654342' would become '%0%7%7%3%4%6%5%4%3%4%2%' then embedding that string in a query like:

//The phone string with the % chars is wildPhone Contact[] contact = SELECT Name FROM Contact WHERE Phone LIKE :wildPhone];

 I'm not sure if this will work, but more importantly how do I go about creating that string? I thought there would be a charAt() method on the string like in Java...I can't find one though.

 

Thank you for your help.

 

Matt

 

I am struggling with this one. To keep this very simple lets say I have a List of strings. The length of this List is dynamic and can change. I would like to place this in a grid or table with four rows and basically fill the table left to right, top to bottom.

Lets say my list has 5 values. I want it to render like this:

[1][2][3][4]
[5]

if it has 10:

[1][2][3][4]
[5][6][7][8]
[9][10]

If it has 3:
[1][2][3]

This seems like it should be very simple but I can't figure this one out.

 

Thanks,

Jason

 

Message Edited by TehNrd on 10-23-2009 01:35 PM
  • October 23, 2009
  • Like
  • 0

Can an inner class access an instance variable of its outer class?

 

 

I have a bit of code which, simplified, looks like this. In context, it produces the error " Method does not exist or incorrect signature" on line 8, but for some reason this simplified version produces the error "User-defined type not allowed here" on line 4.

 

The apex manual says "Inner classes can have instance member variables like outer classes, but there is no implicit pointer to an instance of the outer class (using the this

keyword)." (link)

 

 

 

 


1: public class MyClass {
2: public Map<String,Statistical_Datum__c> dataMap;
3:
4: public class Datum {
5: Statistical_Datum__c datumObject;
6:
7: public Datum( String statistic ) {
8: datumObject = dataMap.get( statistic );
9: }
10: }
11: }

 

 

 

Any ideas as to what a SerializationException is? I could not find anything in the documentation.

Code:
Force.com Sandbox

Apex script unhandled exception by user/organization: 00550000000rTQA/00DT0000000EwRY

Visualforce Page: /apex/approveDealReg

System.SerializationException: Not Serializable: System.Savepoint

Class.approveDealRegVF.geterror: line 99, column 13

Debug Log:
***Begining Page Log for /apex/approveDealReg

Element j_id7 called method {!save} returned type PageReference: none20080610195821.020:Class.approveDealRegVF.getforwardOpp: line 76, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getforwardOpp() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Opportunity from method public SOBJECT:Opportunity getexpirationDate() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Task from method public SOBJECT:Task getreminderTask() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getISR() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getAE() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getPBM() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getshowRegApproval: line 172, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getshowRegApproval: line 172, column 65:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getshowRegApproval() in 0 ms
20080610195821.020:Class.approveDealRegVF.getShowFowardApproval: line 180, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getShowFowardApproval: line 180, column 65:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getShowFowardApproval() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getdisableAccount() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getShowContact() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getreminder() in 0 ms
20080610195821.020:Class.approveDealRegVF.getAccounts: line 201, column 43:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getAccounts: line 201, column 92:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning LIST:System.SelectOption from method public LIST:System.SelectOption getAccounts() in 0 ms
20080610195821.020:External entry point:     returning String from method public String getaccountMergeID() in 0 ms
20080610195821.020:External entry point:     returning LIST:System.SelectOption from method public LIST:System.SelectOption getTerritories() in 0 ms
20080610195821.020:External entry point:     returning String from method public String getTerritoryID() in 0 ms
20080610195821.020:External entry point:     returning String from method public String getprimaryContact() in 0 ms
20080610195821.020:External entry point:     returning String from method public String getbody() in 0 ms
20080610195821.020:External entry point:     returning from end of method public void setaccountMergeID(String) in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getShowContact() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Opportunity from method public SOBJECT:Opportunity getexpirationDate() in 0 ms
20080610195821.020:External entry point:     returning from end of method public void setReminder(Boolean) in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getreminder() in 0 ms
20080610195821.020:External entry point:     returning from end of method public void setTerritoryID(String) in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getISR() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getAE() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getPBM() in 0 ms
20080610195821.020:External entry point:     returning from end of method public void setprimaryContact(String) in 0 ms
20080610195821.020:External entry point:     returning from end of method public void setbody(String) in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 353, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 357, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 357, column 66:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 357, column 115:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 363, column 26: Creating savepoint: SavepointValue0
20080610195821.020:Class.approveDealRegVF.save: line 380, column 51: SOQL query with 3 rows finished in 9 ms
20080610195821.020:Class.approveDealRegVF.save: line 385, column 13: SelectLoop:LIST:SOBJECT:User
20080610195821.020:Class.approveDealRegVF.save: line 400, column 20:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 400, column 69:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 410, column 34:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 417, column 20:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 417, column 69:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 435, column 54: Database.convertLead(Database.LeadConvert)
20080610195821.020:Class.approveDealRegVF.save: line 435, column 54:     DML Operation executed in 7 ms
20080610195821.020:External entry point:     returning System.PageReference from method public System.PageReference save() in 23 ms
20080610195821.020:External entry point:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getshowRegApproval: line 172, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getshowRegApproval: line 172, column 65:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getshowRegApproval() in 1 ms
20080610195821.020:External entry point:     returning SOBJECT:Opportunity from method public SOBJECT:Opportunity getexpirationDate() in 0 ms
20080610195821.020:Class.approveDealRegVF.getShowFowardApproval: line 180, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getShowFowardApproval: line 180, column 65:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getShowFowardApproval() in 1 ms
20080610195821.020:Class.approveDealRegVF.getAccounts: line 201, column 43:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getAccounts: line 201, column 92:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning LIST:System.SelectOption from method public LIST:System.SelectOption getAccounts() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getdisableAccount() in 0 ms
20080610195821.020:External entry point:     returning String from method public String getaccountMergeID() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getShowContact() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getreminder() in 0 ms
20080610195821.020:External entry point:     returning String from method public String geterror() in 0 ms

 


 



Message Edited by TehNrd on 06-10-2008 01:11 PM

Hi,

 

I have a trouble while using Ajax Toolkit in my javascript.

 

My desire is to connect to another salesforce org from the currently logged in org.

 

for this, below is the javascript code that i am making use of

<script src="../../soap/ajax/25.0/connection.js" type="text/javascript"></script>

<script type="text/javascript">
window.onload = synchronousCall;
function synchronousCall(){
	try{
		var result = sforce.connection.login("username","**password***securitytoken***");
		alert(sforce.connection.serverUrl);
		alert(result.sessionId);	
	}
	catch(error){
		alert(error);
	}
}

 This code works absolutely fine, when the salesforce instance of currently logged in org is same as that of the org which is required to be connected.

 

But it gives the following exception, when the instances are different.

 

{faultcode:'sf:INVALID_LOGIN', faultstring:'INVALID_LOGIN: Invalid username, password, security token; or user locked out.', detail:{LoginFault:{exceptionCode:'INVALID_LOGIN', exceptionMessage:'Invalid username, password, security token; or user locked out.', }, }, }

 

Please let me know if i am missing something.

 

Anticipating your help

Thanks in advance