• mt0859
  • NEWBIE
  • 0 Points
  • Member since 2009

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

All, 

 

I'm looking for a way to retrieve the address of a create new object page using apex rather than api functions. For instance, in the api dvelopers guide in Java you use "describeSObject()" to populate a "describeSObjectResult" object from which you can use the field "urlNew"

 

Is there an equivalent of this in Apex or do I have to use a webservice to call out, then the Java api function to retrieve it! 

 

Thanks,

 

M

 

Hi all,

 

I have a visual force page (with its own custom ontroller) in a managed package which tries to display an iFrame where the URL is set in the page controller

 

i.e.

<apex:iframe src="{!PropURLToDisplay}" scrolling="true" rendered="true"/>

 

 

 However, when I set the variable on the page to be, "URLFOR($Action.Account.New)" using:

 

public string getPropURLToDisplay() { string URL = 'URLFOR($Action.Account.New)'; return URL;}

 

 

 I always get the VF page erroring with the message:

 

Page MyPackageName__URLFOR($Action.Account.New) does not exist

 

Is this a bug? Are there any ways to get around this?

 

TIA,

 

Marco 

Hi all,

 

I have a visual force page (with its own custom ontroller) in a managed package which tries to display an iFrame where the URL is set in the page controller

 

i.e.

<apex:iframe src="{!PropURLToDisplay}" scrolling="true" rendered="true"/>

 

 

 However, when I set the variable on the page to be, say, "www.google.com" using:

 

public string getPropURLToDisplay() { string URL = 'www.google.com'; return URL;}

 

 

 I always get the VF page erroring with the message:

 

"Page MyPackageName__www.google.com does not exist"

 

Is this a bug? Are there any ways to get around this?

 

TIA,

 

Marco 

 

 

has anyone ever got the following error message when trying to install a package?

 

 

 

examplechildpagecontrollerext.testEXAMPLEChildPageControllerExt()   
Apex Classes(01p80000000261T)System.StringException: Invalid id:
(WizardForce2)

 

 

The method it refers to is a test method in the "examplechildpagecontrollerext" class. Any ideas how to fix?

 

Cheers,

 

Marco

Collective wisdom please!

 

I have a managed package (say MyPackageName) installed in a dev org which contains a page controller (say MyPackagedPageController) and i am having 2 problems:

 

Firstly:

If i try to use the package's page controller for a VF page, it works fine e.g. controller="MyPackageName.MyPackagedPageController".

However, if i try to include an extension in the VF page that is not found in the package (say MyExtension) e.g. extensions="MyExtension",

when i try click on a button on the VF page that is supposed to refresh the page (an apex function returning a page reference) I get the error:"Apex class 'MyPackageName.MyExtension' does not exist"

 

Secondly:

If i simply try and have a page controller (say MySeparatePageController) for the VF page e.g. controller="MySeparatePageController", I get an error when i just try and save the VF page saying during development simply saying: "Error: Index: 0"

 

Any thoughts please?!

 

M

Collective wisdom please!

 

I have a managed package (say MyPackageName) installed in a dev org, which contains a page controller (say MyPackagedPageController) and i am having 2 problems:

 

Firstly:

If i try to use the package's page controller for a VF page, it works fine e.g. controller="MyPackageName.MyPackagedPageController".

However, if i try to include an extension in the VF page that is not found in the package (say MyExtension) e.g. extensions="MyExtension",

when i try click on a button on the VF page that is supposed to refresh the page (an apex function returning a page reference) I get the error:"Apex class 'MyPackageName.MyExtension' does not exist"

 

Secondly:

If i simply try and have a page controller (say MySeparatePageController) for the VF page e.g. controller="MySeparatePageController", I get an error when i just try and save the VF page saying during development simply saying: "Error: Index: 0"

 

Any thoughts please?!

 

M

Message Edited by mt0859 on 06-22-2009 02:33 PM

All,

 

I'm having an issue whereby Salesforce is giving me a namespace error when trying to load a Visualforce page with a composition in it.

 

The error reads (in generic form):  

"Apex class 'PackageNamespace.MyPageControllerExtension' does not exist"

 

Now, the controller extension above is saved as: 

"MyPageControllerExtension"  

 

in the apex classes and is NOT in a package. BUT, it IS an extension of a page controller

"MyBasicPageController"

 

that IS found in a managed package

"PackageNamespace"

 

that has been installed on the org, which is thus referenced by

"PackageNamespace.MyBasicPageController"

 

As a final piece of back ground, "PackageNamespace.MyBasicPageController" controls a 'master' page in which a composition (page), controlled by "MyPageControllerExtension", is displayed.

 

This is the part that causes the error:

 

There is a method in "PackageNamespace.MyBasicPageController" which is called and returns a page reference in order to reload the 'master' page and the composition. However, the error message above is what results i.e. Salesforce seems to think that the page controller extension is in the installed package when it isn't!!

 

Any help in this matter would be much appreciated. Could this be a bug?

 

Marco

Hi All,

 

Does anyone know of any known issues concerning the interraction of events, javascript and action functions? e.g. a button's "onclick" event triggers a javascript function which calls an action function.

 

I appear to have VF page examples, of the form I've mentioned above, whereby sometimes the action function will be called  and sometimes it won't - it can change between 2 clicks in the space of 10s or so, or work in the morning, then stop working in the afternoo. 

 

Any ideas would be much appreciated as it's making coding infuriating.

 

Regards,

 

Marco

 

Hi All,

 

I'm having a problem with my visual force page whereby i'm simply trying to get a command button to call a test javascript function, and it just doesn't want to play! i've managed to do it on other VF pages i have, but for some reason here it just won't work. Hopefully it's something dead simple that i've just missed because i've been staring at it for so long!

 

The page is of the form:

 

 

<apex:page controller="AController" extensions="AControllerExt" >
<apex:form id="form">
<h1>Some text here</h1>
</apex:form>
<apex:form>
<apex:outputLabel>Label text here</apex:outputLabel>
<br/>
<br/>
<apex:commandButton value="ButtonText" onmousedown="test()"/>
<br/>
<br/>
</apex:form>

<script>

function test() {

alert('in test function');
}

</script>

</apex:page>

 

 

Just to clarify, I don't get the alert box popping up, the page just refreshes.

 

Any ideas?

 

TIA,

 

Marco

 

Message Edited by mt0859 on 05-27-2009 10:03 AM
Message Edited by mt0859 on 05-27-2009 10:04 AM

Hi All,

 

I'm trying to call an Apex function (in a controller extension class) using a Javascript "onclick" event and a VF ActionFunction. The scenario is this....

 

The button that triggers the "onclick" event is located in a VF page of form:

 

 

<apex:page controller="MyMasterPageController">

<apex:sectionHeader title="ATitle">
<apex:pageBlock >
<apex:composition template="MyChildPageComposition"/>

<apex:form >
<apex:commandButton value="Click Me" onclick="MyJavascriptFunc()"/>
</apex:form>

</apex:pageBlock>
</apex:sectionHeader>

</apex:page>

 

which is known as the "master" page.

 

 

The javascript function is located in the composition "MyChildPageComposition" of form:

 

 

<apex:page controller="MyMasterPageController" extensions="ControllerExtForChildPage">
<apex:form >

<apex:actionFunction action="{!myApexFunc}" name="MyJavascriptFunc"/>

<apex:pageBlock>
<apex:pageBlockSection title="ASectionTitle">

<!-- Input fields/bulk of VF page etc goes here -->

</apex:pageBlockSection>
</apex:pageBlock>

</apex:form>
</apex:page>

 

which is known as the "child" page and displayed within the "master" page using the <apex:composition> functionality.

 

 

The Apex function "myApexFunc" is found in the class "ControllerExtForChildPageComposition" and is of form:

 

 

public PageReference myApexFunc() {

// do something here
system.debug('Print some debug here');

return null;
}

 

 

 

Now, my issue is that if I create the VF pages for real as basic as those examples above, "myApexFunc" is successfully called (the debug is printed, and any other code in it runs) when the "Click Me" button in the master page is clicked.

 

However, when I have attempted to incorprate the basic apex and VF code above into existing master/child pages and their associated controllers and extensions, "myApexFunc" is never successfully called. In fact, if the child page is subsituted for a child page of this form:

 

 

 

<apex:page controller="MyMasterPageController" extensions="ControllerExtForChildPage">
<apex:form >

<apex:actionFunction action="{!myApexFunc}" name="AnotherJavascriptFunc"/>

<script>

function MyJavascriptFunc() {
alert('Running Javascript');
AnotherJavascriptFunc();
alert('Finishing javascript');
}

</script>

<apex:pageBlock>
<apex:pageBlockSection title="ASectionTitle">

<!-- Input fields/bulk of VF page etc goes here -->

</apex:pageBlockSection>
</apex:pageBlock>

</apex:form>
</apex:page>

 

which is incorprated into an existing child page,both alerts are run (proving that the link between the "onclick" event in the master page and "MyJavascriptFunc" in the child page composition is there, but "myApexFunc" is still not called! Can anyone shed any light on this? Is there any VF or Apex code which is incompatible with using Javascript and action functions? As I said before, when it's in its basic forms above, everything works, just not when other VF and apex code are added.

 

Many thanks,

 

Marco

 

 

 

 

 

 

 

 

In the same way that it is possible to use the Metadata API to create custom objects in SF, is it possible to create Apex classes or VF pages?

 

TIA

  • March 20, 2009
  • Like
  • 0

I've been trying to create a wizard which steps through collecting data to populate accounts and contacts using, for example:

 

........

 

<apex:inputField  value="{!account.name}"/>

..........

 

 

 

with the following code in the page controller:

 

 

 

.......

Account accNewAccount;

 

 

public Account getAccount()
{
        return accNewAccount;  
}

public void setAccount(Account AccInfo)
{
        this.accNewAccount = AccInfo;  
}

...........

 

 

However, now I am trying to populate fields in a custom object, whose name is "Offer", namespace prefix is "expw190209" and API name is "expw190209__Offer__c".

 

I try and follow the method for the account object on the page and the page controller, but it doesn't seem to work, and I cannot seem to find instructions that show you how to do it with anything other than a standard object!

 

If anyone could give me an example along the lines of what I wrote above, it would be much appreciated.

 

Thanks.

 

 

 

 

  • February 23, 2009
  • Like
  • 0

All, 

 

I'm looking for a way to retrieve the address of a create new object page using apex rather than api functions. For instance, in the api dvelopers guide in Java you use "describeSObject()" to populate a "describeSObjectResult" object from which you can use the field "urlNew"

 

Is there an equivalent of this in Apex or do I have to use a webservice to call out, then the Java api function to retrieve it! 

 

Thanks,

 

M

 

Hi all,

 

I have a visual force page (with its own custom ontroller) in a managed package which tries to display an iFrame where the URL is set in the page controller

 

i.e.

<apex:iframe src="{!PropURLToDisplay}" scrolling="true" rendered="true"/>

 

 

 However, when I set the variable on the page to be, "URLFOR($Action.Account.New)" using:

 

public string getPropURLToDisplay() { string URL = 'URLFOR($Action.Account.New)'; return URL;}

 

 

 I always get the VF page erroring with the message:

 

Page MyPackageName__URLFOR($Action.Account.New) does not exist

 

Is this a bug? Are there any ways to get around this?

 

TIA,

 

Marco 

Hi all,

 

I have a visual force page (with its own custom ontroller) in a managed package which tries to display an iFrame where the URL is set in the page controller

 

i.e.

<apex:iframe src="{!PropURLToDisplay}" scrolling="true" rendered="true"/>

 

 

 However, when I set the variable on the page to be, say, "www.google.com" using:

 

public string getPropURLToDisplay() { string URL = 'www.google.com'; return URL;}

 

 

 I always get the VF page erroring with the message:

 

"Page MyPackageName__www.google.com does not exist"

 

Is this a bug? Are there any ways to get around this?

 

TIA,

 

Marco 

 

 

Collective wisdom please!

 

I have a managed package (say MyPackageName) installed in a dev org, which contains a page controller (say MyPackagedPageController) and i am having 2 problems:

 

Firstly:

If i try to use the package's page controller for a VF page, it works fine e.g. controller="MyPackageName.MyPackagedPageController".

However, if i try to include an extension in the VF page that is not found in the package (say MyExtension) e.g. extensions="MyExtension",

when i try click on a button on the VF page that is supposed to refresh the page (an apex function returning a page reference) I get the error:"Apex class 'MyPackageName.MyExtension' does not exist"

 

Secondly:

If i simply try and have a page controller (say MySeparatePageController) for the VF page e.g. controller="MySeparatePageController", I get an error when i just try and save the VF page saying during development simply saying: "Error: Index: 0"

 

Any thoughts please?!

 

M

Message Edited by mt0859 on 06-22-2009 02:33 PM

Hi All,

 

I'm trying to call an Apex function (in a controller extension class) using a Javascript "onclick" event and a VF ActionFunction. The scenario is this....

 

The button that triggers the "onclick" event is located in a VF page of form:

 

 

<apex:page controller="MyMasterPageController">

<apex:sectionHeader title="ATitle">
<apex:pageBlock >
<apex:composition template="MyChildPageComposition"/>

<apex:form >
<apex:commandButton value="Click Me" onclick="MyJavascriptFunc()"/>
</apex:form>

</apex:pageBlock>
</apex:sectionHeader>

</apex:page>

 

which is known as the "master" page.

 

 

The javascript function is located in the composition "MyChildPageComposition" of form:

 

 

<apex:page controller="MyMasterPageController" extensions="ControllerExtForChildPage">
<apex:form >

<apex:actionFunction action="{!myApexFunc}" name="MyJavascriptFunc"/>

<apex:pageBlock>
<apex:pageBlockSection title="ASectionTitle">

<!-- Input fields/bulk of VF page etc goes here -->

</apex:pageBlockSection>
</apex:pageBlock>

</apex:form>
</apex:page>

 

which is known as the "child" page and displayed within the "master" page using the <apex:composition> functionality.

 

 

The Apex function "myApexFunc" is found in the class "ControllerExtForChildPageComposition" and is of form:

 

 

public PageReference myApexFunc() {

// do something here
system.debug('Print some debug here');

return null;
}

 

 

 

Now, my issue is that if I create the VF pages for real as basic as those examples above, "myApexFunc" is successfully called (the debug is printed, and any other code in it runs) when the "Click Me" button in the master page is clicked.

 

However, when I have attempted to incorprate the basic apex and VF code above into existing master/child pages and their associated controllers and extensions, "myApexFunc" is never successfully called. In fact, if the child page is subsituted for a child page of this form:

 

 

 

<apex:page controller="MyMasterPageController" extensions="ControllerExtForChildPage">
<apex:form >

<apex:actionFunction action="{!myApexFunc}" name="AnotherJavascriptFunc"/>

<script>

function MyJavascriptFunc() {
alert('Running Javascript');
AnotherJavascriptFunc();
alert('Finishing javascript');
}

</script>

<apex:pageBlock>
<apex:pageBlockSection title="ASectionTitle">

<!-- Input fields/bulk of VF page etc goes here -->

</apex:pageBlockSection>
</apex:pageBlock>

</apex:form>
</apex:page>

 

which is incorprated into an existing child page,both alerts are run (proving that the link between the "onclick" event in the master page and "MyJavascriptFunc" in the child page composition is there, but "myApexFunc" is still not called! Can anyone shed any light on this? Is there any VF or Apex code which is incompatible with using Javascript and action functions? As I said before, when it's in its basic forms above, everything works, just not when other VF and apex code are added.

 

Many thanks,

 

Marco