• developer-force
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 13
    Replies
I have 3 tab Cities, Branches, Consignments on which I have given access to all tab for the Admin profile and only to Consignments tab for the Standard User profile. The issue is that when the standard user profile user clicks on the Consignments Tab all other tabs are visible. Although they don't get access and are presented with the "Insufficient Privileges" message, I would like that the tabs are not visible even from the Consignments tab. Is there a way I can do that?

My consignment page is a Visual Force tab. I have overridden my consignment custom object tab to display the Visual Force page.
Hi,

I saw the winter 09 release webinar and it has very promising features that I would like to use. But I already have an organization which is on 08. I have written Apex Classes, VF pages and custom objects. In the webinar it was mentioned that to use the new features in winter 09 i have to sign up for the developer edition.

My Question is
1. How do I migrate my code from 08 developer edition organization to newly signed up 09 developer edition organization.

2. What about other edition(GE, PE etc) organization do I have to migrate the code and Custom objects there as well? If yes then how?

Message Edited by developer-force on 10-17-2008 01:58 AM
I have a custom object MyObject__c. I have created a validation rule for a field in the custom object such as amount__c < 0. I have defined the field in VisualForce page as follows
Code:
<apex:inputField id="amount" value="{!myObject.amount__c}"/> 

 
When I submit the validation work but it does not show the error message similar to what it does in default validation for required rule.

Message Edited by developer-force on 10-14-2008 10:02 AM

Message Edited by developer-force on 10-14-2008 10:03 AM
I have two custom objects

City and Location. I want to create a relationship between City and Location in a manner where one city can have many locations. I have modeled this using Master-detail relationship.

On the VisualForce page I have a select list with cities and on selecting a city from the select list using actionSupport I retrieve location list corresponding to the city selected.

My Custom city object structure is as below
Code:
<—xml version="1.0" encoding="UTF-8"–>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <deploymentStatus>Deployed</deploymentStatus>
    <description>Object for city</description>
    <enableActivities>true</enableActivities>
    <fields>
        <fullName>city__c</fullName>
        <indexed>true</indexed>
        <label>City</label>
        <length>100</length>
        <required>true</required>
        <type>Text</type>
        <unique>true</unique>
    </fields>
    <fields>
        <fullName>id__c</fullName>
        <displayFormat>CT-{00000000}</displayFormat>
        <label>ID</label>
        <type>AutoNumber</type>
    </fields>
    <label>City</label>
    <nameField>
        <displayFormat>CT-{00000000}</displayFormat>
        <label>city_id</label>
        <type>AutoNumber</type>
    </nameField>
    <pluralLabel>Cities</pluralLabel>
    <sharingModel>ReadWrite</sharingModel>
</CustomObject>

 
Location custom object

Code:
<—xml version="1.0" encoding="UTF-8"–>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <deploymentStatus>Deployed</deploymentStatus>
    <description>Object for location</description>
    <enableActivities>true</enableActivities>
    <fields>
        <fullName>city_id__c</fullName>
        <label>City</label>
        <referenceTo>City__c</referenceTo>
        <relationshipLabel>Locations</relationshipLabel>
        <relationshipName>Locations</relationshipName>
        <relationshipOrder>0</relationshipOrder>
        <type>MasterDetail</type>
    </fields>
    <fields>
        <fullName>id__c</fullName>
        <displayFormat>LC-{00000000}</displayFormat>
        <label>ID</label>
        <type>AutoNumber</type>
    </fields>
    <fields>
        <fullName>location__c</fullName>
        <indexed>true</indexed>
        <label>Location</label>
        <length>100</length>
        <required>true</required>
        <type>Text</type>
        <unique>true</unique>
    </fields>
    <label>Location</label>
    <nameField>
        <label>Location Name</label>
        <type>Text</type>
    </nameField>
    <pluralLabel>Locations</pluralLabel>
    <sharingModel>ControlledByParent</sharingModel>
</CustomObject>

When I create a Location record instead of the City__c.id__c value a random value is stored in the Location__c.city_id__c which is relationship field.

I feel I did not understand the SObjects storage and retrieval as required. I would appreciate  any help towards my understanding of the same.


Hi

How can I use internationalization i18N in Visualforce pages similar to Resource Bundles in Java?

For example if I am using <apex:outPutText value="Hello World" /> component. I want Hello World to be displayed in other languages.

Thanks and Regards
I need to create a custom record id based on certain fields and append an auto generated # to the ID. I have an auto generated id field in the object and and am creating the custom record by concatenating the fields with auto #.
 
I implemented this using an apex after insert trigger, but ran into the error 'record is read only'. If I implement this code in a before triger, the auto number is not getting generated.
 
Any suggestions on resolving this?
 
Thanks
M
Hi,

I saw the winter 09 release webinar and it has very promising features that I would like to use. But I already have an organization which is on 08. I have written Apex Classes, VF pages and custom objects. In the webinar it was mentioned that to use the new features in winter 09 i have to sign up for the developer edition.

My Question is
1. How do I migrate my code from 08 developer edition organization to newly signed up 09 developer edition organization.

2. What about other edition(GE, PE etc) organization do I have to migrate the code and Custom objects there as well? If yes then how?

Message Edited by developer-force on 10-17-2008 01:58 AM
I have a custom object MyObject__c. I have created a validation rule for a field in the custom object such as amount__c < 0. I have defined the field in VisualForce page as follows
Code:
<apex:inputField id="amount" value="{!myObject.amount__c}"/> 

 
When I submit the validation work but it does not show the error message similar to what it does in default validation for required rule.

Message Edited by developer-force on 10-14-2008 10:02 AM

Message Edited by developer-force on 10-14-2008 10:03 AM
I have two custom objects

City and Location. I want to create a relationship between City and Location in a manner where one city can have many locations. I have modeled this using Master-detail relationship.

On the VisualForce page I have a select list with cities and on selecting a city from the select list using actionSupport I retrieve location list corresponding to the city selected.

My Custom city object structure is as below
Code:
<—xml version="1.0" encoding="UTF-8"–>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <deploymentStatus>Deployed</deploymentStatus>
    <description>Object for city</description>
    <enableActivities>true</enableActivities>
    <fields>
        <fullName>city__c</fullName>
        <indexed>true</indexed>
        <label>City</label>
        <length>100</length>
        <required>true</required>
        <type>Text</type>
        <unique>true</unique>
    </fields>
    <fields>
        <fullName>id__c</fullName>
        <displayFormat>CT-{00000000}</displayFormat>
        <label>ID</label>
        <type>AutoNumber</type>
    </fields>
    <label>City</label>
    <nameField>
        <displayFormat>CT-{00000000}</displayFormat>
        <label>city_id</label>
        <type>AutoNumber</type>
    </nameField>
    <pluralLabel>Cities</pluralLabel>
    <sharingModel>ReadWrite</sharingModel>
</CustomObject>

 
Location custom object

Code:
<—xml version="1.0" encoding="UTF-8"–>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <deploymentStatus>Deployed</deploymentStatus>
    <description>Object for location</description>
    <enableActivities>true</enableActivities>
    <fields>
        <fullName>city_id__c</fullName>
        <label>City</label>
        <referenceTo>City__c</referenceTo>
        <relationshipLabel>Locations</relationshipLabel>
        <relationshipName>Locations</relationshipName>
        <relationshipOrder>0</relationshipOrder>
        <type>MasterDetail</type>
    </fields>
    <fields>
        <fullName>id__c</fullName>
        <displayFormat>LC-{00000000}</displayFormat>
        <label>ID</label>
        <type>AutoNumber</type>
    </fields>
    <fields>
        <fullName>location__c</fullName>
        <indexed>true</indexed>
        <label>Location</label>
        <length>100</length>
        <required>true</required>
        <type>Text</type>
        <unique>true</unique>
    </fields>
    <label>Location</label>
    <nameField>
        <label>Location Name</label>
        <type>Text</type>
    </nameField>
    <pluralLabel>Locations</pluralLabel>
    <sharingModel>ControlledByParent</sharingModel>
</CustomObject>

When I create a Location record instead of the City__c.id__c value a random value is stored in the Location__c.city_id__c which is relationship field.

I feel I did not understand the SObjects storage and retrieval as required. I would appreciate  any help towards my understanding of the same.


In one of the projects I am involved I need to show results with 600 or 700 rows (records) to the user. I thought to myself that this must be very hard for the user to browse all those in a long page (one list).

Then I remembered the nice Paging feature of .NET's Gridview and started investigating to see if PageBlockTable supports something similar. Unfortunately it does not!

So I decide to implement it myself and I have posted it on:
http://salesforcesource.blogspot.com

Check it out, now i was wondering if anyone else has done something on this and if there is a better way of doing so.




Message Edited by Sam.arj on 09-22-2008 07:42 AM
  • September 22, 2008
  • Like
  • 0
Hi

How can I use internationalization i18N in Visualforce pages similar to Resource Bundles in Java?

For example if I am using <apex:outPutText value="Hello World" /> component. I want Hello World to be displayed in other languages.

Thanks and Regards
I am having issues using the immediate attribute within actionSupport. The documentation says that "If set to true, the action happens immediately and any field validation rules are skipped." It doesn't mention anything about rerendering or data binding so I'm a little confused. Here is my problem:

I have a select list of contacts. When a contact is selected, a form with inputFields is rerendered to display the data of the selected contact. Some of these fields are required. If a field is null and you try to select a different contact you get an error message that the field is required. This is no good, so I added the immediate attribute to the actionSupport but now it does not appear to be rerendering the form.

Any ideas, suggestions?

Page:
Code:
<apex:page controller="input" >

<apex:form >
  <apex:selectList value="{!contactID}" size="5">
     <apex:selectOptions value="{!contacts}" />
     <apex:actionSupport event="onchange" action="{!updateContact}" rerender="form" immediate="true"/>
  </apex:selectList>
  <apex:pageBlock >
     <apex:panelGrid columns="2" id="form">
        Full Name: <apex:outputField value="{!c.Name}"/>
        Email: <apex:inputField value="{!c.Email}" required="true"/>
        Title: <apex:inputField value="{!c.Title}" required="true"/>
        Phone: <apex:inputField value="{!c.Phone}" required="true"/>
     </apex:panelGrid>  
  </apex:pageBlock>
</apex:form>

</apex:page>

Controller:
Code:
public class input {
    public String ContactId {set; get;}
    public Contact c {set; get;}
    private List<SelectOption> contacts;
    private Map<Id,Contact> contactMap = new Map<Id,Contact>();

    public List<SelectOption> getContacts(){
       if(contacts == null){
           Contact [] cons = [select Id, Name, Title, FirstName, LastName, Phone, Email from Contact limit 10];
           contactId = cons[0].Id;
           contacts = new List<SelectOption>();
    
           for(Contact c : cons){
              contacts.add(new SelectOption(c.ID,c.Name));
              contactMap.put(c.Id,c);
           }
       }
       return contacts;
    }
   
    public PageReference updateContact(){
        c = contactMap.get(ContactID);
        return null;
    }      
}