• Javaj
  • NEWBIE
  • 80 Points
  • Member since 2008

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 12
    Replies

Does anybody know how I can populate a picklist from a trigger

 

My client whats the picklist to be dynamic

I'm not even sure if apex trigger is required for this, since formula fields could possibly do this.  Just wondering whether someone has done this or not.

 

The calculation/value currently should equal "31" since next month has that many days (August). 

 

Any help would be great.

 

Thanks.

  • July 22, 2009
  • Like
  • 0

How would you create a Formula field to calculate amount of days in the next month.  So for example the calculation/value of this formula field should equal "31" since next month has 31 days (August).

 

Any help would be great.

 

Thanks.

 

  • July 22, 2009
  • Like
  • 0
How can I retrieve View ( listView ) for custom objects through SOQL Query?
  • July 27, 2009
  • Like
  • 0

Hi there,

I want to create list views under two tabs inside the panel, the first one should list the  listviews starts with 'A' and the second one should  list the listviews starts with 'B' . The problems is here how to query/filter with startswith the filterids ?

<apex:selectList value="{!filterid}" size="1">
<apex:selectOptions value="{!listviewoptions}"/>
</apex:selectList>


 how to query the listviews (http://www.salesforce.com/us/developer/docs/api_meta/index_Left.htm#StartTopic=Content/meta_listview.htm ) or proceed further.

 

Any help will be very appreciated, thank you very much.

 

 

 

  • July 25, 2009
  • Like
  • 0

I have written a sample Flex code and i tried to invoke it through a visual force page.

 

1. 

 

It worked fine with my developer instance(i.e., it was fetching the desired records). But it is not working with the Sandbox instance.

 

The connection part of the code [developer]:

 

 

<salesforce:Connection id="conn" serverUrl="https://www.salesforce.com/services/Soap/u/16.0" />

 

 and for sandbox:

  <salesforce:Connection id="conn" serverUrl="https://test.salesforce.com/services/Soap/u/16.0" />

Is there any modification that i need to do here to make it work in sandbox? [But, it was able to fetch the records when i tried to run the code directly from Flex builder].

Any help on this matter will be appreciated.

 

2.

 

Issue while authenticating:

 

I have tried to directly passing the username and password by hardcoding them in the code and also through Session ID.

Both of them Failed.

 

I would ideally like to pass the session Id and make it work

 

[However, both the methods worked in my developer edition]

 

private function doLogin():void
{
var lr:LoginRequest = new LoginRequest();

lr.username = "mySandboXusername@mydomain.com.test";
lr.password = "$$$$$$$$$$";

//lr.session_id = this.parameters.sid;
//lr.server_url = this.parameters.surl;

lr.callback = new AsyncResponder(loginResult, loginFault);
conn.login(lr);
}

 

 

 The Visual Force page from where i am invoking the flex is:

 

 

<apex:page >
<apex:pageBlock title="Flex Page">
<apex:flash src="{!$Resource.flex}" width="500" height="300" play="true" />
flashvars="sid={!$Api.Session_ID}&surl={!$Api.Partner_Server_URL_90}"/>

</apex:pageBlock>
</apex:page>

 

 The query part involved in the flex code is:

 

 

private function loginResult(result:Object):void
{
conn.query("SELECT Id, Contact.Firstname,phone, Contact.Lastname FROM Contact",
new AsyncResponder(queryResult));
}

 

 

 

Can some one please help me out on this.

If not,  even if you can even point me in the right direction, that would be great!

 

 

 

 

Message Edited by Javaj on 06-26-2009 06:13 AM
  • June 26, 2009
  • Like
  • 0

Hi,

 

Assuming that Contact has a relationship to Account, and Account has a relationship to Owner (User), how do I get the information of the Owner when I query from the Contact?

 

I've constructed the following query base on the example of the documentation, it doesn't throw any error but I couldn't get the values for the Owner:

 

SELECT Id, Name, Account.Owner.FirstName FROM Contact;

 

 

Is the SOQL correct?

Hello and I apologize if this a basic question, but my developer and myself are trying to change a Text Field/TextArea (currently maxing out at 255 characters) to Text Area (long).  However, we're getting a message stating the following:

 

Force Message

What steps do we take to rectify this?  Our previous developer who created the initial Apex classes is no longer available.

 

Thanks in advance for the help and guidance.

Does anybody know how I can populate a picklist from a trigger

 

My client whats the picklist to be dynamic

Is it possible to populate the picklist using Apex code from a class or a trigger?

 

I appears that it can be done using the Salesforce API but I can't find any examples where this can be done directly in Salesforce using the native apex code.

 

Thanks

 

Stephen

I'm not even sure if apex trigger is required for this, since formula fields could possibly do this.  Just wondering whether someone has done this or not.

 

The calculation/value currently should equal "31" since next month has that many days (August). 

 

Any help would be great.

 

Thanks.

  • July 22, 2009
  • Like
  • 0

How would you create a Formula field to calculate amount of days in the next month.  So for example the calculation/value of this formula field should equal "31" since next month has 31 days (August).

 

Any help would be great.

 

Thanks.

 

  • July 22, 2009
  • Like
  • 0

I have a problem in static resources.

My picture is nothing in Force.com

The code is <apex:image url="{!$Resource.Blackberry}"></apex:image>  

 

Any idea?

 

 

regard

 

ahui

  • July 21, 2009
  • Like
  • 0

I have no idea how to remove or deactivate a trigger that is deployed to production... Everything I have is working properly right now, but I worry that if something goes wrong and freezes a system, I won't be able to remove my code. Could someone walk me through the process?

 

Thanks!

Charlie

I have written a sample Flex code and i tried to invoke it through a visual force page.

 

1. 

 

It worked fine with my developer instance(i.e., it was fetching the desired records). But it is not working with the Sandbox instance.

 

The connection part of the code [developer]:

 

 

<salesforce:Connection id="conn" serverUrl="https://www.salesforce.com/services/Soap/u/16.0" />

 

 and for sandbox:

  <salesforce:Connection id="conn" serverUrl="https://test.salesforce.com/services/Soap/u/16.0" />

Is there any modification that i need to do here to make it work in sandbox? [But, it was able to fetch the records when i tried to run the code directly from Flex builder].

Any help on this matter will be appreciated.

 

2.

 

Issue while authenticating:

 

I have tried to directly passing the username and password by hardcoding them in the code and also through Session ID.

Both of them Failed.

 

I would ideally like to pass the session Id and make it work

 

[However, both the methods worked in my developer edition]

 

private function doLogin():void
{
var lr:LoginRequest = new LoginRequest();

lr.username = "mySandboXusername@mydomain.com.test";
lr.password = "$$$$$$$$$$";

//lr.session_id = this.parameters.sid;
//lr.server_url = this.parameters.surl;

lr.callback = new AsyncResponder(loginResult, loginFault);
conn.login(lr);
}

 

 

 The Visual Force page from where i am invoking the flex is:

 

 

<apex:page >
<apex:pageBlock title="Flex Page">
<apex:flash src="{!$Resource.flex}" width="500" height="300" play="true" />
flashvars="sid={!$Api.Session_ID}&surl={!$Api.Partner_Server_URL_90}"/>

</apex:pageBlock>
</apex:page>

 

 The query part involved in the flex code is:

 

 

private function loginResult(result:Object):void
{
conn.query("SELECT Id, Contact.Firstname,phone, Contact.Lastname FROM Contact",
new AsyncResponder(queryResult));
}

 

 

 

Can some one please help me out on this.

If not,  even if you can even point me in the right direction, that would be great!

 

 

 

 

Message Edited by Javaj on 06-26-2009 06:13 AM
  • June 26, 2009
  • Like
  • 0

Hi..

  I am using <apex:tabpanel> for displaying tabs One & Two.. I want to know which tab is selected

<apex:page id="thePage"> <apex:outputtext> Here I have to display some content based on tab selection </apex:outputtext> <apex:tabPanel switchType="client" selectedTab="name2" id="theTabPanel"> <apex:tab label="One" name="A" id="tabOne">content for tab one</apex:tab> <apex:tab label="Two" name="B" id="tabTwo">content for tab two</apex:tab> </apex:tabPanel> </apex:page>

Based on the tab selection I have to do some calculation and display some content... If tab One is selected I have to display Tab One is selected like that..

 

 

Is it possible in VF..?

Hi,

I have a situation where I need to dynamically set the default tab in a tab panel. I have a parameter in my controller that I'm trying to use but for some reason the default tab isn't being set. If I hard code the name of the tab it works but once I try to use a visual force parameter the default tab doesn't get set properly. Here's sample code that illustrates the problem:

Code:
public class TabTest {


 public String ActiveTab {get; set;} 
 
 
 public TabTest() {
  this.ActiveTab = 'Tab2'; 
 }


}

Code:
<apex:page controller="TabTest">
 <apex:tabPanel switchType="client" selectedTab="{!ActiveTab}" id="slipTabPanel">
    <apex:tab label="Tab 1" name="tab1" id="tab1">
      Tab1
    </apex:tab>
    <apex:tab label="Tab 2" name="tab2" id="tab2">
      Tab2 
    </apex:tab>
    <apex:tab label="Tab 3" name="tab3" id="tab3">
      Tab3
    </apex:tab>
 </apex:tabPanel>
</apex:page>

 If I hard code to selectedTab="tab2" then it works fine but if I try to use a controller parameter it doesn't work. Any ideas what I might be doing wrong?
 

  • September 10, 2008
  • Like
  • 0
In http://wiki.apexdevnet.com/index.php/Tabbed_Accounts_in_30_seconds
I've done the same for my custom object and it works pretty good.
On mine I have defined  TAB-A, TAB-B, TAB-C
I have extension controller code getting called on one of my extra Tabs (TAB-B) and that works fine too.

However I want it to return the user exactly where they were (in TAB-B) but I cannot find what that tab reference/url is.
It appears to be a Frame with a hidden field (j_id0:CaseTabPanel=TAB-B)

Any ideas on how I'd re-render that back from my controller (via PageReference ?)

Thanks
Lal