• TC Developer
  • NEWBIE
  • 25 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 10
    Replies
Hi everyone,

I've created a VF page with calls a flow and a controller I created to pull a variable from the flow and use it in the finishLocation.

The thing is that now I tried to map this VF page overriding a custom object's "New" button, and realized that to do so, I needed to add the standardController to that object so I can see it when trying to change my button. Then I changed the controller to extension and added the following to my class:
public MyflowController(ApexPages.StandardController stdController) {}

The thing is that after this change, when I click the finish button, instead of landing in the URL of the Record Type (variable from the flow), the flow restarts in a loop.

Is there anything that I should change in the class? or the VF page?
I don't know what I should put between the curly brackets, so I left it empty. I wonder if that is the issue. I'm not actually "getting" anything from My_Tickets__c object.

This is the VF page:
<apex:page standardController="My_Ticket__c" extensions="MyflowController" TabStyle="My_Ticket__c">
   <br/>
   <flow:interview name="My_Tickets" interview="{!Myflow}" finishLocation="{!LinkID}" />
 </apex:page>

And the extension:
public class MyflowController {
 public MyflowController(ApexPages.StandardController stdController) {}
   public Flow.Interview.My_Tickets Myflow {get; set;}
   public String fullURL {get; set;}
   private String Instance = null;
   private void GetURL() {
      Instance = GetInstance(Instance);
      fullURL = 'https://' + Instance + '.salesforce.com/a1G/e?retURL=%2Fa1G%2Fo&RecordType=' + RTid() + '&ent=02I400000013Z1q';
      }
   public PageReference getLinkID() {
      GetURL();
      PageReference p = new PageReference (fullURL);
      p.setRedirect(true);
      return p;
      }
   public String RTid() {
      if (Myflow==null) return '';
      else return Myflow.varRecordType;
      }
   public String GetInstance(String Instance) {
      if (Instance == null) {
          List<String> parts = System.URL.getSalesforceBaseUrl().getHost().replace('-api','').split('\\.');
          if (parts.size() == 3) Instance = parts[0];
          else if (parts.size() == 5) Instance = parts[1];
          else Instance = null;
          } 
          return Instance;
       }
   }

Thanks for your help!

Ana
I am getting the following error and I am at a loss on what is wrong. Can anyone please help? The line of code with the error is underlined below.

11:00:01.063 (63040986)|USER_DEBUG|[23]|DEBUG|---------------------------------rows 3
11:00:01.063 (63047571)|SYSTEM_METHOD_EXIT|[23]|System.debug(ANY)
11:00:01.063 (63058551)|SYSTEM_METHOD_ENTRY|[26]|LIST<User>.iterator()
11:00:01.063 (63228660)|SYSTEM_METHOD_EXIT|[26]|LIST<User>.iterator()
11:00:01.063 (63259893)|SYSTEM_METHOD_ENTRY|[26]|system.ListIterator.hasNext()
11:00:01.063 (63295436)|SYSTEM_METHOD_EXIT|[26]|system.ListIterator.hasNext()
11:00:01.063 (63545352)|FATAL_ERROR|System.StringException: Invalid id:

List<String> userAcctNames = new List <String>();
       
        // Get all users modified in the last 3 days  
        User[] upusers = [Select ID, Department, Account_Name__c, contact_created__c,
                    LastModifiedDate From User Where LastModifiedDate >= :ckdt ];

        system.debug('---------------------------------rows ' + upusers.size());
       
       
        for (User theuser : upusers) {
             
            // Collect the IDs                                                                                 
            if (theuser.id != '') {
                userids.add(theuser.id);
                userAcctNames.add(theuser.Account_Name__c);
                system.debug('--------------------------------added ' + theuser.id + theuser.account_name__c);            
            }  //End if for collection of ids
         }  // end for loop
I have created Detailed abutton and placed on the Task Record. The button should function like when we click the button a New opportunity page will opened and carry the data from Task to the Opportunity and need to display on Opportunity fields.  Below javascript created. But  it giving error like that    'Task.WhoId' is not exist like that. Please anyone correct bthis.




{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}

    var OpportunityCreate= new sforce.SObject("Opportunity");

OpportunityCreate.Contact_Name__c = '{!Task.WhoId}';


    var result = sforce.connection.create([OpportunityToCreate]);

    if (result[0].success == 'true')
    
   var newURL = '/' + result[0].id + '/e';
   window.top.location = newURL;
}
  • June 26, 2014
  • Like
  • 1
I wanted to reach out and see if the following two projects we'd like help with are feasible and if so, what it might cost us.

First-we would love a custom clone button that clones the existing record along with the related records on the record's related list. The record is basically kind of a middle child in the hierarchy-it has a parent but it also has child records associated with it. When we clone it, we'd like to clone the record and its child records. 

Second-we'd love to automate some record creation based on when a new Contact record is created. What records would be created would be dependent on contact record type. Whenever we have certain contacts created, we will always need certain child records. Right now I am manually creating them (they're just basic records that house other related child records like "Medical Information" which has related lists for Medications, Appointments, etc.), but I'd like to not have to remember to do this for every new contact created. 

I am happy to give more detail about what we're specifically looking for, but wanted to first throw this out there and see if anyone was interested in helping out. We are a non-profit agency so our budget is small. We may not be able to make it work financially but wanted to see what it may cost. We do not have a developer on staff-I have learned a lot and am pretty handy with Salesforce but don't know Apex, etc. So you'd be working with someone who has strong administrative knowledge, just no coding experience.

Thanks,

Blair
Hi everyone,

I've created a VF page with calls a flow and a controller I created to pull a variable from the flow and use it in the finishLocation.

The thing is that now I tried to map this VF page overriding a custom object's "New" button, and realized that to do so, I needed to add the standardController to that object so I can see it when trying to change my button. Then I changed the controller to extension and added the following to my class:
public MyflowController(ApexPages.StandardController stdController) {}

The thing is that after this change, when I click the finish button, instead of landing in the URL of the Record Type (variable from the flow), the flow restarts in a loop.

Is there anything that I should change in the class? or the VF page?
I don't know what I should put between the curly brackets, so I left it empty. I wonder if that is the issue. I'm not actually "getting" anything from My_Tickets__c object.

This is the VF page:
<apex:page standardController="My_Ticket__c" extensions="MyflowController" TabStyle="My_Ticket__c">
   <br/>
   <flow:interview name="My_Tickets" interview="{!Myflow}" finishLocation="{!LinkID}" />
 </apex:page>

And the extension:
public class MyflowController {
 public MyflowController(ApexPages.StandardController stdController) {}
   public Flow.Interview.My_Tickets Myflow {get; set;}
   public String fullURL {get; set;}
   private String Instance = null;
   private void GetURL() {
      Instance = GetInstance(Instance);
      fullURL = 'https://' + Instance + '.salesforce.com/a1G/e?retURL=%2Fa1G%2Fo&RecordType=' + RTid() + '&ent=02I400000013Z1q';
      }
   public PageReference getLinkID() {
      GetURL();
      PageReference p = new PageReference (fullURL);
      p.setRedirect(true);
      return p;
      }
   public String RTid() {
      if (Myflow==null) return '';
      else return Myflow.varRecordType;
      }
   public String GetInstance(String Instance) {
      if (Instance == null) {
          List<String> parts = System.URL.getSalesforceBaseUrl().getHost().replace('-api','').split('\\.');
          if (parts.size() == 3) Instance = parts[0];
          else if (parts.size() == 5) Instance = parts[1];
          else Instance = null;
          } 
          return Instance;
       }
   }

Thanks for your help!

Ana
Hi,

I'm trying to figure out how to write a trigger that will update a custom field (Stage_c) with a particular pick-list value after an Event date and time passes.

Basically in the Event Subject field, I have a picklist value called "Needs Assessment", what I need to accomplish is...if an Event has the subject of "Needs Assessment" and the date and time passes i.e., "Completed" and this Event now falls under Activity History, I need to have the custom field (Stage_c) update to a picklist value "Needs Assessment Completed".

I have triggers working great for the same process on Tasks, but since Events are not "Completed" per se, how do I go about writing a trigger for this same action but on events? Is it possible?

Below is the code I currently use on my Task trigger:

trigger changeAccountStagetask3 on Task (before update, after update) {
    List<Account> accsToUpdate = new List<Account>();
        for (Task tsk: Trigger.new){
            if(tsk.Status=='Completed' && tsk.Subject=='Initial Sell/Needs Assessment'){
                Account ld = new Account(Id=tsk.whatid);                             
                     ld.Stage__c = 'Needs Assessment Completed';
                accsToUpdate.add(ld);          
            }
          
        }      
        update accsToUpdate;
    }

Any help would be wonderful!!!

Thanks!!!
I discovered this issue while attempting to view test coverage highlighting in the developer console. All of our org's tests pass and the percentage for each class is visible under the Overall Class Coverage table. Regardless of the the class, the Code Coverage selector has 'None' as its only available selection. I have tried reopening, editing, and resaving the classes in the dev console with no luck.Screenshot of problem
Hi,

Is there any way to get description of all fields of an object in apex code?
Able to query inline text help, label, api name, length etc, but not the description.
Any workaround/trick ?

Thanks
Sid

We are a team of salesforce.com consultants looking for a full time Salesforce Administrator/Consultant who can work virtually with our clients from their home office.  This person must have the ability to get on a call with a client and develop a quick understanding of client business issues.  You will need to be able to evaluate a business issue faced by the customer and determine how best to employ salesforce.com to solve it. 

 

Core skills would include:

  • All normal salesforce.com administration tasks and an understanding of all major functional areas of Salesforce.com
  • Including (but not limited to) reports and dashboards.
  • Data imports (using data loader or other tools).
  • General problem solving skills in Salesforce.com
  • Have a very good feel for where visualforce can be used to solve business problems - for example, where a trigger might be used due to workflow limitations, or where a visualforce page might be used in place of the standard user interface to make a complex business task easier for a user.
  • Ability to design the data model to support given business requirements and architect the various associated systems. 
  • You should be able to efficiently, effectively, and clearly coordinate and manage work with our development team while managing the client relationship from start to finish.  This would include some evening hours to work with our overseas developers to explain & manage project requirements.
  • Salesforce.com Certified Administrator

 You do not need to be a developer – other individuals in our company will do the actual development.