• StenE
  • NEWBIE
  • 80 Points
  • Member since 2011

  • Chatter
    Feed
  • 3
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 17
    Replies

Hi,

 

I have an application on the AppExchange and several of my customers are complaining about very slow page loads or even page time outs. 

I did some debugging and found out that the following functions is causing the trouble. 

 

private List<SelectOption> cntcFlds;
public List<SelectOption> getContactFields() {
        
        if (cntcFlds == null) {
            List<SelectOption> options = new List<SelectOption>();
            options.add(new SelectOption('N/A','N/A'));
            Map<String, Schema.SObjectField> M = Schema.SObjectType.Contact.fields.getMap();
            for (Schema.SObjectField field: M.values()) {
                Schema.DescribeFieldResult F = field.getDescribe();
                if (F.isUpdateable()) {
                    options.add(new SelectOption(F.getName(),F.getLabel()));        
                }
            }
            cntcFlds = options;
            return options; 
        } else return cntcFlds;
        
    }

 

 But what is wrong with this function? Or did Salesforce changed the performance of the getDescribe functions?

 

Thanks,

Sten

 

 

 

  • June 08, 2012
  • Like
  • 0

Hi,

 

I have a managed packages which is license through the LMA.

Now a customer has an issue in its sandbox. How can i use the subscriber login for his sandbox?

 

I need to debug some apex code on their site.

 

Thanks,
Sten

  • March 12, 2012
  • Like
  • 0

Guys,

 

I'm creating a page which has three nested apex:repeat.

 

the first is for severtal content blocks -- APEX;REPEAT

the second is a table -- PAGEBLOCKTABLE

The third is the number of COLUMNS -- APEX:REPAT

 

VISUALFORCE

<apex:repeat value="{!SuperMap}" var="O" id="MapRepeat">
	<apex:pageBlock title="Results for {!O}">
		<apex:pageBlockTable value="{!SuperMap[O]}" var="R" id="RecordRepeat">
			<apex:column headerValue="#"><apex:inputCheckbox value="{!R.rSelected}"/></apex:column>
			<apex:column headerValue="Score"><apex:outputText value="{!R.rScore}"/></apex:column>
			<apex:repeat value="{!FieldList[O]}" var="H" id="HeaderRepeat">
				<apex:column headerValue="{!H}"><apex:outputText value="{!R.rObject[H]}"/></apex:column>
			</apex:repeat> 
		</apex:pageBlockTable>
	</apex:pageBlock>
</apex:repeat>

 

APEX CONTROLLER

public class Result { 
	public String rId {get; set;}
	public Integer rScore {get; set;}
	public Boolean rSelected {get; set;}
	public sObject rObject {get; set;}
}

Map<String,List<Result>> SuperMap = new Map<String,List<Result>>();
Map<String,Map<String,String>> FieldList = new Map<String,Map<String,String>>();

// CONTENT FIELD LIST
// {OBJECT NAME,{FieldName,FieldLabel}}
// {Lead,{FirstName,First Name}},{Lead,{LastName,Last Name}}

// CONTENT SUPER MAP
// {OBJECT NAME,{{ID,SCORE,SELECTED,FULL OBJECT},{ID,SCORE,SELECTED,FULL OBJECT}}}
// {Lead,{{00034798,98,false,{Lead:{FirstName:peter,LastName:de hond}}},{00034756,97,false,{Lead:{FirstName:peter,LastName:de hond}}}}

 When i try to save this page it will crash with the following error.

 

Save error: Incorrect parameter for subscript. Expected Text, received core.apexpages.el.adapters.RuntimeTypeMetadataELAdapter   

 

This error is triggered via the {!R.rObject[H]} part.

 

Please help!

  • March 12, 2012
  • Like
  • 0

Ok. Very strange problem here. 

 

I have an application which runs a very sophisticated query on the lead object. The Where clause contains 4 field. Non of them is containing null values. 

 

* IsDeleted

* IsConverted

* KeyA (custom, external id)

* KeyB (custom, external id)

 

If i run this query via an visualforce page it runs fine and results in only 1 record. If this exactly the same query is triggered via a trigger on the object it crashes with the non selective query execption. 

 

Who can help me in getting this explained?

 

Thanks,

Sten

  • February 28, 2012
  • Like
  • 0

I need an Apex function which determines if the Salesforce Org where is runs is enabled for the Person Account Type.

 

Has someone any ideas how to do this.

 

Thanks,

Sten

  • February 07, 2012
  • Like
  • 0

Hi All,

 

I have two managed packages available on the appexchange which are doing quite well.

But after a while and learning more from the force.com platform i have better ideas of designing and developing my applications.

 

I cannot change these things in the current package as i cannot delete objects and functions from already released packages. Is there a way to start fresh with a version 2.0 of my package and attach this package to the same appexchange listing?

 

Thanks,

Sten

  • January 30, 2012
  • Like
  • 0

Is there a possibility to use dynamic custom labels in apex. I know you can do this with VF, but i can't find it for apex. 

 

Custom label = 'You have used {0} in {1} Hours'

 

in apex

 

String text = Label.used(List<String>('12','2');

 

  • January 17, 2012
  • Like
  • 0

Hi,

 

I have a problem with one of my apps. Hope someone has an solution.

 

I have a batch processes which updates every record in the Lead, Contact and Account objects. Now on every update it also fires the workflows which are defined for these objects. I don't want to fire these workflows as my batch update is a pure maintance batch.

 

How can i stop these workflows from executing?

 

Thanks,

Sten

  • January 02, 2012
  • Like
  • 0

HI All,

 

I'm stuck. I've created an VF Page which uses the standard Lead controller and an extension class.

On the VF Page i created several command button which uses actions from the standard lead controller (Save and cancel). Whenever i use this buttons i get an Insufficient Privileges. i cannot see why this is happening and i should not have any privilige problems as i'm working as an administrator. 

 

Have any one an idea?

 

Thanks,
Sten

  • October 27, 2011
  • Like
  • 0

Hi Everyone,

 

I'm stuck.

 

I have an Sobject (contact,account or lead) and it's quite easy to get the data out of it.

 

SObject obj;
String Input = string.valueof(obj.get('Phone'));

 

 But now i need to know the field type as well. I thought it would be something like this. Please help.

 

Schema.SObjectField Fld = (Schema.sObjectField) obj.get('Phone');
Schema.DisplayType FldType = Fld.getDescribe().getType();

 

Thanks already!

 

Sten

 

 

  • September 02, 2011
  • Like
  • 0

Hi,

 

I'm developing a custom app for salesforce. I'm using custom settings to store my default settings. But how can i include these default settings in mijn managed package?

 

Thanks,
Sten

  • September 02, 2011
  • Like
  • 0

HI,

 

The documentation tells me that i can create a task object which is related to an custom object by using the WhatID field. Is i creat a task via DML and link it to my custom object ID the insert will fail because of 'Related To: Opportunity/Account ID: id value of incorrect type: a04A000000Bj8wJIAR'. 

 

Has someone experience with this and is there a way to do this without any custom objects...?

 

Thanks,

Sten

  • September 01, 2011
  • Like
  • 1

HI,

 

The documentation tells me that i can create a task object which is related to an custom object by using the WhatID field. Is i creat a task via DML and link it to my custom object ID the insert will fail because of 'Related To: Opportunity/Account ID: id value of incorrect type: a04A000000Bj8wJIAR'. 

 

Has someone experience with this and is there a way to do this without any custom objects...?

 

Thanks,

Sten

  • September 01, 2011
  • Like
  • 1

I've been a Force.com developer for 7 years and I can't for the life of me figure this out!

 

The docs allude to what this post says directly: that to add a Remote Access Application to a Managed Package, you have to do so during creation of the managed package.

 

However I can find no way to do so.  In the flow of the managed package creation I see this when first making the package:

 

 

Hmm, nothing here.  Maybe after I save it?

 

 

Not here either.  No new button under Remote Access.  Maybe if I edit the package?

 

A few new options here, but nothing regarding a remote access.

 

So maybe if I kill the managed package and make a new Remote Access?

 

 

Not seeing anything here to add to a package, maybe after I save it?

 

 

ARGH!

 

So how exactly can I add this Remote Access Application to my package?  Does anybody know?  Thanks.

Hi,

 

I have an application on the AppExchange and several of my customers are complaining about very slow page loads or even page time outs. 

I did some debugging and found out that the following functions is causing the trouble. 

 

private List<SelectOption> cntcFlds;
public List<SelectOption> getContactFields() {
        
        if (cntcFlds == null) {
            List<SelectOption> options = new List<SelectOption>();
            options.add(new SelectOption('N/A','N/A'));
            Map<String, Schema.SObjectField> M = Schema.SObjectType.Contact.fields.getMap();
            for (Schema.SObjectField field: M.values()) {
                Schema.DescribeFieldResult F = field.getDescribe();
                if (F.isUpdateable()) {
                    options.add(new SelectOption(F.getName(),F.getLabel()));        
                }
            }
            cntcFlds = options;
            return options; 
        } else return cntcFlds;
        
    }

 

 But what is wrong with this function? Or did Salesforce changed the performance of the getDescribe functions?

 

Thanks,

Sten

 

 

 

  • June 08, 2012
  • Like
  • 0

Guys,

 

I'm creating a page which has three nested apex:repeat.

 

the first is for severtal content blocks -- APEX;REPEAT

the second is a table -- PAGEBLOCKTABLE

The third is the number of COLUMNS -- APEX:REPAT

 

VISUALFORCE

<apex:repeat value="{!SuperMap}" var="O" id="MapRepeat">
	<apex:pageBlock title="Results for {!O}">
		<apex:pageBlockTable value="{!SuperMap[O]}" var="R" id="RecordRepeat">
			<apex:column headerValue="#"><apex:inputCheckbox value="{!R.rSelected}"/></apex:column>
			<apex:column headerValue="Score"><apex:outputText value="{!R.rScore}"/></apex:column>
			<apex:repeat value="{!FieldList[O]}" var="H" id="HeaderRepeat">
				<apex:column headerValue="{!H}"><apex:outputText value="{!R.rObject[H]}"/></apex:column>
			</apex:repeat> 
		</apex:pageBlockTable>
	</apex:pageBlock>
</apex:repeat>

 

APEX CONTROLLER

public class Result { 
	public String rId {get; set;}
	public Integer rScore {get; set;}
	public Boolean rSelected {get; set;}
	public sObject rObject {get; set;}
}

Map<String,List<Result>> SuperMap = new Map<String,List<Result>>();
Map<String,Map<String,String>> FieldList = new Map<String,Map<String,String>>();

// CONTENT FIELD LIST
// {OBJECT NAME,{FieldName,FieldLabel}}
// {Lead,{FirstName,First Name}},{Lead,{LastName,Last Name}}

// CONTENT SUPER MAP
// {OBJECT NAME,{{ID,SCORE,SELECTED,FULL OBJECT},{ID,SCORE,SELECTED,FULL OBJECT}}}
// {Lead,{{00034798,98,false,{Lead:{FirstName:peter,LastName:de hond}}},{00034756,97,false,{Lead:{FirstName:peter,LastName:de hond}}}}

 When i try to save this page it will crash with the following error.

 

Save error: Incorrect parameter for subscript. Expected Text, received core.apexpages.el.adapters.RuntimeTypeMetadataELAdapter   

 

This error is triggered via the {!R.rObject[H]} part.

 

Please help!

  • March 12, 2012
  • Like
  • 0

Hi,

 

I want to render the column header names dynamically in PageBlock Table as below:

 

Code Snippet

<apex:pageBlockTable border="2"  value="{!testList}" var="a" id="a">

<apex:column  headervalue="{!a.Field_Name__c}" rendered="{!NOT(ISNULL(a.Field_Name__c))}">
<apex:outputText value="{!a.Field_Value__c}"/>
</apex:column>

</apex:pageBlockTable>

 

The above snippet is just displaying the Value but not the header name

 

So as my Coulmn header I want to populate the Field Name.How can I acheive this?

 

Any help would be highly appreciated:-)

Ok. Very strange problem here. 

 

I have an application which runs a very sophisticated query on the lead object. The Where clause contains 4 field. Non of them is containing null values. 

 

* IsDeleted

* IsConverted

* KeyA (custom, external id)

* KeyB (custom, external id)

 

If i run this query via an visualforce page it runs fine and results in only 1 record. If this exactly the same query is triggered via a trigger on the object it crashes with the non selective query execption. 

 

Who can help me in getting this explained?

 

Thanks,

Sten

  • February 28, 2012
  • Like
  • 0

Is there a possibility to use dynamic custom labels in apex. I know you can do this with VF, but i can't find it for apex. 

 

Custom label = 'You have used {0} in {1} Hours'

 

in apex

 

String text = Label.used(List<String>('12','2');

 

  • January 17, 2012
  • Like
  • 0

HI All,

 

I'm stuck. I've created an VF Page which uses the standard Lead controller and an extension class.

On the VF Page i created several command button which uses actions from the standard lead controller (Save and cancel). Whenever i use this buttons i get an Insufficient Privileges. i cannot see why this is happening and i should not have any privilige problems as i'm working as an administrator. 

 

Have any one an idea?

 

Thanks,
Sten

  • October 27, 2011
  • Like
  • 0

Hi Everyone,

 

I'm stuck.

 

I have an Sobject (contact,account or lead) and it's quite easy to get the data out of it.

 

SObject obj;
String Input = string.valueof(obj.get('Phone'));

 

 But now i need to know the field type as well. I thought it would be something like this. Please help.

 

Schema.SObjectField Fld = (Schema.sObjectField) obj.get('Phone');
Schema.DisplayType FldType = Fld.getDescribe().getType();

 

Thanks already!

 

Sten

 

 

  • September 02, 2011
  • Like
  • 0

Hi,

 

I'm developing a custom app for salesforce. I'm using custom settings to store my default settings. But how can i include these default settings in mijn managed package?

 

Thanks,
Sten

  • September 02, 2011
  • Like
  • 0

Hello.  I have a VF page where a user can enter search parameters for a PersonAccount.  In the controller, i instantiate a dummy Account - and use that for the inputField info (apex:InputField value="{!patientSearchAccount.LastName}".  The issue is that on the VF page, the firstname and lastname fields are "disabled" - presumably because the system doesn't know it's a person acct.  How do i make this work?

 

Note, i found a similar thread (http://boards.developerforce.com/t5/Visualforce-Development/Creating-a-Person-Account-with-Visualforce-and-a-Custom/m-p/137953) - but this question is never answered there. 

 

Thanks for your time.

chris

hi

 

Why can't we use SoSL in Triggers.

 Thanks In advance

  • January 11, 2011
  • Like
  • 0