• DrawloopSupport
  • NEWBIE
  • 103 Points
  • Member since 2008

  • Chatter
    Feed
  • 3
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 26
    Questions
  • 108
    Replies

Salesforce,

Is there more detailed documentation for using Apex Callouts in the Flow Designer? The information included here:

http://www.salesforce.com/us/developer/docs/firefly/salesforce_flow_designer.pdf

is really not sufficient.

 

Thank you.

Does anyone know if it is possible using Apex to create or update a custom setting value specifically for a user Id or profile Id? The Salesforce documentation does not touch this functionality, so I don't know if it is even supported.

 

Thanks!

Let's say you have a Visualforce tab called Sample_Tab that references some Visualforce page. How would one construct a URLFOR function for this tab? I have tried at least the following:

 

 

{!URLFOR(Sample_Tab)}
{!URLFOR($Action.Tab.Sample_Tab)}
{!URLFOR($Action.Sample_Tab)}
{!URLFOR($Tab.Sample_Tab)}
{!URLFOR($Component.Sample_Tab)}

 

Thanks!

 

I have two pages that both use:

 

<apex:pageBlockSection columns="1">
	<apex:repeat value="{!vals}" var="v">
		<apex:pageBlockSectionItem >

They both reference the same standardcontroller and extension. The main difference between the pages is that one is for an existing record and the other is for creating a new record. One page displays the fields normally (like the standard Salesforce edit pages) and the other page does not. Inspecting the page that is not properly formatted, it appears that the labelCol td is not present and both the label and field are being put in the dataCol td. Does anyone know what would cause this? I have simplified both pages down to the bare minimum and am still getting the same results.

 

 

Thanks!

Let's say we have a button pointing to this URL:

 

 

https://www.sample.com?customSetting={!$Setup.Namespace__Info__c.Namespace__Field__c}&customField={!Namespace__CustObj__c.Namespace__CustField__c}

 

 

where Namespace__Info__c refers to a Custom Setting, Namespace__Field__c is a field on that Custom Setting, Namespace__CustObj__c is a custom object, and Namespace__CustField__c is a field on that custom object. This is all within a managed package.

 

When this button is rolled out in a managed package version, the Namespace__ is removed from all of the fields and this button no longer works in an org with this version installed. If the Custom Setting field is removed, the Namespace__ remains intact for the custom object and field.

 

I think this is a Salesforce bug, but I wanted to bring it up here before opening a ticket to see if anyone has seen or dealt with this issue. Thanks in advance!

We are receiving this error only in client orgs that have been upgraded to Winter '11:

 

No such column '[FIELD - we have seen CurrencyIsoCode and RecordTypeId]' on entity '[OBJECT - we have seen Contact, User, and Opportunity]'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

We are unable to replicate this in our developer org and the debug logs from the client orgs are not helpful. None of our Apex code queries or references currency fields let alone CurrencyIsoCode and do not query for RecordTypeId on Contact, Opportunity, or User. The client orgs do not have multiple currencies enabled.

 

 

This could potentially be a serious issue when the rest of the Salesforce instances are upgraded to Winter '11 this coming weekend.

 

We have additionally logged a case with Salesforce. Any thoughts are greatly appreciated.

Does anyone know if it is possible to create a quote PDF on-the-fly via the Salesforce Web Services API?

 

Thanks!

Has anyone else tried to disable a rich text area using the apex:inputTextArea tag?

 

 

<apex:inputTextarea richText="true" disabled="true" />

Thanks!

 

Does anyone know why an email alert triggered from a workflow would not be creating the associated activity history? Emails sent through the interface, through Apex, and through the API are all logged in activity history (when the appropriate information is set). The email alert is set to be sent to the Contact Email (standard) field.

Thanks!

Setup:

Visualforce page with Opportunity as standard controller

Detail Page Button on Opportunity using Visualforce page

List Button on Opportunity related list to grab specific records of children of opportunity

Question:

Is there any way to use some form of recordSetVar or getRecordIds to get record Ids of an object that is not the object specified in the standard controller? It would be far simpler to do this instead of creating two nearly identical visualforce pages.

Thanks!

User Experience: Navigate to tab (e.g. Opportunities), select a list view, select a few records, click a list button, and be redirected to a Visualforce page.

 

Back end problem: The Apex controller for the Visualforce page needs access to the record ids that the user chose on the list view. In s-controls and Visualforce pages, one could use GETRECORDIDS($ObjectType.Opportunity) to get all of the opportunity ids if the user came from an opportunity list view. I would like to be able to support any object, including custom objects, so this route will not work unless there is a generic getRecordIds function. In Apex, one could specify a StandardSetController, but again, the object type needs to be predefined in the Visualforce page as the apex page's standardController.

 

Does anyone have any ideas about how to accomplish this without having to pass all of the record ids on the querystring for the Visualforce page?

 

Thanks!

Can anyone think of a reason an execute javascript button would cause this error while the same query in the Salesforce Explorer does not? The object is deployed. The API name of the object is typed correctly. The user's profile has access to the object. The user logged in to the explorer is the same user logged into the browser in Salesforce.

 

Any ideas would be terrific.

 

Thanks!

Visualforce for first image:

 

<apex:commandLink value="Edit" />&nbsp;|&nbsp;<apex:commandLink value="Del" />

 correct action

 

Visualforce for second image:

 

<apex:outputLink>Edit</apex:outputLink>&nbsp;|&nbsp;<apex:commandLink value="Del" />

 

 

Does anyone have an idea as to why the extra space after the pipe comes in on the first row if I use an outputLink instead of a commandLink? The extra space is present whether or not I use a space or nbsp notation. The links are contained in a pageBlockTable column.

 

Thanks.

 

 

Let's say you are on the detail view of an Account. This view has a related list for the Contacts under that account. This related list has a "New" button. When you click this button, the new contact form is automatically associated with the account you came from.

 

Now let's assume the same situation with custom objects but the "New" form is being overridden with a Visualforce page that uses inputFields. The child object has record types. I can already get the URL for the regular new action:

 

 

<apex:commandButton value="New" id="newBtn" action="{!URLFOR($Action.Custom_Child__c.New)}" />

 

How can I get the URL for the new action with the parent lookup inputField defaulted?

 

Thanks!

Let's say I have the following visualforce markup:

 

<ol type="1" style="list-style-type: decimal;"> <apex:actionRegion immediate="true"> <apex:outputPanel rendered="{!showLi}" id="liContainer"> <li style="list-style-type: decimal;"> html here </li> </apex:outputPanel> <li> more html </li> </apex:actionRegion> </ol>

 

Now let's say I add in some apex that simply returns a null page reference when clicking a button. The page is rerendered but includes an additional tag like so:

 

<ol type="1" style="list-style-type: decimal;"> <apex:actionRegion immediate="true"> <li style="list-style-position: outside; list-style-image: none; list-style-type: none;"> <apex:outputPanel rendered="{!showLi}" id="liContainer"> <li style="list-style-type: decimal;"> html here </li> </apex:outputPanel> </li> <li> more html </li> </apex:actionRegion> </ol>

 

As one might suspect, this is a problem because it changes the numbering of the list items and indentation. Does anyone have any idea why Visualforce would (intentionally or unintentionally) insert seemingly random html elements?


Thanks!

 

 

Using outputPanel, actionRegion, and actionSupport as shown below, I cannot get the outputPanel to be rendered="true" when it should be. Using System.debug, my code is working accurately.

 

 

<apex:actionRegion immediate="true"> <apex:selectRadio value="{!selectedOption}" id="opt" layout="pageDirection"> <apex:selectOptions value="{!options}" /> <apex:actionSupport event="onchange" rerender="li" /> </apex:selectRadio> <apex:outputPanel rendered="{!showOption1}" id="li"> <!-- HTML and apex elements here --> </apex:outputPanel> </apex:actionRegion> public boolean showOption1 { get; set; } public custom_object__c getObj() { // *** logic to change boolean showOption1 *** return object; }

 

 Does anyone have any ideas as to what I may be doing wrong?

 

Thanks!

 

I need to create a trigger that is kicked off when a custom object is cloned. Now I can do this via a before insert trigger on the object, but how would I know that the object is being clone vs a brand new record insertion?

 

It doesn't look like there is a "iscloned" method on triggers or sobjects. Does anyone have any ideas?

 

Thanks!

Suppose I have a select list as shown in this visualforce code:

 

<apex:selectList id="type" size="1" value="{!type}" onchange="{!test}"> <apex:selectOption itemLabel="Type1" itemValue="Type1" /> <apex:selectOption itemLabel="Type2" itemValue="Type2" /> <apex:selectOption itemLabel="Type3" itemValue="Type3" /> </apex:selectList>

 

 and I want to alert the value of the selected selectOption from the selectList as shown in this apex code:

 

public string selectedType; public string getType() { return selectedType; } public void setType(string value) { selectedType = value; } public string getTest() { return 'alert("'+selectedType+'");'; }

 

 Now, I'm guessing the default getter and setter of the type value of the selectList does not work as I thought it would since this apex code simply alerts "null".

Does anyone know how to make this work or how to get the value of the selected selectOption within the selectList?

 

 

Using the following visualforce markup, the second select option, which should not be displayed, is shown.

 

<apex:page> <apex:form> <apex:selectList size="1"> <apex:selectOption itemLabel="test" itemValue="test" /> <apex:selectOption itemLabel="don't show" itemValue="bad" rendered="false" /> </apex:selectList> </apex:form> </apex:page>

 

 Any ideas?

 

How would one go about looping through all of the matches in a Matcher object? Most of the apex documentation says things like "from the previous match" but I can't even tell how to move between the matches (like previous and next match). Can anyone point me in the right direction, or better yet, post a sample?

 

Thanks!

Does anyone know why an email alert triggered from a workflow would not be creating the associated activity history? Emails sent through the interface, through Apex, and through the API are all logged in activity history (when the appropriate information is set). The email alert is set to be sent to the Contact Email (standard) field.

Thanks!

Does anyone know if it is possible using Apex to create or update a custom setting value specifically for a user Id or profile Id? The Salesforce documentation does not touch this functionality, so I don't know if it is even supported.

 

Thanks!

Let's say you have a Visualforce tab called Sample_Tab that references some Visualforce page. How would one construct a URLFOR function for this tab? I have tried at least the following:

 

 

{!URLFOR(Sample_Tab)}
{!URLFOR($Action.Tab.Sample_Tab)}
{!URLFOR($Action.Sample_Tab)}
{!URLFOR($Tab.Sample_Tab)}
{!URLFOR($Component.Sample_Tab)}

 

Thanks!

 

I have two pages that both use:

 

<apex:pageBlockSection columns="1">
	<apex:repeat value="{!vals}" var="v">
		<apex:pageBlockSectionItem >

They both reference the same standardcontroller and extension. The main difference between the pages is that one is for an existing record and the other is for creating a new record. One page displays the fields normally (like the standard Salesforce edit pages) and the other page does not. Inspecting the page that is not properly formatted, it appears that the labelCol td is not present and both the label and field are being put in the dataCol td. Does anyone know what would cause this? I have simplified both pages down to the bare minimum and am still getting the same results.

 

 

Thanks!

I have an ok understanding of apex and I am new to VPM (Flow Designer).

 

I am trying to get "Apex Callout" to work with a class i have but am not getting anywhere. After opening the flow designer pdf i came across the following statement:

 

"The visual Apex callout element allows you to call an Apex class with the Process.Plugin interface"

What is the process.plugin interface? because i am getting the following error when uploading the flow into Salesforce

"ErrorWe had trouble uploading the flow. Apex class does not exist or is not a plugin class: FlowDesignerISA.GetISAamount"

Can anyone help?
Thanks in-advance.

  • March 08, 2011
  • Like
  • 0

My code runs fine in visualforce but when I publish to site it gives me an error indicating that the api is disabled for a particular user.

 

Coincidentally, there isn't any custom code here - it's taken directly from the example in the ajax toolkit developer's guide:

 

 

<apex:page >
    <script type="text/javascript">
    var __sfdcSessionId = '{!GETSESSIONID()}';
    </script>
    <script src="../../soap/ajax/21.0/connection.js"
          type="text/javascript"></script>
    <script type="text/javascript">     window.onload = setupPage;
    function setupPage() {
      //function contains all code to execute after page is rendered  
    

      var state = { //state that you need when the callback is called  
    
          output : document.getElementById("output"),
          startTime : new Date().getTime()};

      var callback = {
          //call layoutResult if the request is successful  
    
          onSuccess: layoutResults,

          //call queryFailed if the api request fails  
    
          onFailure: queryFailed,
          source: state};

      sforce.connection.query(
          "Select Id, Name, Industry From Account order by Industry",
           callback);
  }

  function queryFailed(error, source) {
    source.output.innerHTML = "An error has occurred: " + error;
  }

  /**
  * This method will be called when the toolkit receives a successful
  * response from the server.
  * @queryResult - result that server returned
  * @source - state passed into the query method call.
  */  
    
  function layoutResults(queryResult, source) {
    if (queryResult.size > 0) {
      var output = "";

      //get the records array  
    
      var records = queryResult.getArray('records');

      //loop through the records and construct html string  
    
      for (var i = 0; i < records.length; i++) {
        var account = records[i];

        output += account.Id + " " + account.Name +
            " [Industry - " + account.Industry + "]<br>";
      }

    //render the generated html string  
    
    source.output.innerHTML = output;
    }
  }
  </script>

    <div id="output"> </div>
   
</apex:page>

 

So my questions are:

can the ajax toolkit be enabled on force.com sites for an anonymous, read only user?

if so, how? 

if not, is there a workaround?

 

 

 

Hi,

I would like to ask if any expert know how to develop the Lookup button in the Visualforce Page. Thanks!

Best regards

 

  • February 26, 2009
  • Like
  • 0

Is it possible to either run a report or retrieve a report meta data through the API? If so where would the definition of the reports syntax be defined?

 

I would like to drive code based on how my users have set filter criteria on certain reports.

We recently ran into a problem when we create a document via the api when the document name is the same. The error we are getting is

"Create Failed: DUPLICATE_DEVELOPER_NAME: This Document Unique Name already exists.  Please choose a unique name. -- DeveloperName"

I thought that specifying the DeveloperName on the document object would be enough, but when I try that, the error I get is

"Create Failed: INVALID_FIELD_FOR_INSERT_UPDATE: Document: bad field names on insert/update call: DeveloperName -- DeveloperName"

This seems a bit contradictory. Any help would be greatly appreciated. Thanks!
Hi,
 
I want to create a lookup field as below using Visualforce. How can i acheive this?

 
Any help on this will be appreciated.
 
Thanks,
OnDemand
Hi guys,

I'm experiencing some unexpected behavior when trying to use the apex:repeat function to render tabs....

Basically it seems that tabs cannot be created on demand?  My controller is definitely returning data... as the second page block in my sample will show... repeat works - just the tabs are not rendered..

I'm sure any of you guys can see where I was going with this - and I guess I can achieve a similar result by dropping down to boring old html - just trying to use the standard components (as per best practice)

Any assistance greatly appreciated - as the purist coder me is seriously disturbed at the moment...

here is my 'simplified' and easily testable page & controller

Code: VF PAGE
<apex:page controller="clsRecordType">
    <apex:pageBlock >
        <apex:tabPanel id="theTabPanel">
            <apex:tab label="Account Types"/>
            <apex:repeat value="{!RecordTypes}" var="types">
                <apex:tab label="{!types.Name}"/>     
            </apex:repeat>
        </apex:tabPanel>
    </apex:pageBlock>

    <apex:pageBlock >
        <apex:repeat value="{!RecordTypes}" var="types">
            {!types.Name}<br/>       
        </apex:repeat>
    </apex:pageBlock>
</apex:page>

and the controller

Code:
public class clsRecordType {

    list<RecordType> lrecordtypes;

    public list<RecordType> getRecordTypes() {
        if(lrecordtypes==null) lrecordtypes = [Select Name, Id, Description From RecordType  where SobjectType = 'Account' and IsActive=True];
        return lrecordtypes;
        }
   }

 
 

Here is part of the subroutine:

        my $self       = shift;
        my $changelist = shift;
        my $sObject_type = 'ADM_Work__c';

        if( $self->{_p4status} eq $GUS::OPEN_ONCE ) {

            print "\n\n ----------------------------------------------------------------------\n";
            print "$sObject_type, id => " . $self->{_id} . ", Perforce_Status__c => $GUS::NONE)";
            print "\n\n ----------------------------------------------------------------------\n";

            my $result = $self->{_sfdc}->update(type => $sObject_type, id => $self->{_id}, Perforce_Status__c => $GUS::NONE);
           
            if ($result->valueof("//updateResponse/result/success") ne 'true') {
                # log problem here
                print "unable to update p4 status";
            } else {
                $self->{_p4status} = $GUS::NONE;
            }
       
Here is the output:
 ----------------------------------------------------------------------
ADM_Work__c, id => a0HT0000000KIZbMAO, Perforce_Status__c => --None--)

 ----------------------------------------------------------------------

Type looks to be getting set from the print statement output??
Hi,
 
Yesterday I had deployed aan apex trigger from sandbox to production env. The trigger is an "before insert, before update" to check for duplicate account names. The trigger works fine in prodiuction for preventing duplicate Account names.
 
But today when I tried to mass update Accounts for some other field using Apex Data Loader, I get the following error:
 

Apex script unhandled trigger exception by user/organization: 00530000000nHi3/00D300000006QZD

Trg_Account_Name_Dedup: execution of BeforeUpdate

caused by: System.Exception: Too many SOQL queries: 21

Trigger.Trg_Account_Name_Dedup: line 1, column 143

Can anyone please advise on how to disable triggers in production env so that I can carry out other mass updates in Account using Apex Data loader tool.

Thanks and regards,
Ambili

  • February 12, 2008
  • Like
  • 0