• awil
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 19
    Replies

Of course for Primary Campaign, we have the field "Opportunity.Campaign", which is a lookup(Campaign) field on Opportunity. But there is also a related list for the Opportunity record detail page called "Campaign Influence", which can be populated in a couple of ways, including manual button-click to "Add" an Opportunity Campaign Influence record. This appears to be like a many-to-many relationship, implying that any opportunity can be linked to any campaign, non-exclusively so. That seems to imply a junction object.

 

I suspected something like OpportunityCampaign or something, but no such object exists.

 

Where are these relationships stored? How can they be created/modified via API or Apex (or even workflow)?

 

 

  • September 07, 2011
  • Like
  • 1

We're interested in automating the article assignment process via Apex.

 

How can we access the "Assigned To" and "Assigned By" fields (if they are fields) for articles in a draft status? We can't see these fields on the KAV object, or really anywhere in the ERD (http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_guidelines_knowledge.htm).

 

Can we read or write this parameter?

  • August 11, 2011
  • Like
  • 0

I recently implemented "My Domain" for an org, and now my trapdoor entry for that org dumps me to the SFDC login screen. I tried changing the Server value to mydomain.my.salesforce.com or https://mydomain.my.salesforce.com , but neither worked.

 

Is Trapdoor compatible with My Domain, and if so, how can I resolve?

  • November 04, 2010
  • Like
  • 0

With Winter '11, if you create a Site, a new Salesforce-provided class gets deployed to your org: MyProfilePageController.cls

 

There is test code in this class that fails if you don't have a portal user installed. This prevents you from doing anything in that org that requires running all tests.

 

Here is the error:

 

System.QueryException: List has no rows for assignment to SObject

Class.MyProfilePageController.testSave: line 78, column 35 External entry point

 

and the line in question:

 

 

User existingPortalUser = [SELECT id, profileId, userRoleId FROM User WHERE UserRoleId <> null AND UserType='CustomerSuccess' LIMIT 1];

 

This failure prevents doing any save from Eclipse. You can't deploy new code, edit object metadata files, etc. Complete showstopper.

 

Can anyone:

 * confirm this (we think reproducing will require that you create a new Site, perhaps the first Site in the org, after Winter 11)

 * think of a work-around (tried enabling self-service portal, but it doesn't create the required user type)

 

Anyone from Salesforce confirm that this is a bug and not something we're doing wrong?

 

Thanks!

 

Here is the entire class:

 

/**
 * An apex class that keeps updates of a portal user in sync with its corresponding contact.
   Guest users are never able to access this page.
 */
public class MyProfilePageController {

    private User user;
    private boolean isEdit = false;
    
    public User getUser() {
        return user;
    }

    public MyProfilePageController() {
        user = [SELECT id, email, username, usertype, communitynickname, timezonesidkey, languagelocalekey, firstname, lastname, phone, title,
                street, city, country, postalcode, state, localesidkey, mobilephone, extension, fax, contact.email
                FROM User
                WHERE id = :UserInfo.getUserId()];
        // guest users should never be able to access this page
        if (user.usertype == 'GUEST') {
            throw new NoAccessException();
        }
    }
    
    public Boolean getIsEdit() {
        return isEdit;
    }
    
    public void edit() {
        isEdit=true;
    }    
    
    public void save() {
        if (user.contact != null) {              
            setContactFields(user.contact);
        }
        
        try {
            update user;
            if (user.contact != null) { 
                update user.contact;
            }
            isEdit=false;
        } catch(DmlException e) {
            ApexPages.addMessages(e);
        }
    }
    
    public PageReference changePassword() {
        return Page.ChangePassword;
    }
    
    public void cancel() {
        isEdit=false;
        user = [SELECT id, email, username, communitynickname, timezonesidkey, languagelocalekey, firstname, lastname, phone, title,
                street, city, country, postalcode, state, localesidkey, mobilephone, extension, fax, contact.email
                FROM User
                WHERE id = :UserInfo.getUserId()];
    }
    
    private void setContactFields(Contact c) {
        c.title = user.title;
        c.firstname = user.firstname;
        c.lastname = user.lastname;
        c.email = user.email;
        c.phone = user.phone;
        c.mobilephone = user.mobilephone;
        c.fax = user.fax;
        c.mailingstreet = user.street;
        c.mailingcity = user.city;
        c.mailingstate = user.state;
        c.mailingpostalcode = user.postalcode;
        c.mailingcountry = user.country;
    }

    static testMethod void testSave() {         
        // Modify the test to query for a portal user that exists in your org
        User existingPortalUser = [SELECT id, profileId, userRoleId FROM User WHERE UserRoleId <> null AND UserType='CustomerSuccess' LIMIT 1];
        System.assert(existingPortalUser != null, 'This test depends on an existing test portal user to run');
        
        String randFax = Math.rint(Math.random() * 1000) + '5551234';
        
        System.runAs(existingPortalUser) {
            MyProfilePageController controller = new MyProfilePageController();
            System.assertEquals(existingPortalUser.Id, controller.getUser().Id, 'Did not successfully load the current user');
            System.assert(controller.isEdit == false, 'isEdit should default to false');
            controller.edit();
            System.assert(controller.isEdit == true);
            
            controller.cancel();
            System.assert(controller.isEdit == false);
            
            controller.getUser().Fax = randFax;
            controller.save();
            System.assert(controller.isEdit == false);
        }
        
        // verify that the user and contact were updated
        existingPortalUser = [Select id, fax, Contact.Fax from User where id =: existingPortalUser.Id];
        System.assert(existingPortalUser.fax == randFax);
        System.assert(existingPortalUser.Contact.fax == randFax);
    }

}

 

 

 

  • October 15, 2010
  • Like
  • 0

I want to use a radioselect in a table with many rows, configured like this:

 

 radioselect example

 

The blank cells to the right of each radiobutton will contain text corresponding to the radiobutton (a label of sorts). I want to use a table primarily because some rows will have the radiobuttons hidden/not-rendered and I want everything to remain lined up.

 

Here is how I tried to code it up:

 

 

<apex:selectRadio value="{!mergeLineItem.name}" rendered="{!mergeLineItem.rendered}">
<apex:repeat value="{!mergeLine.mergeLineItems}" var="mergeLineItem">
<td class="white" align="center">
<apex:SelectOption value="{!mergeLineItem.option}"/>
</td>
<td class="white">{!mergeLineItem.value}</td>
</apex:repeat>
</apex:selectRadio>

 

But that creates some malformed HTML:

 

<td align="right" class="yellow">Record</td>
<td align="center" class="white">
</td>
<td class="white"></td><table>
<tr>
<td>
<input type="radio" checked="checked" name="j_id0:j_id3:j_id4:j_id15:0:j_id17:0:j_id18" id="j_id0:j_id3:j_id4:j_id15:0:j_id17:0:j_id18:0" value="record__c" /><label for="j_id0:j_id3:j_id4:j_id15:0:j_id17:0:j_id18:0"> </label></td>
</tr>
</table>


<td align="center" class="white">
</td>
<td class="white"></td><table>
<tr>
<td>
<input type="radio" checked="checked" name="j_id0:j_id3:j_id4:j_id15:0:j_id17:1:j_id18" id="j_id0:j_id3:j_id4:j_id15:0:j_id17:1:j_id18:0" value="record__c" /><label for="j_id0:j_id3:j_id4:j_id15:0:j_id17:1:j_id18:0"> </label></td>
</tr>
</table>

<td align="center" class="white">
</td>

<td class="white">No</td><table>
<tr>
<td>
<input type="radio" checked="checked" name="j_id0:j_id3:j_id4:j_id15:0:j_id17:2:j_id18" id="j_id0:j_id3:j_id4:j_id15:0:j_id17:2:j_id18:0" value="record__c" /><label for="j_id0:j_id3:j_id4:j_id15:0:j_id17:2:j_id18:0"> </label></td>
</tr>
</table>

 I've highlighted the part that causes trouble. It looks like each instance of SelectOption ends up rendering a complete table of its own, but only after closing the TD tag that I was trying to put the radiobutton in. The end result is completely screwed up table HTML that doesn't render at all.

 

1. Is this a VF bug?

 

2. How can I accomplish what I want to display, namely displaying radiobuttons that aren't all right next to each other and (in my case) are in every other cell of a table, so that I can put some text in the cell to the right of each radiobutton?

 

 

 

 

 

 

 

 

  • March 13, 2009
  • Like
  • 0

I want to create an interface for merging two custom object records. In order to do this, I want two columns with the values from each field (one field per row, including any possible custom fields), wherein the user can select the surviving value from one or the other records.

 

The problem is that I want to only display fields that are accessible (field describe "isAccessible") and that are updatable (field describe "isUpdatable").

 

I could describe the object and then walk the fields doing a describe on each field, but I would quickly hit the limit on number of describe calls per Apex script (10).

 

Is there another way?

  • February 19, 2009
  • Like
  • 0

I want to include the apex:enhancedList component on a VF page. I want this page to display a particular view when the page first loads. How can I do this? I won't know the specific IDs of any records because this code will be installed in other orgs.

 

Can I query for a particular view and designate that the enhancedList should show that view?

 

Can I specify that a particular view should be displayed by name?

  • January 27, 2009
  • Like
  • 0
I have installed a managed (beta) package in a sandbox org. I then created (via web setup) a custom field on one of the custom objects in that managed package. I can't find that custom field in the Eclipse IDE.

I looked both under Referenced Packages (the custom object appears, but not the new field, even after refresh) as well as in the src folder (can't make the custom object appear here, even if I add it explicitly to the package.xml file).

Is this by design?
  • December 05, 2008
  • Like
  • 0

COMPANY DESCRIPTION:
Wired Triangle is a consulting and development firm, providing Salesforce.com consulting, administration, development, integration & training services.

JOB DESCRIPTION:
Contract-to-hire. Applicants must be local to the Research Triangle or willing to relocate.

Wired Triangle seeks a developer with OOP-based development experience, preferably with strong Salesforce.com experience.

The person filling this role will focus mostly on development with Apex & Visualforce, configuration of the CRM application, and Force.com application development / test development.

REQUIREMENTS:
Technical requirements: strong object-oriented programming skills, experience developing enterprise level applications (preferably in an MVC framework), web-services applications, command of application development security principles, experience using revision control systems such as SVN, CVS. Strong preference given to candidates with Apex and Visualforce development experience.

Technical plusses: Understanding of UI principles, Javascript.

Experience requirements: experience working in a team environment, including project managers, designers, etc.

Experience plusses: Business process analysis, experience working with sales teams, experience defining application requirements, client facing work.



Please do not reply to this forum. Applicants should be local to the Research Triangle or willing to relocate.

Please send your resume to jobs -AT- wiredtriangle -DOT- com.


  • December 02, 2008
  • Like
  • 0
Simon -

Like trapdoor, maildrop is a great addition. Thanks for your efforts to support the OSX community.

It would be helpful if when an email comes in from someone not yet in your SFDC org, you could add the email without logging in, inclusive of not just creating the contact, but also creating a (minimal) account for them in cases where one doesn't yet exist.

Thanks.
  • November 28, 2008
  • Like
  • 0
Simon -

Thanks for trapdoor, it's saved cumulative hours for me.

In a future release, I think it'd be useful to be able to re-order logins or maybe even put them in folders. I have a dozen (and quickly growing number of) logins and it's starting to be a searching game to find them since they are listed (I believe) in the order they were added.

Thanks.
  • November 28, 2008
  • Like
  • 0
I have a custom formula field (shipping_total__c) that is the sum of two other fields (shipping1__c, shipping2__c), and I have created a visualforce page that displays the latter two fields in <apex:inputfield> tags, and the formula field in an <apex:outputfield> tag. I am trying to get the formula field to rerender with the correct amount any time the first two are modified, but the value does not change.

I suspect that the field formula is not re-calculating after it is originally retrieved from the opportunity object via SOQL on initial page display.

If I try to modify those fields,

Code:
this.opportunity.shipping_total__c = this.opportunity.shipping1__c + this.opportunity.shipping2__c;

... I get an Apex error that this field is read-only.

I *could* create a temp decimal variable and display that instead, and then update it onchange of the first two shipping values, but that seems like more work than should be necessary.


How can I force a formula field to re-render without actually committing/updating the data back to the DB first?


  • November 20, 2008
  • Like
  • 0
If you are displaying a field from an sObject, <apex:outputField> does a nice job of adding decimal points and commas for thousands, etc.

If you are displaying your own variable (decimal), you cannot use <apex:outputField> becuase it is not part of an sObject.

Is there some easy way to add formatting to change 123456.78 into 123,456.78 dynamically? Do I need to convert the number to a string and then manipulate? Do I need to use JS to modify client-side? These would work but seem heavy-handed for what see be a common requirement.
  • October 30, 2008
  • Like
  • 0
I'm having trouble binding a grid-style editable input form and using a "save" button to upsert the users' edits back to the database. I used a nested repeat in my VF code and a sub class for iterating through the data to build the grid. I used Ron Hess' advice from this post:
http://forums.sforce.com/sforce/board/message?board.id=Visualforce&message.id=668

The page should iterate through product families, and then display (for the current opportunity) each existing OpportunityLineItem, giving the user capability to edit quantity and sales price. On clicking save, the Apex attempts to iterate through the families and upsert all the OpportunityLineItems... but fails to do so.

The code displays the table correctly (including existing values for quantity and sales price), but the save button does not commit changes back to the database. I added debug statements to my save button, and found that the users' typed edits in the input fields are not being reflected when the debug statements are shown in the log. I am interpreting this to mean that I have not successfully bound the input fields back to the objects I am trying to upsert (or the ones I am dumping in the debug statments). Here is my code:

VF Code:
<apex:page tabStyle="Opportunity" controller="addOpportunityProductsController">
  <apex:sectionHeader title="Products Wizard" subtitle="Step 1"/>
  <apex:form >        
      <apex:pageBlock title="Available Products">

        <apex:pageBlockButtons >
            <apex:commandButton action="{!saveChanges}" value="Save"
            rerender="main" status="ajaxStatus" />
        </apex:pageBlockButtons>

        <apex:pageBlockSection title="Opportunity Information"> 
            <apex:panelGrid columns="2"> 
                <apex:outputText value="Opportunity Name:"/> 
                <apex:outputText value="{!opportunity.name}"/> 
            </apex:panelGrid> 
        </apex:pageBlockSection>
        
            <apex:repeat value="{!families}" var="family" id="theSection">
                <apex:pageBlockSection title="{!family.name}">

  <apex:actionStatus id="ajaxStatus" startText="Updating schedules...">        

   <apex:facet name="stop">
   <apex:outputPanel id="main">
    <table border="1" width="100%">
    <tr>
     <apex:repeat value="{!headers}" var="h">
      <td class="hdr">{!h}</td>
     </apex:repeat>
    </tr>
    <apex:repeat value="{!family.oppLineItems}" var="o">
     <tr>
      <td><apex:inputField value="{!o.Id}" /></td>
      <td><apex:outputText value="{!o.PriceBookEntry.Product2.Name}" /></td>
      <td><apex:inputField value="{!o.Quantity}" /></td>
      <td><apex:inputField value="{!o.UnitPrice}" /></td>
     </tr>
    </apex:repeat>
    </table>
   </apex:outputPanel>
   </apex:facet>
  </apex:actionStatus>
                </apex:pageBlockSection>
            </apex:repeat>
 </apex:pageBlock> 
 </apex:form>

</apex:page>

 And my Apex Code:
Code:
public class addOpportunityProductsController {

  // Class Variables
   Opportunity opportunity;
   //flag1 is a custom field on Opportunity and also Product2 used to filter which products are applicable for this kind (flag1) of opportunity
   private String flag1;
   private String opportunity_id;
   OpportunityLineItem[] oppLineItems;
   public List<myFamily> mfmlys = new List<myFamily>();
      public List<myFamily> families = new List<myFamily>();
         
  // Constructor
 public addOpportunityProductsController() {
  //this.opportunity = (Opportunity)controller.getSubject();
     this.opportunity_id = System.currentPageReference().getParameters().get('opportunity_id');  
     this.flag1 = System.currentPageReference().getParameters().get('flag1');
     this.oppLineItems = [ SELECT  oli.Id, oli.PriceBookEntry.Product2.Name, oli.Quantity, oli.UnitPrice
      FROM OpportunityLineItem oli 
      WHERE oli.opportunityId = :opportunity_id ];
 }

    public class myFamily {
        private String name;
        private List<Product2> prods = new List<Product2>();
        private List<OpportunityLineItem> oppLineItems = new List<OpportunityLineItem>();
        //flag1 is a custom field on Opportunity and also Product2 used to filter which products are applicable for this kind (flag1) of opportunity
        String flag1 = System.currentPageReference().getParameters().get('flag1');
        String opportunity_id = System.currentPageReference().getParameters().get('opportunity_id');  
     
        public List<Product2> getProds() {
            this.prods = [Select Id, Name from Product2 where Product2.flag1__c = :flag1 and Family = :name];
            return prods; 
        }

        public List<OpportunityLineItem> getOppLineItems() {
            List<OpportunityLineItem> oppLineItems = [ SELECT 
              oli.Id, oli.PriceBookEntry.Product2.Name, oli.Quantity, oli.UnitPrice
              FROM OpportunityLineItem oli 
              WHERE oli.opportunityId = :opportunity_id 
              AND oli.PriceBookEntry.Product2.Family = :name];
            return oppLineItems;
        }
        
        public String getName() { return name; }         

    }

    public List<myFamily> getFamilies() {

        Schema.DescribeFieldResult productFamilyField = Schema.sObjectType.Product2.fields.Family;
        List<Schema.PicklistEntry> productFamilyValues = productFamilyField.getPickListValues();

        for(Schema.PicklistEntry entry:productFamilyValues){
            System.Debug('entry is ' + entry.getLabel());
            myFamily mfmly = new myFamily();
            mfmly.name = entry.getLabel();
            mfmly.oppLineItems = mfmly.getOppLineItems();
              families.add(mfmly);
            mfmlys.add(mfmly);

        }
           return families;
    }

    public Opportunity getOpportunity() { 
        return [select id, name from Opportunity where id=: opportunity_id];
    }
        
         // Action Method called from page button
         public pagereference saveChanges() { 
                System.debug('----------1------------');
                  for (myFamily m : families ) {
                    System.debug('----------2------------');
                    System.debug('FAMILY NAME IS ' + m.name);
                    for (OpportunityLineItem o : m.oppLineItems) {
                        System.debug('NAME IS ' + o.PriceBookEntry.Product2.Name + '; QUANTITY IS ' + o.Quantity);
                    }
                    upsert (m.oppLineItems);

            }
            return null;
           /* PageReference opptyPage = new PageReference('/' + opportunity_id);
                                opptyPage.setRedirect(true);
                                return opptyPage;
*/
         }

 // public Getter to provide table headers 
 public string[] getheaders() { 
   return new string [] {'Id','Name','Quantity','Sales Price'} ;
 }
 
 public opportunityLineItem[] getOppLineItems() { 
  return this.oppLineItems; 
 } 

}

 


  • October 20, 2008
  • Like
  • 0

Of course for Primary Campaign, we have the field "Opportunity.Campaign", which is a lookup(Campaign) field on Opportunity. But there is also a related list for the Opportunity record detail page called "Campaign Influence", which can be populated in a couple of ways, including manual button-click to "Add" an Opportunity Campaign Influence record. This appears to be like a many-to-many relationship, implying that any opportunity can be linked to any campaign, non-exclusively so. That seems to imply a junction object.

 

I suspected something like OpportunityCampaign or something, but no such object exists.

 

Where are these relationships stored? How can they be created/modified via API or Apex (or even workflow)?

 

 

  • September 07, 2011
  • Like
  • 1

Of course for Primary Campaign, we have the field "Opportunity.Campaign", which is a lookup(Campaign) field on Opportunity. But there is also a related list for the Opportunity record detail page called "Campaign Influence", which can be populated in a couple of ways, including manual button-click to "Add" an Opportunity Campaign Influence record. This appears to be like a many-to-many relationship, implying that any opportunity can be linked to any campaign, non-exclusively so. That seems to imply a junction object.

 

I suspected something like OpportunityCampaign or something, but no such object exists.

 

Where are these relationships stored? How can they be created/modified via API or Apex (or even workflow)?

 

 

  • September 07, 2011
  • Like
  • 1

I recently implemented "My Domain" for an org, and now my trapdoor entry for that org dumps me to the SFDC login screen. I tried changing the Server value to mydomain.my.salesforce.com or https://mydomain.my.salesforce.com , but neither worked.

 

Is Trapdoor compatible with My Domain, and if so, how can I resolve?

  • November 04, 2010
  • Like
  • 0

With Winter '11, if you create a Site, a new Salesforce-provided class gets deployed to your org: MyProfilePageController.cls

 

There is test code in this class that fails if you don't have a portal user installed. This prevents you from doing anything in that org that requires running all tests.

 

Here is the error:

 

System.QueryException: List has no rows for assignment to SObject

Class.MyProfilePageController.testSave: line 78, column 35 External entry point

 

and the line in question:

 

 

User existingPortalUser = [SELECT id, profileId, userRoleId FROM User WHERE UserRoleId <> null AND UserType='CustomerSuccess' LIMIT 1];

 

This failure prevents doing any save from Eclipse. You can't deploy new code, edit object metadata files, etc. Complete showstopper.

 

Can anyone:

 * confirm this (we think reproducing will require that you create a new Site, perhaps the first Site in the org, after Winter 11)

 * think of a work-around (tried enabling self-service portal, but it doesn't create the required user type)

 

Anyone from Salesforce confirm that this is a bug and not something we're doing wrong?

 

Thanks!

 

Here is the entire class:

 

/**
 * An apex class that keeps updates of a portal user in sync with its corresponding contact.
   Guest users are never able to access this page.
 */
public class MyProfilePageController {

    private User user;
    private boolean isEdit = false;
    
    public User getUser() {
        return user;
    }

    public MyProfilePageController() {
        user = [SELECT id, email, username, usertype, communitynickname, timezonesidkey, languagelocalekey, firstname, lastname, phone, title,
                street, city, country, postalcode, state, localesidkey, mobilephone, extension, fax, contact.email
                FROM User
                WHERE id = :UserInfo.getUserId()];
        // guest users should never be able to access this page
        if (user.usertype == 'GUEST') {
            throw new NoAccessException();
        }
    }
    
    public Boolean getIsEdit() {
        return isEdit;
    }
    
    public void edit() {
        isEdit=true;
    }    
    
    public void save() {
        if (user.contact != null) {              
            setContactFields(user.contact);
        }
        
        try {
            update user;
            if (user.contact != null) { 
                update user.contact;
            }
            isEdit=false;
        } catch(DmlException e) {
            ApexPages.addMessages(e);
        }
    }
    
    public PageReference changePassword() {
        return Page.ChangePassword;
    }
    
    public void cancel() {
        isEdit=false;
        user = [SELECT id, email, username, communitynickname, timezonesidkey, languagelocalekey, firstname, lastname, phone, title,
                street, city, country, postalcode, state, localesidkey, mobilephone, extension, fax, contact.email
                FROM User
                WHERE id = :UserInfo.getUserId()];
    }
    
    private void setContactFields(Contact c) {
        c.title = user.title;
        c.firstname = user.firstname;
        c.lastname = user.lastname;
        c.email = user.email;
        c.phone = user.phone;
        c.mobilephone = user.mobilephone;
        c.fax = user.fax;
        c.mailingstreet = user.street;
        c.mailingcity = user.city;
        c.mailingstate = user.state;
        c.mailingpostalcode = user.postalcode;
        c.mailingcountry = user.country;
    }

    static testMethod void testSave() {         
        // Modify the test to query for a portal user that exists in your org
        User existingPortalUser = [SELECT id, profileId, userRoleId FROM User WHERE UserRoleId <> null AND UserType='CustomerSuccess' LIMIT 1];
        System.assert(existingPortalUser != null, 'This test depends on an existing test portal user to run');
        
        String randFax = Math.rint(Math.random() * 1000) + '5551234';
        
        System.runAs(existingPortalUser) {
            MyProfilePageController controller = new MyProfilePageController();
            System.assertEquals(existingPortalUser.Id, controller.getUser().Id, 'Did not successfully load the current user');
            System.assert(controller.isEdit == false, 'isEdit should default to false');
            controller.edit();
            System.assert(controller.isEdit == true);
            
            controller.cancel();
            System.assert(controller.isEdit == false);
            
            controller.getUser().Fax = randFax;
            controller.save();
            System.assert(controller.isEdit == false);
        }
        
        // verify that the user and contact were updated
        existingPortalUser = [Select id, fax, Contact.Fax from User where id =: existingPortalUser.Id];
        System.assert(existingPortalUser.fax == randFax);
        System.assert(existingPortalUser.Contact.fax == randFax);
    }

}

 

 

 

  • October 15, 2010
  • Like
  • 0

Hi,

while working quite a lot with campaigns and opportunities, I'm faced with the problem to create campaign influence records for opportunities in batch (not manually)

Adding an influence for an contact or lead is quite easy; add a record to the table CampaignMember and that's it... 

 

But - in which table are records stored that define a relationship between an opportunity and a campaign? Can't find it - the prefix is 0BG - if this might help anybody.

 

Many thanks in advance!

  • March 02, 2009
  • Like
  • 0

I just posted the final Maildrop 2.0 build. You can download it from the project download page, or if you're already running Maildrop, just restart it, or pick check for updates to have it autoupdate.


Major new features include support for email attachments, the new buttonbar UI to replace the scripts menu, and the configurable search column for the 'What' search. Maildrop 2.0 runs on Tiger and Leopard, I have some ideas for the next version, which may mean its Leopard only.

I have installed a managed (beta) package in a sandbox org. I then created (via web setup) a custom field on one of the custom objects in that managed package. I can't find that custom field in the Eclipse IDE.

I looked both under Referenced Packages (the custom object appears, but not the new field, even after refresh) as well as in the src folder (can't make the custom object appear here, even if I add it explicitly to the package.xml file).

Is this by design?
  • December 05, 2008
  • Like
  • 0
Hello,

This might be not pure VF development question, but still...

I have  a Visualforce page that uses custom controller
Visualforce page name: myVFpage

Opportunity Page layout has a button with the following URL:

/apex/myVFPage?id={!Opportunity.Id}

That is calling the VF page and passing Opportunity Id as a parameter.
Everything works fine in my developer org.
-------------------------------------------------------------------------------------------------------------------------------------------------
Now, the problem comes when I create a managed package (managed-beta) and install it in a destination org.
When I press the button I get an error message:

'Page myvfpage does not exist'.

However, if I enter the following URL directly into a browser, the page shows up:
https://my_namespace_prefix.na6.visual.force.com/apex/myVFPage?id=0068000000MLQE6

What am I doing wrong?
I guess this is somehow related to a namespace prefix.
  • November 21, 2008
  • Like
  • 0
If you are displaying a field from an sObject, <apex:outputField> does a nice job of adding decimal points and commas for thousands, etc.

If you are displaying your own variable (decimal), you cannot use <apex:outputField> becuase it is not part of an sObject.

Is there some easy way to add formatting to change 123456.78 into 123,456.78 dynamically? Do I need to convert the number to a string and then manipulate? Do I need to use JS to modify client-side? These would work but seem heavy-handed for what see be a common requirement.
  • October 30, 2008
  • Like
  • 0
I am having difficulty uploading any managed packages (beta or released) on my developer's org after Winter '09 upgrade.  Every time I tried, the upload failed and the error message only mentioned "Your upload failed.  You will receive an e-mail containing additional information."  However, the email never arrived so I don't know what caused the upload failure.  The same package have been successfully uploaded many times before.
 
Any help is greatly appreciated.
 
Hi, I'm running eclipse and I'm not getting my classes or pages for my dev orgs.  I have them for sandbox and production systems, but for my dev orgs I don't even get the folder for those 2 objects.  What's my problem...anyone...anyone?
Since visualForce doesn't have good  error handling for custom controllers, I am  writing some custom code show error messages.

My custom controller is editing a table.

In the code below, I am a trying to insert a line feed after every error using '\n'. 

However,  when error messages are output, there are no separate lines - it is one big error message. i have tried '\r' as well - doesn't work.

Any thoughts.

Code:
       } catch (DmlException e) {
for (Integer i = 0; i < e.getNumDml(); i++) { string[] fields = e.getDmlFields(i); //strip __c string field = fields[0].subString(0,fields[0].length()-3); integer row = e.getDmlIndex(i); String rowError = 'Row:' + (row+1) + ' Field:' + field + ':' + e.getDMLMessage(i); if (ErrorString[0] <> null) { ErrorString = ErrorString + '\n' + rowError; } else { ErrorString = 'ERROR:' + rowError + '\n'; } }

 

Hey,

The following SOQL query:

select Name , SobjectType from RecordType where SobjectType like 'whatever%'

throws an 'INVALID_QUERY_FILTER_OPERATOR' error:  'invalid operator on id field'.

The 'like' clause works fine on other RecordType fields (e.g. Name), and on picklists on other objects (e.g. User.Salutation).
 
Was wondering what's special about this particular field (RecordType.SobjectType), and if anybody knows of a workaround, aside from the obvious - select all records and filter the output with a regexp '^whatever.*'

Thanks!
  • April 14, 2008
  • Like
  • 0
Hi, I'm newbie in the forum, and I recently discovered the excel connector, wich is great, but every time I want to export to excel a large quantity of leads, it stops at 32766, when it is supposed to download at least 90154 records. The filters are fine, it seems more to be a trouble of excel or the connector. Any ideas?
 
Thankyou very much.
 
Arturo Llano
México, D.F.
  • November 23, 2007
  • Like
  • 0