• Opster
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 26
    Questions
  • 29
    Replies

I am trying to use a TabPanel within a custom Visualforce page with a custom controller.

 

The Tabs are rendering in the page, but they are not clickable and when I set the default selected tab to something other than the "tab1" it never renders with that tab selected.   Only "tab1" renders as selected even if selectedTab="tab2".

 

Do "apex:tabPanel"'s only work on Visualforce pages with Standard Controllers?  Or is there something I need to implement in my controller to enable things?

 

I am using some basic example code like below:

 

<style>

      .activeTab {background-color: #236FBD; color:white

         background-image:none}

      .inactiveTab { background-color: lightgrey; color:black

         background-image:none}

   </style>

   <apex:tabPanel switchType="client" selectedTab="tab1" 

                  id="MyTabPanel"tabClass="activeTab" 

                  inactiveTabClass="inactiveTab">   

      <apex:tab label="Some Tab" name="Some Tab" id="tab1">

         Some Content Tab1

      </apex:tab>

      <apex:tab label="Some Other Tab" name="Some Other Tab" id="tab2">

         Some Content Tab2

      </apex:tab>

   </apex:tabPanel>

 

 

 

 

thanks in advance!

  • January 29, 2013
  • Like
  • 0

I am using an <apex:detail... > tag to display a Lead within my custom VisualForce page.   When the page loads it uses the Lead Page Layout assigned to the running user profile.

 

Is there a way for me to override the page layout that is loaded so i can display a different page layout without needing to change the page layout assigned to the profile?

 

thanks in advance!

  • January 07, 2013
  • Like
  • 0

I am able to get the SessionID without issue, but I also need the {!$Api.Partner_Server_URL_220} for example.  This merge field works great in VisualForce Pages but does not work in the Custom Homepage Component.  Any ideas how I can get this URL?

  • August 15, 2012
  • Like
  • 0

I have a very simple query that I have used in a test class to test a trigger.  This same code works in many other orgs, but for some reason returns zero results in one sandbox I am working in.

 

t.WhoId = [SELECT id FROM Contact LIMIT 1].id;

 

I see thousands of Contacts in the Sandbox and have tried even creating a new one.

 

Does anyone know why the code would return zero results and what I should do to fix it?

  • April 10, 2012
  • Like
  • 0

I am creating an iOS app and was wondering if there is an easy way to display a Dashboard that already exists in Salesforce.   I am using the iOS Toolkit to login to my Salesforce.com Org and I know the name of the dashboard I want to display.  But my app will be used along with a package my clients will have installed which contains the dashboard.

 

Do I need to package in a mobile dashboard?  And how would I pull the dashboard from the org since I don't think it has the same URL across all orgs with the package installed?

 

Any insight would be helpful.  Thanks

  • August 22, 2011
  • Like
  • 0

I have a Scheduled Apex Class that runs nightly.  It loops through a bunch of data and creates a Task for some users.   I would like these tasks to be CreatedBy the Owner of the Objects I am looping through.   I was going to use System.runas() but since I do a batch insert I am not sure this will work.  They would all end up being Created By the one user I am impersonating. 

 

I could group the tasks and use System.runas() for each group of tasks who the Created By field should be set to, but I was wondering if there is a better way.

 

So how can I insert a bunch of tasks Created By different users and not the user the Apex Class is running as?

  • April 05, 2011
  • Like
  • 0

Does anyone know how I can check in APEX IF Chatter is enabled for the current Org?

 

I need to check either in a Visualforce page or in an Apex Class and display chatter if it is, and not display it if it is not enabled.

 

thanks

  • March 10, 2011
  • Like
  • 0

I have an Apex Class that is Schedulable.  What is the proper way to package this class so that when a user installs it into their org it automatically schedules the class to run?

  • March 02, 2011
  • Like
  • 0

I am trying to do the following and getting an error: "Unexpected Token"

 

List<

What is the correct way to select tasks where the Creator != Owner?

thanks

Task> ltsk = [SELECT id, subject, CreatedById, OwnerId FROM Task WHERE OwnerId != CreatedById];

  • February 28, 2011
  • Like
  • 0

Does anyone know a way to determine the default status picklist value for marking a Task as 'Completed' IsClosed=true?

 

I am asking because I need a way to find what to close a task to if the org has been customized and the picklist values have been changed, i.e. 'Completed' is no longer one of the options.  So I do not want to hard code my trigger to use a value that may not be in use.

 

thanks

  • February 22, 2011
  • Like
  • 0

I am creating an AppExchange app which requires the user to follow a lengthy installation guide, adding new fields to page layouts, buttons, and setting up some security settings.   I am looking to automate these steps to make the installation as quick and painless as possible.

 

Is this something that can be accomplished via the API?  Can I add fields and buttons to page layouts via the API?  Or does anyone have a better idea of how to accomplish this?

 

thanks.

  • November 03, 2010
  • Like
  • 0

I am creating an AppExchange app which requires the user to follow a lengthy installation guide, adding new fields to page layouts, buttons, and setting up some security settings.   I am looking to automate these steps to make the installation as quick and painless as possible.

 

Is this something that can be accomplished via the API?  Can I add fields and buttons to page layouts via the API?  Or does anyone have a better idea of how to accomplish this?

 

thanks.

  • November 03, 2010
  • Like
  • 0

I am trying to use the following code to make a map of sObject Type Names and Object Prefixes:

 

Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();

 

I am a little unsure of what comes back from the GlobalDescribe or if im setting up my map correctly.  I will need to do a get() using an object id prefix and want to get back the object type name.  Can anyone assist me in accomplishing this?

 

thanks in advance

I want to be able to detect which version of my App is running on any given instance of a salesforce org, to allow me to toggle visual elements that are applicable only to certain versions.  For example if my app version is v1.1 I want to display x, but if it is v1.2 I want to display x and y. 

 

How can I query for the installed package version?

 

Thanks in advance.

If my apex controller uses With Sharing, how does that effect the queries?  Specifically, if the current user does not have permission to view a certain record X, what will be returned by the soql query if I do a Select X?

 

 

How can I check if a user can access a particular object?

 

I see this code snippet

 

<apex:pageBlock rendered="{!$ObjectType.Lead.accessible}">

 

But how can I check for a specific sObject myObject?   I want to display an error message if the user does not have access to view the object in myObject.

 

 

 

I am pulling in a lot of object ID's from a report and need an easy way to determine what the Object Type is based on the Object ID.  Does anyone know the best way to accomplish this?

  • April 06, 2010
  • Like
  • 0

I have created a custom setting from which I am able to restrict access to editing a text box on certain Visual Force pagesThis works greatHowever I am running into an issue when I want to query against the custom setting to find out the user's permissions via the API


From my APEX code I am able to do the following to get the Instance value of the custom setting based on the current user's PID

 

SomeCustomSetting__c.getInstance(pid);

 

How can I accomplish the same thing using a SOQL query?

  • February 08, 2010
  • Like
  • 0

I know how to write a trigger for Lead Conversion, but what about a trigger to change the lead owner to the current user when Lead Status field is altered to a specific value?

 

The basic goal here is I have a workflow that creates tasks for the Lead Owner when the status of a lead is altered to "qualified".  However, the Lead Owner is not always the Current User who performed the status change.  So I need to alter the Lead Owner to the Current User prior to the status change so that the task is created for the Current User/New Lead Owner.  

 

Any guidance would be greatly appreciated, and thank you in advance.

  • January 27, 2010
  • Like
  • 0

I have an application packaged that uses several custom VisualForce pages.  On one of these pages I have a text field that I want to allow certain users to be able to edit, while others are not allowed to edit it.   What is the best way to setup something like this?   I was thinking of using profiles, but how does this work with a packaged app installed on someone elses Org?

 

thanks

  • January 15, 2010
  • Like
  • 0

I am trying to load a custom VF Page in salesforce Service Console.

When I am pasting the following URL in browser and pressing Enter the page loads properly.

URL - '/ui/support/servicedesk/ServiceDeskPage#/apex/Pagename'

But when I am passing the same URL to browser from CTI Adapter then the page is not loading even if the URL in the browser shows the correct URL.

 

Thanks,

Vaibhav Khanna

 

I have a very simple query that I have used in a test class to test a trigger.  This same code works in many other orgs, but for some reason returns zero results in one sandbox I am working in.

 

t.WhoId = [SELECT id FROM Contact LIMIT 1].id;

 

I see thousands of Contacts in the Sandbox and have tried even creating a new one.

 

Does anyone know why the code would return zero results and what I should do to fix it?

  • April 10, 2012
  • Like
  • 0

Hello,

 

I have found some documentation on developing for the Service Cloud console, but this does not seem to be the same as the Console.

 

For example, we have a Console layout for Standard Case, which has the List Views:

 

Case

Account

Contact

 

 

If the standard Case View is used, when a Case is loaded thorugh the console, the related Contact and Account are showin the right pane.

 

If I override with a Visualforce page, the Case appears fine, but the right pane is blank.


Any thoughts?

 

Does anyone know how I can check in APEX IF Chatter is enabled for the current Org?

 

I need to check either in a Visualforce page or in an Apex Class and display chatter if it is, and not display it if it is not enabled.

 

thanks

  • March 10, 2011
  • Like
  • 0

I have an Apex Class that is Schedulable.  What is the proper way to package this class so that when a user installs it into their org it automatically schedules the class to run?

  • March 02, 2011
  • Like
  • 0

I have created a custom setting from which I am able to restrict access to editing a text box on certain Visual Force pagesThis works greatHowever I am running into an issue when I want to query against the custom setting to find out the user's permissions via the API


From my APEX code I am able to do the following to get the Instance value of the custom setting based on the current user's PID

 

SomeCustomSetting__c.getInstance(pid);

 

How can I accomplish the same thing using a SOQL query?

  • February 08, 2010
  • Like
  • 0

I know how to write a trigger for Lead Conversion, but what about a trigger to change the lead owner to the current user when Lead Status field is altered to a specific value?

 

The basic goal here is I have a workflow that creates tasks for the Lead Owner when the status of a lead is altered to "qualified".  However, the Lead Owner is not always the Current User who performed the status change.  So I need to alter the Lead Owner to the Current User prior to the status change so that the task is created for the Current User/New Lead Owner.  

 

Any guidance would be greatly appreciated, and thank you in advance.

  • January 27, 2010
  • Like
  • 0

I have a VisualForce page with many different rendering options based on different vars being set.  One of the pages (if step=2) will display a Lead object.  But on that page if the user clicks any of the buttons, the Return URL is set to the generic name of the VisualForce page.  Is there any easy way to override the Return URL for all buttons on the page?  I've seen examples where you can override a single button's retURL but I'm looking for a more global option.

Ok, something is going on and I have no idea what.

 

I have this code to collect URL and session ID:

 

<apex:inputHidden id="hidServerUrl" value="{!apiServerUrl}" /> <apex:inputHidden id="hidSessionId" value="{!apiSessionId}" /> <script> document.getElementById('{!$Component.hidServerUrl}').value = '{!$Api.Enterprise_Server_URL_160}'; document.getElementById('{!$Component.hidSessionId}').value = '{!$Api.Session_ID}'; </script>

 

Then in extension code I generate external URL:

 

public ApexPages.PageReference createDocument() { insert newDoc; ApexPages.PageReference forkUrl = new ApexPages.PageReference('https://my.server.somewhere/Fork.aspx'); forkUrl.getParameters().put('did', newDoc.id); forkUrl.getParameters().put('api', apiServerUrl); forkUrl.getParameters().put('session', apiSessionId); return forkUrl; }

 

and this generates a proper URL:

 

https://my.server.somewhere/Fork.aspx?did=a0X70000000GIvl&api=https%3A%2F%2Fc.na5.visual.force.com%2Fservices%2FSoap%2Fc%2F16.0%2F00D700000008lOu&session=00D700000008lOu%21AQoAQMRwIIDxH3WUdRafQ06pLQFSrfNHfMS7ON53nte0XUfnJ4apPmNphgETMlsMgOh7lQX.kbhvyVd5qdxbbrE9z6sFqy.I

However when I hook up to session using this c# code:

 

using (SforceService api = new SforceService { Url = ApiUrl, SessionHeaderValue = new SessionHeader { sessionId = SfSession } }) { QueryResult qr = api.query(..... }

 

I get the invalid session ID on query:

 

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session

 

 

Now, here's a twist, if I launch the same page from a salesforce URL button (this button is not in apex, its a regular salesforce button defined on the custom object screen) defined as:

 

https://my.server.somewhere/Fork.aspx?did={!DMSDocument__c.Id}&api={!$Api.Enterprise_Server_URL_160}&session={!$Api.Session_ID}

 

 

 

I get this URL which works (it hooks up to session and the query works):

https://my.server.somewhere/Fork.aspx?did=a0X70000000GJ0M&api=https%3A%2F%2Fna5.salesforce.com%2Fservices%2FSoap%2Fc%2F16.0%2F00D700000008lOu&session=00D700000008lOu%21AQoAQMRwIIDxH3WUdRafQ06pLQFSrfNHfMS7ON53nte0XUfnJ4apPmNphgETMlsMgOh7lQX.kbhvyVd5qdxbbrE9z6sFqy.I

 

 

The api server name now does not have c. in the dns name (na5... instead of c.na5...) and session ID looks slightly different. HOwever the c# code works so the problem is not in my external code.

 

So, what is going on? Is Apex/VF broken and emits invalid ajax URL's and session ID's with {!$Api.xxx}? How do I resolve this as I must launch the URL from apex code (its a finale of a series of operations in a wizard)

 

 

Message Edited by mmix on 09-17-2009 10:57 AM
  • September 17, 2009
  • Like
  • 0
I have created a VF page that I do not want to see all the SFDC menus and tabs on.  All I want to see is the HTML I have entered within my Apex Page Blocks, nothing else.   How can I do this?
  • August 25, 2009
  • Like
  • 0

I am trying to grab an email address from the parent window when my Custom Button is clicked on a Lead Detail page.  But it seems like I am doing something wrong in my JavaScript to get at the parent window's HTML (Lead Detail page).   Does anyone know the correct syntax to get the HTML of the Lead Detail page when my JavaScript is invoked?

 

Here is my code snippet:

 

 var obj = parent.document.getElementsByTagName('td');

 Alert(obj.innerHTML);

 

Whatever I am getting back issnt the HTML of the Lead Detail page.   And I have tried different combinations of window.parent, parent.window etc etc with no luck.

 

thanks in advance. 

  • August 04, 2009
  • Like
  • 0

I am wondering if and how I can run some custom javascript across all my salesforce pages?   I tried adding my javascript to a Custom Component on the home bar, but when I try and save the component it deletes all my javascript out.  

 

I dont't want to add the javascript to each object with a layout.   I simply want this javascript to be executed onload of every page across my org.

 

Any help is greatly appreciated, and thank you in advance.

 

  • August 03, 2009
  • Like
  • 0

Hi All,

 

I would like to be able to call the SF Metadata API from Apex code in my custom app.

 

I went to Setup/App Setup/Develop/API and clicked on 'Download Metadata WSDL' and saved it to my hard drive.

 

Then I went to Setup/App Setup/Develop/ApexClasses and clicked on the 'Generate from WSDL' button. For Step 1, I navigate to the Metadata WSDL that I just saved and click 'Parse WSDL.' This takes me to the Step 2 screen where I then click on the 'Generate Apex code' button.

 

This takes me to the Step 3 screen which shows this error:

 

<error>

Apex generation failed.

Error message:
Error: Class name 'Metadata' already in use. Please edit WSDL to remove repeated names

 

</error>

 

Does this error mean that what I am attempting to do is not allowed? If it is allowed, how do I get around this error.

 

Any help would be appreciated.

 

Thanks,

Andrew