• Thibault Weber
  • NEWBIE
  • 10 Points
  • Member since 2012
  • Synefo

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 12
    Replies
Hi,

Does anyone know how to convert the field names returned by the analytics API (on the left of the image) to Salesforce field names (on the right of the image):

Example:
LAST_UPDATE_BY => LastModifiedBy
ADDRESS1_STREET => BillingStreet
...
User-added image

I would like to dynamically generate a SOQL query based on Analytics API results.

Thanks,

Hi,

 

Today I encountered a problem that I can't explain:

 

I got a record 'recA' shared with a user 'userU' through manual sharing (read-only)

 

When I request the UserRecordAccess object in a 'without sharing' class, all works fine:

[SELECT RecordId, HasEditAccess FROM UserRecordAccess WHERE UserId = :userUid AND RecordId = :recAid LIMIT 1]

=> {RecordId=a0kM0000000jWMxIAM, Id=000000000000000AAA, HasEditAccess=false}

 

 But when I execute the same code in a 'with sharing' class, i get 

 

{RecordId=a0kM0000000jWMxIAM, Id=000000000000000AAA, HasEditAccess=true}  //HasEditAccess should be false}

 

 

It seems like a bug, because when I do this query:

 

[SELECT RecordId FROM UserRecordAccess WHERE UserId = :userUid AND RecordId = :recAid AND HasEditAccess = true LIMIT 1]

 I get not results...

 

 

Please let me know if you have already encountered some problems with the UserRecordAccess object.

 

I'm in API 26

 

Thanks

 

 

Hi,

 

I have a problem with classes extensions, here a very simple example: 

 

 

public virtual with sharing class Car{

	protected String brand;
	
	public virtual String getBrand(){
		return this.brand;
	}
}

 

public with sharing class Mustang extends Car{

	protected String brand = 'Ford';

}

 

Controller:

Car myCar = new Mustang();

system.debug( myCar.getBrand() ); // return null

 

myCar.getBrand() should return 'Ford' but I get null.

 

Where is the problem?

 

Thanks.

Hi,

 

I have a problem with my visualforce page.

 

This the kind of page/result I want to (in a simplified version):

 

<apex:page controller="Test1" >
	<apex:form >
		<apex:pageBlock>
			<apex:pageBlockButtons location="top">
				<apex:commandButton value="Save" action="{!saveNewRecord}" rerender="newRecordForm" />
			</apex:pageBlockButtons>
			
			<apex:pageBlockSection id="newRecordForm" >
				<apex:inputField value="{!newRecord['Name']}"/>
				<apex:inputField value="{!newRecord['Date__c']}" required="true"/>
			</apex:pageBlockSection>			
		</apex:pageBlock>
	</apex:form>
</apex:page>

 

public with sharing class Test1 {
	
	public sobject newRecord{get;set;}
	
	public Test1(){
		 this.newRecord = Schema.getGlobalDescribe().get('MyObject__c').newSObject();
	}
	
	public void saveNewRecord(){
		//Save Here
	}
}

 When I just fill the "Name" field and save, it works fine:

 

Name:
{My Value}
Date:
{empty}
  [ 18/06/2012 ]
Error: You must enter a value

 

 

Now I try do the same but with a dynamicComponent (I need to for my non-simplified page):

 

<apex:page controller="Test2" >
	<apex:form >
		<apex:pageBlock>
			<apex:pageBlockButtons location="top">
				<apex:commandButton value="Save" action="{!saveNewRecord}" rerender="newRecordForm" />
			</apex:pageBlockButtons>
			
			<apex:dynamicComponent componentValue="{!newRecordForm}"/>		
		</apex:pageBlock>
	</apex:form>
</apex:page>

 

public with sharing class Test2{
	
	public sobject newRecord{get;set;}
	
	public Test2(){
		 this.newRecord = Schema.getGlobalDescribe().get('MyObject__c').newSObject();
	}
	
	public Component.Apex.PageBlockSection getNewRecordForm(){
		
		Component.Apex.PageBlockSection form = new Component.Apex.PageBlockSection(id = 'newRecordForm');
		
		Component.Apex.inputField nameField = new Component.Apex.inputField();
		nameField.expressions.value = '{!newRecord[\'Name\']}';
			
		Component.Apex.inputField dateField = new Component.Apex.inputField(required = true);
		dateField.expressions.value = '{!newRecord[\'Date__c\']}';
		
		form.childComponents.add(nameField);
		form.childComponents.add(dateField);
		return form; 
	}
	
	public void saveNewRecord(){
		//Save Here
	}
}

 

 When I just fill the "Name" field and save, the "Name" value disappears on rerender:


Name:
{EMPTY}
Date:
{empty}
  [ 18/06/2012 ]
Error: You must enter a value

 

The newRecord controller variable doesn't seems to be updated here. But if I fill both fields, there is no error and the saveNewRecord() method retrieves both values...


I hope I was clear and that someone could help me.

 

Thanks

 

For the past two days I've noticed that none of my apex class test are working in my sandbox. Whether I run all test or run them individually they do not work. No pass, no fail, just stays queued. I've tried clearing my test data, compiling the classes and everything but still no change. Anyone seen this and how did you solve the issue? My test work fine in my production instance.

Hi All,

I am trying to run a report from apex and get the JSON response I've looked the the documentation but I can see how to get the data from out-side the system but I can't find how to run the report from within Salesforce,

 

Please help,

Thank you,

Roy

 

Link to the documentation:

http://www.salesforce.com/us/developer/docs/api_analytics/index.htm

 

 

Hi,

 

i want to log a case in my developer org. when i click on "Help" link on top right corner in the home page it is redirecting to Help.salesforce.com but when i try to open a case by clicking on "open case" its again going to home page of Help.salesforce.com and this is repeating as a cycle and not able to open a case.

the same is happening in Sandbox also.

 

but when i go to enterprise/production org the link i see on top right corner in "Help & Training"  instead of only "Help" (in Developer org) and its allowing me to open a case.

 

please help me if anyone has idea about this.

i have an urgent requirement to open a case from my developer org.

 

thanks in advance

Hi,

 

I have a problem with classes extensions, here a very simple example: 

 

 

public virtual with sharing class Car{

	protected String brand;
	
	public virtual String getBrand(){
		return this.brand;
	}
}

 

public with sharing class Mustang extends Car{

	protected String brand = 'Ford';

}

 

Controller:

Car myCar = new Mustang();

system.debug( myCar.getBrand() ); // return null

 

myCar.getBrand() should return 'Ford' but I get null.

 

Where is the problem?

 

Thanks.

Hi,

 

I have a problem with my visualforce page.

 

This the kind of page/result I want to (in a simplified version):

 

<apex:page controller="Test1" >
	<apex:form >
		<apex:pageBlock>
			<apex:pageBlockButtons location="top">
				<apex:commandButton value="Save" action="{!saveNewRecord}" rerender="newRecordForm" />
			</apex:pageBlockButtons>
			
			<apex:pageBlockSection id="newRecordForm" >
				<apex:inputField value="{!newRecord['Name']}"/>
				<apex:inputField value="{!newRecord['Date__c']}" required="true"/>
			</apex:pageBlockSection>			
		</apex:pageBlock>
	</apex:form>
</apex:page>

 

public with sharing class Test1 {
	
	public sobject newRecord{get;set;}
	
	public Test1(){
		 this.newRecord = Schema.getGlobalDescribe().get('MyObject__c').newSObject();
	}
	
	public void saveNewRecord(){
		//Save Here
	}
}

 When I just fill the "Name" field and save, it works fine:

 

Name:
{My Value}
Date:
{empty}
  [ 18/06/2012 ]
Error: You must enter a value

 

 

Now I try do the same but with a dynamicComponent (I need to for my non-simplified page):

 

<apex:page controller="Test2" >
	<apex:form >
		<apex:pageBlock>
			<apex:pageBlockButtons location="top">
				<apex:commandButton value="Save" action="{!saveNewRecord}" rerender="newRecordForm" />
			</apex:pageBlockButtons>
			
			<apex:dynamicComponent componentValue="{!newRecordForm}"/>		
		</apex:pageBlock>
	</apex:form>
</apex:page>

 

public with sharing class Test2{
	
	public sobject newRecord{get;set;}
	
	public Test2(){
		 this.newRecord = Schema.getGlobalDescribe().get('MyObject__c').newSObject();
	}
	
	public Component.Apex.PageBlockSection getNewRecordForm(){
		
		Component.Apex.PageBlockSection form = new Component.Apex.PageBlockSection(id = 'newRecordForm');
		
		Component.Apex.inputField nameField = new Component.Apex.inputField();
		nameField.expressions.value = '{!newRecord[\'Name\']}';
			
		Component.Apex.inputField dateField = new Component.Apex.inputField(required = true);
		dateField.expressions.value = '{!newRecord[\'Date__c\']}';
		
		form.childComponents.add(nameField);
		form.childComponents.add(dateField);
		return form; 
	}
	
	public void saveNewRecord(){
		//Save Here
	}
}

 

 When I just fill the "Name" field and save, the "Name" value disappears on rerender:


Name:
{EMPTY}
Date:
{empty}
  [ 18/06/2012 ]
Error: You must enter a value

 

The newRecord controller variable doesn't seems to be updated here. But if I fill both fields, there is no error and the saveNewRecord() method retrieves both values...


I hope I was clear and that someone could help me.

 

Thanks

 

My Visualforce test page:

 

<apex:page sidebar="false" showHeader="false">
<c:ideas_email_digest email="{!$CurrentPage.parameters.email}" mode="Weekly"/>
</apex:page>

 

The Visualforce component:

 

<apex:component controller="ideas_digest_component_controller" access="global">
	<apex:attribute type="String" name="email" assignTo="{!context_user}" description="email address for context" /> 
	<apex:attribute type="String" name="mode" assignTo="{!digest_mode}" description="Digest type can be Weekly or Monthly"/>

{!context_user}   <-- Loads

{!mode} <-- Loads

//.... rest of page

</apex:component>

 

Component controller:

 

public class ideas_digest_component_controller {

	// stuff for the visualforce page
	public string context_user {get; set;}
	public  string digest_mode { get; set; }


// Constructor
public ideas_digest_component_controller() {
		
		if(context_user==null) {
			system.assert(false);  // <-- Always get here
		}
}

///... rest of code irrelevant

}

 

 

My question is, on the VF test page, the class properties are set and will display on the page. However, in the class constructor, the property values are still null.

 

At what point are these values populated? Why are they null in the controller? They are used to load dynamic data for the vforce page.

is there any way to get the recent viewed records on a visualforce page?

I want to check if user is system administrator in visual force page. if not then redirect to another page.

Please help me.

I have a requirement where i need to create a page having many tabs as well as tabPanels. The number of tabs to be displayed is decided at run time. i tried using tabPanel inside repeat but it renders tabPanels again and again but not the tabs. Is there any way to do this using visualforce?

 

for eg: say i have three tabPanels:

 

tabPanel 1 :

 

tab1 tab2 tab3

this contains three tabs(say)

 

tabPanel 2 :

tab 1 tab 2

this contains two tabs(say)

 

etc.

 

again when next time i render the page, tabPanel 1 may have 4 tabs and also the page may have an added, tabPanel with multiple tabs.

 

 

Any Suggestion will be appreciated.

 

Thanks in advance.

  • June 08, 2010
  • Like
  • 0