• jdl2009
  • NEWBIE
  • 25 Points
  • Member since 2009

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

This is a follow up to another question I posted yesterday about building tabs

 

I am trying to follow the tabs in 30 seconds wiki entry but it's for a custom object and it's custom related lists.

 

If I can get the first tab working the rest is cake.  I keep receiving this error message

 

 

Error: Unknown property 'Clients_For_Life__cStandardController.Transition_Meeting__c'

 for this code:

 

 

<apex:page standardController="Clients_For_Life__c" showHeader="true" tabStyle="Clients_For_Life__c" > <apex:detail subject="{!Clients_For_Life__c}" relatedList="true" title="true"/> <apex:relatedList list="OpenActivities"/> <apex:pageBlock > <apex:tabPanel selectedTab="name2" id="theTabPanel"> <apex:tab label="Transition Meeting" name="Transition Meeting" id="Transition_Meeting__c"> <apex:relatedList subject="{!Transition_Meeting__c}" list="Transition_Meeting__c" /> </apex:tab> </apex:tabPanel> </apex:pageBlock> <apex:relatedList list="NotesAndAttachments"/> <apex:relatedList list="ActivityHistories"/></apex:page>

 

 Any help would be appreciated as this is my first project in VF and I'm learning as I go along.

 

Thanks, 

 

 

Hi there - Is it possible to call out an XML-RPC webservice? Like bugzilla for example? http://your.bugzilla.installation/path/to/bugzilla/xmlrpc.cgi

 

If this is possible, please I need some direction. Maybe a piece of sample code. 

 

Thanks, JD 

Hi there - Is it possible to call out an XML-RPC webservice? Like bugzilla for example? http://your.bugzilla.installation/path/to/bugzilla/xmlrpc.cgi

 

If this is possible, please I need some direction. Maybe a piece of sample code. 

 

Thanks, JD 

Hello,

 

I need some guidance on how to pass an integer parameter from a VisualForce Page into a controller extension function (or constructor?). Thank you for any help you can provide as I feel SO close! :)

 

Here's the VisualForce Code:

-------------------------------

<apex:page standardController="Order_Details__c" extensions="OrderItemController">

      <apex:pageBlock>

          <table border="0" width="100%">

          <apex:repeat var="cx" value="{!Order_Details__c.Shipping_Locations2__r}">

              <tr><td><b>Ship To:</b></td></tr>

              <tr><td><b>{!cx.Last_Name__c}, {!cx.First_Name__c} ({!cx.Address_Type__c})</b></td></tr>

              <tr><td>{!cx.Street__c}</td></tr>

              <tr><td>{!cx.City__c}, {!cx.State_Province__c} {!cx.Postal_Code__c}</td></tr>

              <tr><td>Phone: {!cx.Phone__c}</td></tr>

              <tr><td>Email: {!cx.Email__c}</td></tr>

              <tr><td>&nbsp;</td></tr>

             

              <tr><td>

             <!-- Next line/area is where I need to pass the current value of {!cx.Shipping_Location_Id__c} to either the getOrderItemList function or set it in another function. How do I do this? -->

                  <apex:pageBlockTable value="{!OrderItemList}" var="item">

                     <apex:column  value="{!item.SKU__c}"/>

                     <apex:column value="{!item.Name__c}"/>

                     <apex:column value="{!item.Quantity__c}"/>

                     <apex:column value="{!item.Weight__c}"/>

                     <apex:column value="{!item.Supplier__c}"/>

                     <apex:column value="{!item.Dropship__c}"/>

                     <apex:column value="{!item.Status__c}"/>

                     <apex:column value="{!item.Price__c}"/>

                     <apex:column value="{!item.Ext_Price__c}"/>

                  </apex:pageBlockTable>

              </td></tr>

             

              <tr><td>&nbsp;</td><td></td><td></td></tr>

          </apex:repeat>

          </table>

      </apex:pageBlock>

</apex:page>

 

 

Here's the Controller Function:

-------------------------------

public class OrderItemController {

 

    public OrderItemController(ApexPages.StandardController controller) { }

   

    public Order_Item__c[] getOrderItemList()

    {

          return [select Order_Item_ID__c, Shipping_Location_Id__c, SKU__c, Image_Path__c,

              Name__c, Quantity__c, Weight__c, Supplier__c, Dropship__c, Shipping_Location_Name__c,

Status__c, Price__c, Ext_Price__c from Order_Item__c where Shipping_Location_Id__c = 5395]; // ß- this needs to come from a variable/parameter that is passed from the VF Page

    }

}

 

 

  • October 23, 2009
  • Like
  • 0
Is there a way to pass the Trigger as an argument? I know I can pass a member of the Trigger object, but I want it in its entirety.

Hello everyone,

 

This is my first post here, I have web development background in the .net space and am diving into SFDC, apex and VF.

 

There are a few things i'm struggling with as I haven't done any of that before.

 

I have built a trigger that is supposed to fire on insert and update of lead records. I'm in a sandbox environment. I have written tests for all methods involved and have 100% coverage on all.

 

If I browse to my sandbox instance and insert or update leads the trigger performs the tasks that it should.

 

However, when running the tests it fails with the error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY

 

If I remove the "before update" from the trigger signiture everything runs without a problem. Adding back in "before update" and the problem arises.

 

I'll past the code below. Countries is a class that contains static methods that return List<String>

 

 trigger SetNotification on Lead (after insert, after update) {

// dean@sqwarepeg.com

//This trigger checks if any of the selections in the source or destination countries multi picklists require investigation

//Countries require further investigation depending on what list they appear in in the Countries static methods

String errorMessage = 'Some of the selected countries are possibly not eligible';

Id businessClientRTId = Schema.SObjectType.Lead.getRecordTypeInfosByName().get('Business Clients').getRecordTypeId();

Id privateClientRTId = Schema.SObjectType.Lead.getRecordTypeInfosByName().get('Private Clients').getRecordTypeId();

for(Lead lead:trigger.new){

 

List<String> compareCountries = new List<String>();

if(lead.RecordTypeId == businessClientRTId){

compareCountries = Countries.GetCorporatePossiblyEligible();

compareCountries.addAll(Countries.GetCorporateNonEligible());

}else if(lead.RecordTypeId == privateClientRTId){

compareCountries = Countries.GetPrivatePossiblyEligible();

compareCountries.addAll(Countries.GetPrivateNonEligible());

}

List<String> selectedCountries = new List<String>();

//Source Country Check

String strCountries = String.valueOf(lead.Source_Country_s_A_L__c);

if(strCountries != null && strCountries != '')

selectedCountries.addAll(strCountries.split(';'));

strCountries = String.valueOf(lead.Source_Country_s_M_Z__c);

if(strCountries != null && strCountries != '')

selectedCountries.addAll(strCountries.split(';'));

Boolean matchFound = false;

for(String selectedCountry:selectedCountries)

{

for(String compareToCountry:compareCountries){

if(selectedCountry == compareToCountry){

matchFound = true;

break;

}

}

if(matchFound)

break;

}

if(matchFound)

lead.Source_Country_Notification__c = errorMessage.toUpperCase();

else

lead.Source_Country_Notification__c = '';

//Destination Country Check

selectedCountries.clear();

strCountries = String.valueOf(lead.Destination_Country_s_A_L__c);

if(strCountries != null && strCountries != '')

selectedCountries.addAll(strCountries.split(';'));

strCountries = String.valueOf(lead.Destination_Country_s_M_Z__c);

if(strCountries != null && strCountries != '')

selectedCountries.addAll(strCountries.split(';'));

matchFound = false;

for(String selectedCountry:selectedCountries)

{

for(String compareToCountry:compareCountries){

if(selectedCountry == compareToCountry){

matchFound = true;

break;

}

}

if(matchFound)

break;

}

if(matchFound)

lead.Destination_Country_Notification__c = errorMessage.toUpperCase();

else

lead.Destination_Country_Notification__c = '';

}

}

 

What is the issue with before update? I want the same functionality regardless of insert or update. 

 

Thank you for any assistance!!! 

  • October 20, 2009
  • Like
  • 0

Is there a way to get description information for a custom object field in Visualforce? I have a need to iterate over fields of a custom object and create a layout in 3 columns, column 1 - Label , column 2 - Input field, column 3- description information for that input field.

 

Is this possible in Visualforce? I am trying to replicate a 3 column word document in Salesforce.com.

This is a follow up to another question I posted yesterday about building tabs

 

I am trying to follow the tabs in 30 seconds wiki entry but it's for a custom object and it's custom related lists.

 

If I can get the first tab working the rest is cake.  I keep receiving this error message

 

 

Error: Unknown property 'Clients_For_Life__cStandardController.Transition_Meeting__c'

 for this code:

 

 

<apex:page standardController="Clients_For_Life__c" showHeader="true" tabStyle="Clients_For_Life__c" > <apex:detail subject="{!Clients_For_Life__c}" relatedList="true" title="true"/> <apex:relatedList list="OpenActivities"/> <apex:pageBlock > <apex:tabPanel selectedTab="name2" id="theTabPanel"> <apex:tab label="Transition Meeting" name="Transition Meeting" id="Transition_Meeting__c"> <apex:relatedList subject="{!Transition_Meeting__c}" list="Transition_Meeting__c" /> </apex:tab> </apex:tabPanel> </apex:pageBlock> <apex:relatedList list="NotesAndAttachments"/> <apex:relatedList list="ActivityHistories"/></apex:page>

 

 Any help would be appreciated as this is my first project in VF and I'm learning as I go along.

 

Thanks, 

 

 

Hi

 I design a home page and i override the new button of a custom object with that page. I enter the values in the corresponding fields., when i click save button i need to display the values as like as custom fields. that is i need to display the values in corresponding home page. can you help in the coding part of that?

  • October 20, 2009
  • Like
  • 0

I need some help and guidance writing a unit test for a custom controller I've created.

 

public class AccountMaintenanceController { private Account acctToByParent = new Account(); private Account parentAcct = new Account(); public AccountMaintenanceController() { } public PageReference updateChildAccountOwnership() { try { Account parent = [Select Id, OwnerId From Account where Id =: parentAcct.ParentId]; List<Account> childAccts = [Select Id, OwnerId From Account where ParentId =: parent.Id]; parent.ownerId = acctToByParent.ownerId; DbUtil.save(parent); List<Account> lst = new List<Account>(); for (Account acct: childAccts) { acct.OwnerId = acctToByParent.OwnerId; lst.add(acct); } DbUtil.save(lst); ApexPages.Message msg = new ApexPages.message(ApexPages.Severity.INFO, 'Account ownership updated successfully.'); ApexPages.addMessage(msg); acctToByParent.OwnerId = null; parentAcct.parentId = null; return null; } catch (Exception ex) { ApexPages.Message errMsg = new ApexPages.Message(ApexPages.Severity.ERROR, ex.getMessage()); ApexPages.addMessage(errMsg); return null; } } public PageReference cancel() { PageReference newpage = new PageReference(System.currentPageReference().getURL()); newpage.setRedirect(true); return newpage; } public Account getAccountToByParent() { return acctToByParent; } public Account getDistrictAccount() { return parentAcct; } static testMethod void test() { } }

 

Sorry for the novice questions, but how do I set the property values in the test method and how do I call the method?

 

Thanks for any help.

To deploy changes to existing force.com components, I used to

 

Create a new Force.com project against your Sandbox org, and in Step 2 of the wizard select "Choose metadata components" then use the "Choose Metadata Components" dialog to select just those files you want to deploy to production.

 

I no longer see this option. I can only select until the type of component now - but not go down to the file.

For example I need to change 1 class of the 10 apex classes I have. Same with trigger.

 

How do I select just those files I want to deploy to production? 

 

Thanks

Hello... this is my first attempt at a custom controller. The purpose is to get  user and contact information from a Custom Controller based on the User object. I recieve the following error:

 

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

 

 at the ' private final User user; ' statement. This was pretty much out of the Apex Developer guide for Custom Controllers  but I'm obviously missing something because I can't get past this error. 

 

Thanks for looking.

 

Regards,

public class CPcontroller {
private final User user;
private final Contact contact;
private final Case c;
public CPcontroller() {


user = [select id,Name,ContactId,TimeZoneSidKey,Account_Sharing__c, Title, CompanyName,Phone,Extension,Fax,MobilePhone,
Email,Street,City,State,Country,PostalCode,CurrencyIsoCode from User where Id =
:ApexPages.currentPage().getParameters().get('Id') ];
contact = [select id, Name,Email,Phone,Fax,MailingStreet,MailingCity,MailingState,MailingPostalCode,MailingCountry,Title,
ContactAccountName__c from Contact where Id = :user.Contactid] ;

}

public User getUser() {
return user;
}

public Contact getContact() {
return contact;

}
public PageReference save() {
update user;
update contact;
return null;
}


}