• Sol2012
  • NEWBIE
  • 9 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 6
    Replies
Hello,

I am having an issue with a controller extension, where I am able to get a record ID and then make a SOQL query... but the query does not load all selected fields...

I have tried both getting these fields both from the controller and from a SOQL query, to no attempt...

Am I missing something? Is it just a bug?

Thanks in advance for any help!

Apex code (two options with alternatives and results. Current option "active": get opportunity from SOQL query):
public with sharing class OpportunityQualityControllerExtension {
	
	private Opportunity controllerOpportunity;
	private Opportunity opp;
	private Id recordId;
	
	// The extension constructor initializes the private member
	// variable acct by using the getRecord method from the standard
	// controller.
	public OpportunityQualityControllerExtension(ApexPages.StandardController stdController) {
		
		// Option 1: Use controller
		/*
		stdController.reset();	// Should not be needed, but there is no difference
		stdController.addFields(new List<String>{'HiddenName__c', 'KeyDecisionMaker_id__c'});	// Add extra fields
		this.controllerOpportunity = (Opportunity)stdController.getRecord();	// Get record
		opp = this.controllerOpportunity; // Assign Opportunity to a new variable to validate it below
		*/
		// Alternative options: use recordId to perform a query (all 3 alternative methods return the same ID, the right one)
		//recordId = controllerOpportunity.Id;	// Alternative 1: Get Id from Opportunity ID
		//recordId = stdController.getId();		// Alternative 2: Get Id directly from Standard Controller
		recordId = ApexPages.currentPage().getParameters().get('id');	// Alternative 3: Get Id from page parameters
		opp = [SELECT Id, Name, HiddenName__c, KeyDecisionMaker_id__c, StageName FROM Opportunity WHERE Id = :recordId];
		
		// Validate options above...
		if (opp == null) {
			System.debug('===> NULL Opportunity!!!');
		} else {
			System.debug('===> Opportunity value: ' + opp);
		}
		
		// Option 1 result (Using controller)
		//	===> Opportunity value: Opportunity:{RecordTypeId=012D0000000JzBSIA0, CurrencyIsoCode=EUR, Id=006L0000006E7qFIAS}
		
		// Option 2 result (Using query)
		//	===> Opportunity value: Opportunity:{Name=XXXX, StageName=Potential, RecordTypeId=012D0000000JzBSIA0, CurrencyIsoCode=EUR, HiddenName__c=XXXX, Id=006L0000006E7qFIAS}
	}
}
Visualforce code (Irrelevant: it is used inline in a Standard opportunity page layout):
 
<apex:page standardController="Opportunity" extensions="OpportunityQualityControllerExtension" tabStyle="Opportunity" >
	<apex:pagemessages />
	In...
</apex:page>






 
Hello all,

I am starting to experiment with Flow/Login Flow. I have been able to create a simple message for users following this mini-howto:

http://www.crmsalesforcetraining.com/salesforce-login-flow-notice-display-sfdc-login-flow-display/

My question is:

How do I completely skip the login flow and let the users login straight into home page WHEN there are no available messages (records) for them?

Thanks in advance!

Hello,

I have created a trigger that allows me to assign the proper owner to my opportunities.

I am willing to do the same on a *custom* object, but I cannot use the OwnerId: the (standard) API does not provide this field.

This is very rare for two reasons:

 

  1. The "OwnerId" field can be assigned by external tools such as "Apex Loader" and "Apatar connector".
  2. I can see all the other standard fields in my custom object, using the following code:
Map<String, Schema.SObjectField> m = Schema.SObjectType.MyCustomObject__c.fields.getMap();

 

 

 

Am I missing something here? Is there any workaround?


Thanks and regards

Hello,

I am having an issue with a controller extension, where I am able to get a record ID and then make a SOQL query... but the query does not load all selected fields...

I have tried both getting these fields both from the controller and from a SOQL query, to no attempt...

Am I missing something? Is it just a bug?

Thanks in advance for any help!

Apex code (two options with alternatives and results. Current option "active": get opportunity from SOQL query):
public with sharing class OpportunityQualityControllerExtension {
	
	private Opportunity controllerOpportunity;
	private Opportunity opp;
	private Id recordId;
	
	// The extension constructor initializes the private member
	// variable acct by using the getRecord method from the standard
	// controller.
	public OpportunityQualityControllerExtension(ApexPages.StandardController stdController) {
		
		// Option 1: Use controller
		/*
		stdController.reset();	// Should not be needed, but there is no difference
		stdController.addFields(new List<String>{'HiddenName__c', 'KeyDecisionMaker_id__c'});	// Add extra fields
		this.controllerOpportunity = (Opportunity)stdController.getRecord();	// Get record
		opp = this.controllerOpportunity; // Assign Opportunity to a new variable to validate it below
		*/
		// Alternative options: use recordId to perform a query (all 3 alternative methods return the same ID, the right one)
		//recordId = controllerOpportunity.Id;	// Alternative 1: Get Id from Opportunity ID
		//recordId = stdController.getId();		// Alternative 2: Get Id directly from Standard Controller
		recordId = ApexPages.currentPage().getParameters().get('id');	// Alternative 3: Get Id from page parameters
		opp = [SELECT Id, Name, HiddenName__c, KeyDecisionMaker_id__c, StageName FROM Opportunity WHERE Id = :recordId];
		
		// Validate options above...
		if (opp == null) {
			System.debug('===> NULL Opportunity!!!');
		} else {
			System.debug('===> Opportunity value: ' + opp);
		}
		
		// Option 1 result (Using controller)
		//	===> Opportunity value: Opportunity:{RecordTypeId=012D0000000JzBSIA0, CurrencyIsoCode=EUR, Id=006L0000006E7qFIAS}
		
		// Option 2 result (Using query)
		//	===> Opportunity value: Opportunity:{Name=XXXX, StageName=Potential, RecordTypeId=012D0000000JzBSIA0, CurrencyIsoCode=EUR, HiddenName__c=XXXX, Id=006L0000006E7qFIAS}
	}
}
Visualforce code (Irrelevant: it is used inline in a Standard opportunity page layout):
 
<apex:page standardController="Opportunity" extensions="OpportunityQualityControllerExtension" tabStyle="Opportunity" >
	<apex:pagemessages />
	In...
</apex:page>






 
Having an issue with running an APEX Class using the developer console.  Can anyone tell me what the error below means?

User-added image 

Hello,

I have created a trigger that allows me to assign the proper owner to my opportunities.

I am willing to do the same on a *custom* object, but I cannot use the OwnerId: the (standard) API does not provide this field.

This is very rare for two reasons:

 

  1. The "OwnerId" field can be assigned by external tools such as "Apex Loader" and "Apatar connector".
  2. I can see all the other standard fields in my custom object, using the following code:
Map<String, Schema.SObjectField> m = Schema.SObjectType.MyCustomObject__c.fields.getMap();

 

 

 

Am I missing something here? Is there any workaround?


Thanks and regards

Hello -
 
We have fields on some custom objects that we currently populate through nightly integrations.  We would like to change that and have them be populated with a SF formula.  My SF Administrator tried to change the field type from text to formula but was unable to.  Is there some reason that we are unable to make that change??  It looks like we are required to create an entirely new formula field and delete the old??  This will require alot of work in our integrations and back office reporting of the replciated SF data to accomodate for an entirely new field.  Any idea's??
 
Thanks, Tammy