• dfalso
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 20
    Replies

Hi all, here's my problem:

I've got two custom objects (Grants__c and Addresses__c), which are many-to-many related. So I've built a junction object (GrantAddressBridge__c) with master-detail to both. I want to include the Addresses as a related list on the Grants page, but do NOT want to show the label name of the record of the junction object, just the name(s) of the Address(es). I do, however, want to have the Delete action delete from the junction object (obviously). 

 

It looks like, even though I'm creating this in a custom VF page, the related list inherits it's layout from the current page layout of the object. So I tried to edit the layout of the related list to remove the junction label name and get this error:

 

 

 Custom Object Label Name cannot be removed and must be the first field in the related list.

 
[I have another situation exactly like this that I coded about 6 months ago, and it doesn't have the custom object label name, so I assume the old layout editor allowed this and it was grandfathered in or something]
 
OK, so I need to manually create a related list-style pageblock. I'm running into problems recreating the delete action. I'm currently trying this:

  

<apex:outputLink value="{!URLFOR($Action.GrantAddressBridge__c.delete, Grant__c.id)}" onclick="return window.confirm('Are you sure?');">Del</apex:outputLink>

 

The problem is that it doesn't produce the correct return URL, as I want it to return to the current Grant page. Has anyone done anything like this (creating a related list manually), and if so, how did you address this piece?

 

Thanks much for any help.  

I'm attempting to install my package in our sandbox (developed in my developer account). I'm able to package it up and install it via the web link. However, when I actually try to run it in the sandbox, all of my objects' pages are set to the default (I made custom VF pages and overrode many of them), and when I manually set the override for a given object, if the VF page is using an extension, it can't find and gives an error regarding the standard controller (ex: Unknown property 'Outcomes__CIIS_Project__cStandardController.CIIS_Project__c'). For pages using a custom controller, the overrides are still lost, but if I reinstate them manually the page does work.

 

I've checked permissions on my pages and every single profile is enabled (I'm also logged in as admin in the sandbox). I've tried rebuilding the package in my dev account and deleting from the sandbox and installing a new one, but same problem. I'm not sure what's going on at this point.

 

Any help or insight would be appreciated. Thanks much.

 

-Dominic Falso

 The Reinvestment Fund, Inc.

  • March 16, 2009
  • Like
  • 0
HI all,
I asked this before in another post but got no response, so I just wanted to try once more before giving up.
I'm building a custom Apex component. I need a JavaScript function to run to initialize the component features. I have an <html> section in my component, so I've tried setting the onload attribute there with no luck. I've tried puting a document.onLoad() call in both the <head> and the <body>, and also tried a window.onLoad() in both places. Nothing has worked so far.
Am I missing something, or does this just not work?

Thanks for any help anyone can provide.
  • November 11, 2008
  • Like
  • 0
Does anyone know where I can find a good writeup for many-to-many implementation? I can't seem to find much documentation on it.
I do know that I need to make a junction object (done), but I'm looking for more information on how to interact with it. The only examples I've been able to find are S-controls.
Specifically, I'm looking for an example of how to get to the junction object's page from (one side of the many-to-many)'s page.

Thanks all.
  • October 31, 2008
  • Like
  • 0
Hi all,
First let me say thanks for helping me out thus far. I'm very appreciative of those helping us out on this forum. Especiallly those of us like myself who are relatively new to SF development.

I'm making a custom VF page tied to an address table object:
Code:
<apex:page standardController="Address__c" extensions="AddressExt" showHeader="true" sidebar="true" >
    <apex:sectionHeader title="{!$ObjectType.Address__c.label}" subtitle="{!Address__c.name}"/>
 <apex:form >
  <apex:pageBlock title="Address Information">
   <apex:pageBlockSection columns="1">
             <apex:inputField id="curStreetNo" value="{!Address__c.Street_Number__c}"/>
             <apex:inputField id="curStreetName" value="{!Address__c.Street_Name__c}"/>
             <apex:inputField id="curCity" value="{!Address__c.City__c}"/>
             <apex:inputField id="curState" value="{!Address__c.State__c}"/>
             <apex:inputField id="curZIP" value="{!Address__c.ZIP_Code__c}"/>
             <p/>
             <apex:outputText id="AddressString" value="{!FullAddressString}"/>
      </apex:pageBlockSection>
     </apex:pageBlock>
 </apex:form>
 <apex:pageBLock title="PolicyMap">
  <c:MapComponent AddressString="{!FullAddressString}"/>
 </apex:pageBLock>
</apex:page>
 (FullAddressString is a method in my controller extension that simply concatenates the pieces together to send to the map component)

 I've created a custom component to map said address:
Code:
<apex:component >
 <apex:attribute name="AddressString" description="Address String" type="String" required="true" />
 
 <html>
        <head>
            <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
            <title>TRF Test</title>

   <script language="javascript" type="text/javascript">
    function setAddress()
    {
     var JSaddressString = '{!AddressString}';

     var curTextBox = document.getElementById("addressTextBox"); 
     curTextBox.value = JSaddressString;
    }

    function showAddress(address) 
    {
     var geocoder = new PClientGeocoder();
     var map = new PMap(document.getElementById("map"));
        // Geocode address, center, add marker and open info window
        if (geocoder) {
            geocoder.getLatLng(
                address,
                function(point) {
                    if (!point)
                            alert("Address \"" + address + "\" not found");
                    else {
                        map.setCenter(point, 13);
                        var marker = new PMarker(point);
                        map.addOverlay(marker);
                        marker.openInfoWindowHtml(address);
                    }
                }
            );
        }
    }
   </script>
            <script src="http://api.pushpin.com/js—key=<mykey>" type="text/javascript">
            </script>
        </head>
  <body onload="setAddress()" onunload="PUnload()">
   <form action="#" id="form1" onsubmit="showAddress(this.address.value); return false">
    <p>
    Find Address: 
    <input id="addressTextBox" type="text" size="55" name="address"/>
    <input type="submit" value="Go" />
    <input type="button" value="Refresh Textbox" onclick="setAddress();"/>
    </p>
   </form>
   <div id="map" style="position: relative; width: 700px; height: 700px; border: 1px solid #979797"></div>
   <div id="message"></div>
  </body>
 </html>
</apex:component>

 (Note: PushPin is very close to Google in API so this should look about the same to someone used to Google Maps)
This in itself works just fine. Well, almost - the onload() call in the HTML body doesn't work. I have to push the "Refresh Textbox" button to manually call the function. Any ideas?

But here's the design question:
Ultimately, what I want is to remove the textbox in the custom component and refresh the map component whenever someone changes a value in one of the address fields (not the saved row - this is meant for validation before committing the record). To do this I'll need to fire an onchange event from each inputField that reads from the component values themselves and either
a) rerenders the map component (assuming I can ever get onload() to work), or
b) directly calls a method inside the map component (say, setAddress())

Is b) even possible? Anyone have advice on how they would design this setup?

Thanks for any help provided.
  • October 27, 2008
  • Like
  • 0
Hi all, I'm pretty new to SalesForce development, so maybe this has been answered somewhere else and I missed it. If so, I apologize.
Anyway, I'm working with a custom object that has a one-to-many relationship with another custom object (in fact, I'll have a chain of about 5 when I'm done). I created a custom page and was confused when the detail object didn't inherit the master's Id. I found this link that (I think) is the same problem with a solution:
http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=5894

What I'm wondering now is the best way to run this class. FYI, I was initially planning on using a standard controller with this as an extension. Ideally, the class would run at page instantiation. I suppose I'd be okay with running it just before the save action. I'd ideally not do it as a trigger (this to me is an issue related to the custom page, not something that should happen globally - but maybe I'm wrong). Any recommendations? If I were to couple it to the save button, how would that go? Can an extension call a standard action (in which case I'd point the button at an extension method which would write the Id and then save)? If not, I think I need to write a custom controller, right?

Thanks for any assistance.
-Dominic
  • October 15, 2008
  • Like
  • 0
Hi all, I'm a relatively new Apex developer, and was looking for a list of Apex naming rules. I recently attended a Dev 501 class and I remember we briefly touched on this topic, but for the life of me, I can't find documentation or discussion on this. If you have a good link for me to follow, that'd be great.

Things like:
-When I try to use an underscore in my class name, Eclipse complains that it can't write to the server, so I assume underscores are bad.
-I know there's an upper limit on the number of characters in a name, but I don't know what it is.

Thanks all,
-Dominic
  • October 06, 2008
  • Like
  • 0

I am trying to load a tab programatically, so far I use the url that I see when I click on the tab, but I want to make sure this is the correct way:

 

 

public PageReference GoToTab() { PageReference pageRef = new PageReference('/servlet/servlet.Integration?lid=01r800000003iF1&ic=1'); return pageRef; }

 

Will that also work in a deployed managed application at a customer's site?

 

Thanks

 

 

I'm attempting to install my package in our sandbox (developed in my developer account). I'm able to package it up and install it via the web link. However, when I actually try to run it in the sandbox, all of my objects' pages are set to the default (I made custom VF pages and overrode many of them), and when I manually set the override for a given object, if the VF page is using an extension, it can't find and gives an error regarding the standard controller (ex: Unknown property 'Outcomes__CIIS_Project__cStandardController.CIIS_Project__c'). For pages using a custom controller, the overrides are still lost, but if I reinstate them manually the page does work.

 

I've checked permissions on my pages and every single profile is enabled (I'm also logged in as admin in the sandbox). I've tried rebuilding the package in my dev account and deleting from the sandbox and installing a new one, but same problem. I'm not sure what's going on at this point.

 

Any help or insight would be appreciated. Thanks much.

 

-Dominic Falso

 The Reinvestment Fund, Inc.

  • March 16, 2009
  • Like
  • 0
I have a custom object for which I want to override the standard 'new' button with a visualforce page.

My visualforce page is created, but when I go to override, the page isn't in the list! What step am I missing? I am baffled. This is in my developer edition.

screencast of my steps:
http://screencast.com/t/9yG27DxgouD


Message Edited by EricVlach on 11-13-2008 12:30 PM
HI all,
I asked this before in another post but got no response, so I just wanted to try once more before giving up.
I'm building a custom Apex component. I need a JavaScript function to run to initialize the component features. I have an <html> section in my component, so I've tried setting the onload attribute there with no luck. I've tried puting a document.onLoad() call in both the <head> and the <body>, and also tried a window.onLoad() in both places. Nothing has worked so far.
Am I missing something, or does this just not work?

Thanks for any help anyone can provide.
  • November 11, 2008
  • Like
  • 0
Hi all,
First let me say thanks for helping me out thus far. I'm very appreciative of those helping us out on this forum. Especiallly those of us like myself who are relatively new to SF development.

I'm making a custom VF page tied to an address table object:
Code:
<apex:page standardController="Address__c" extensions="AddressExt" showHeader="true" sidebar="true" >
    <apex:sectionHeader title="{!$ObjectType.Address__c.label}" subtitle="{!Address__c.name}"/>
 <apex:form >
  <apex:pageBlock title="Address Information">
   <apex:pageBlockSection columns="1">
             <apex:inputField id="curStreetNo" value="{!Address__c.Street_Number__c}"/>
             <apex:inputField id="curStreetName" value="{!Address__c.Street_Name__c}"/>
             <apex:inputField id="curCity" value="{!Address__c.City__c}"/>
             <apex:inputField id="curState" value="{!Address__c.State__c}"/>
             <apex:inputField id="curZIP" value="{!Address__c.ZIP_Code__c}"/>
             <p/>
             <apex:outputText id="AddressString" value="{!FullAddressString}"/>
      </apex:pageBlockSection>
     </apex:pageBlock>
 </apex:form>
 <apex:pageBLock title="PolicyMap">
  <c:MapComponent AddressString="{!FullAddressString}"/>
 </apex:pageBLock>
</apex:page>
 (FullAddressString is a method in my controller extension that simply concatenates the pieces together to send to the map component)

 I've created a custom component to map said address:
Code:
<apex:component >
 <apex:attribute name="AddressString" description="Address String" type="String" required="true" />
 
 <html>
        <head>
            <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
            <title>TRF Test</title>

   <script language="javascript" type="text/javascript">
    function setAddress()
    {
     var JSaddressString = '{!AddressString}';

     var curTextBox = document.getElementById("addressTextBox"); 
     curTextBox.value = JSaddressString;
    }

    function showAddress(address) 
    {
     var geocoder = new PClientGeocoder();
     var map = new PMap(document.getElementById("map"));
        // Geocode address, center, add marker and open info window
        if (geocoder) {
            geocoder.getLatLng(
                address,
                function(point) {
                    if (!point)
                            alert("Address \"" + address + "\" not found");
                    else {
                        map.setCenter(point, 13);
                        var marker = new PMarker(point);
                        map.addOverlay(marker);
                        marker.openInfoWindowHtml(address);
                    }
                }
            );
        }
    }
   </script>
            <script src="http://api.pushpin.com/js—key=<mykey>" type="text/javascript">
            </script>
        </head>
  <body onload="setAddress()" onunload="PUnload()">
   <form action="#" id="form1" onsubmit="showAddress(this.address.value); return false">
    <p>
    Find Address: 
    <input id="addressTextBox" type="text" size="55" name="address"/>
    <input type="submit" value="Go" />
    <input type="button" value="Refresh Textbox" onclick="setAddress();"/>
    </p>
   </form>
   <div id="map" style="position: relative; width: 700px; height: 700px; border: 1px solid #979797"></div>
   <div id="message"></div>
  </body>
 </html>
</apex:component>

 (Note: PushPin is very close to Google in API so this should look about the same to someone used to Google Maps)
This in itself works just fine. Well, almost - the onload() call in the HTML body doesn't work. I have to push the "Refresh Textbox" button to manually call the function. Any ideas?

But here's the design question:
Ultimately, what I want is to remove the textbox in the custom component and refresh the map component whenever someone changes a value in one of the address fields (not the saved row - this is meant for validation before committing the record). To do this I'll need to fire an onchange event from each inputField that reads from the component values themselves and either
a) rerenders the map component (assuming I can ever get onload() to work), or
b) directly calls a method inside the map component (say, setAddress())

Is b) even possible? Anyone have advice on how they would design this setup?

Thanks for any help provided.
  • October 27, 2008
  • Like
  • 0
Hi all, I'm pretty new to SalesForce development, so maybe this has been answered somewhere else and I missed it. If so, I apologize.
Anyway, I'm working with a custom object that has a one-to-many relationship with another custom object (in fact, I'll have a chain of about 5 when I'm done). I created a custom page and was confused when the detail object didn't inherit the master's Id. I found this link that (I think) is the same problem with a solution:
http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=5894

What I'm wondering now is the best way to run this class. FYI, I was initially planning on using a standard controller with this as an extension. Ideally, the class would run at page instantiation. I suppose I'd be okay with running it just before the save action. I'd ideally not do it as a trigger (this to me is an issue related to the custom page, not something that should happen globally - but maybe I'm wrong). Any recommendations? If I were to couple it to the save button, how would that go? Can an extension call a standard action (in which case I'd point the button at an extension method which would write the Id and then save)? If not, I think I need to write a custom controller, right?

Thanks for any assistance.
-Dominic
  • October 15, 2008
  • Like
  • 0
I have two custom objects with master-detail relationships.
Detail custom object's New button has overrided with the Visual force page.
now, I want to access Master's Record Id to set in Detail's Field in "Save" method in EXTENSION class. This method is to insert the detail record . 
 
How can i Do this?
 
Thanks in Advance.
 
 
Shwetal
 
I am looking for details on variables which can be passed through the Salesforce URL.
For example: Passing isdtp=mn will open the Salesforce page without the sidebar and menu-tabs.
 
Does anyone know where I can find other options? Perhaps opening with a sidebar and no tabs, or tabs with no sidebar etc?
I could not find any answers on Salesforce help forums