• Dan_Gru
  • NEWBIE
  • 0 Points
  • Member since 2010

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

I have the requirments to create record of generic sObject. How to do it?

 

A little more detail: a name of sObject holds in a variable, and i need to create record for it and insert it. I am stuck in this. Has anyone ideas? May be i miss some methods of object token or describe object?

 

Will be wery, wery thankful for help.

Hello.

 

Did anyone customize default change password page for customer portal users?

 

By now where the new user registered he recieve new(automatig generated) password. So, when he first time log in portal he redirects to "https://cs1.salesforce.com/_ui/system/security/ChangePassword" that is default page. How can i change it?

 

Now log process performed in this way:

 

-user comes to site page.

-he log to site using his portal user login and password. If it non-correct (site.login() function return null) he are still on this page with error message. If it correct the form with action portal_login.jsp pulled by entered values and submitted. After this user redirects to default portal tab. But! If he logg first time the result of portal_login.jsp is 'https://cs1.salesforce.com/_ui/system/security/ChangePassword'. How can i change it?

 

Will be wery gratefull for solution.

Hello, i would be thankfull if someone gives me any idea how to set permissions on custom object to customer portal user profile(or any another).

 

Now in apex code i tried to update same fields where logged from this profile and have this error:

 

Delete failed. First exception on row 0 with id a0PQ0000000sQiJMAU; first error: INSUFFICIENT_ACCESS_OR_READONLY, insufficient access rights on object id: []

 

This is on delete and i have the same on update.

 

When i open administrative page on those i might check permissions(profile edit page) i was confused because all of checkboxes(read, edit,create, delete) are disabled.

 

Can someone suggest something? Thank you.

Sometimes getting type of variable, names of their funcs, e.t.c. is necessary in code. Hove this mechanism realized in apex?

 

Or,at least, simple analog of java getClass()

Hello, i'am new in salesforce and i need to add new options to picklist 'Related To' in the  standart email sending form. I don't find information about it in documentation, so will be grateful if someone tell me how to do it.

In runtime composed querry, that get result as List<sObject> when sObject type is specified also in runtime.

 

After this i need to make same manipulation with data that contains in that's sObject fields. So i need to get type for each of them.

 

I use part of code like this

 

List<sObject> QuerryResult = Database.querry(....); 

Schema.DescribeSObjectResult ObjDescribe = QuerryResult[0].getSObjectType().getDescribe();

Schema.DescribeFieldResult FieldDescribe =  ObjDescribe.fields.*Name Of Field*.getDescribe();

Schema.SOAPType FieldType = FieldDescribe.getSOAPType();

 So the first question is: How can i get the field from fields array, when FieldName contains in another string variable and I don't know it when write code, just in runtime. (mb smth like $ in php or Type.getType(string typeName) in C#)

 

And the second(closely wired with the first): How can i get Schema.DescribeSObjectResult when name of object contains in another string variable. Becouse make querry before getting  all info about recieving fields crossing with understandible of program.

 

Smth like this:

 

Schema.DescribeSObjectResult ObjDescribe = Schema.SObjectType.*Name of sObject*

 

 

 

 

 

 

code part:

 

 

Map<String,PropertyType> SelectedItems = new Map<String,PropertyType>();

for(oneProperty oneProp : DisplaiedProperties)
{           System.Debug('_____________________'+oneProp.PropertyValue+'_______________'+oneProp.PType);
SelectedItems.put(oneProp.PropertyValue,oneProp.PType);
}


for(string b:SelectedItems.keySet())
{
System.Debug('_____________________'+b+'_______________'+SelectedItems.get(b));
}

 

and part of debug log:

 

9:58:31.506|USER_DEBUG|[461,4]|DEBUG|_____________________Name_______________TheString
9:58:31.506|METHOD_EXIT|[461,4]|System.Debug(String)
9:58:31.506|METHOD_ENTRY|[462,4]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.put(String, Select_Filtered_Popup_controller.PropertyType)
9:58:31.506|METHOD_EXIT|[462,4]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.put(String, Select_Filtered_Popup_controller.PropertyType)
9:58:31.506|METHOD_ENTRY|[461,4]|System.Debug(String)
9:58:31.507|USER_DEBUG|[461,4]|DEBUG|_____________________Phone_______________TheString
9:58:31.507|METHOD_EXIT|[461,4]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[462,4]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.put(String, Select_Filtered_Popup_controller.PropertyType)
9:58:31.507|METHOD_EXIT|[462,4]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.put(String, Select_Filtered_Popup_controller.PropertyType)
9:58:31.507|METHOD_ENTRY|[461,4]|System.Debug(String)
9:58:31.507|USER_DEBUG|[461,4]|DEBUG|_____________________BillingCountry_______________TheString
9:58:31.507|METHOD_EXIT|[461,4]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[462,4]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.put(String, Select_Filtered_Popup_controller.PropertyType)
9:58:31.507|METHOD_EXIT|[462,4]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.put(String, Select_Filtered_Popup_controller.PropertyType)
9:58:31.507|METHOD_ENTRY|[467,16]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.keySet()
9:58:31.507|METHOD_EXIT|[467,16]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.keySet()
9:58:31.507|METHOD_ENTRY|[469,6]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[469,63]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.get(String)
9:58:31.507|METHOD_EXIT|[469,63]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.get(String)
9:58:31.507|USER_DEBUG|[469,6]|DEBUG|_____________________Name_______________TheString
9:58:31.507|METHOD_EXIT|[469,6]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[469,6]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[469,63]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.get(String)
9:58:31.507|METHOD_EXIT|[469,63]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.get(String)
9:58:31.507|USER_DEBUG|[469,6]|DEBUG|_____________________BillingCountry_______________TheString
9:58:31.507|METHOD_EXIT|[469,6]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[469,6]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[469,63]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.get(String)
9:58:31.507|METHOD_EXIT|[469,63]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.get(String)
9:58:31.507|USER_DEBUG|[469,6]|DEBUG|_____________________Phone_______________TheString

 

 

 

 

How can i simply walk throught the Map in right direction???

I noticed that when visualforce page tabbed for it loading spent increadibly much of time. And it is not a time when previous page have shown to user(It could be looked normally). When tab is clicked there are white screen showed to a user while necessary redirects processed.

 

How i can solve this problem? And can it be solved at all? As a result i want to get loading process with same behavior as a loading of standart page when it called from tab.

For example, can I overload component from

<c:comp prop1(string)="mom" prop2(string)="dad"/>

to

<c:comp prop1(list<String>)={!ListHere} prop2(int)="5"/>

 

Like function overloading.

 

 

I need to use some scripts on the client side with the custom component. So I need to get Id of it root tag(span). How it possible?

 

Tried to use {!$Component} - wrote that "Unknown property $Component" in the build time.

Hello, i was trying to include static resources on my page with tags <apex:includeScript> and <apex:stylesheet>.

 

I used URLFOR to map the right path to resources.

So i wrote code:

<apex:includeScript value="{!URLFOR($Resource.all_res, '/js/json2.js')}" />

and like this.

 

As a result script wasn't included, and in the firebug debug window wrote this text:

 

"Failed to load source for: https://c.na7.visual.force.com/resource/1279700783000/all_res/js/json2.js"

 

I looked to "https://c.na7.visual.force.com/resource/1279700783000/all_res" in browser and it is really my static resource. After that i looks to "https://c.na7.visual.force.com/resource/1279700783000/all_res/js/json2.js" and find an empty page there. How it possible? Where i miss? And how can i include my recources?

At the first i am sorry about my English, but there are no resources except this to solve the problem with apex coding.

 

So I'll try to explain problem.

 

I need to make the part of code that would delete accounts which names have already written by user;

And of course I need to catch possible exceptions, so i try to use


List<Database.DeleteResult> deleteResults  = Database.delete(DeleteIdList);

 

and after that try to process List of deleteResults in the loop and check errors.

 

But it isn't work like i want. When record couldn't deleted generated DMLException.  Why? I didn't use any DML, i only used database method.

 

Will be thankfull for any ideas.

I have the requirments to create record of generic sObject. How to do it?

 

A little more detail: a name of sObject holds in a variable, and i need to create record for it and insert it. I am stuck in this. Has anyone ideas? May be i miss some methods of object token or describe object?

 

Will be wery, wery thankful for help.

Sometimes getting type of variable, names of their funcs, e.t.c. is necessary in code. Hove this mechanism realized in apex?

 

Or,at least, simple analog of java getClass()

Hello, i'am new in salesforce and i need to add new options to picklist 'Related To' in the  standart email sending form. I don't find information about it in documentation, so will be grateful if someone tell me how to do it.

In runtime composed querry, that get result as List<sObject> when sObject type is specified also in runtime.

 

After this i need to make same manipulation with data that contains in that's sObject fields. So i need to get type for each of them.

 

I use part of code like this

 

List<sObject> QuerryResult = Database.querry(....); 

Schema.DescribeSObjectResult ObjDescribe = QuerryResult[0].getSObjectType().getDescribe();

Schema.DescribeFieldResult FieldDescribe =  ObjDescribe.fields.*Name Of Field*.getDescribe();

Schema.SOAPType FieldType = FieldDescribe.getSOAPType();

 So the first question is: How can i get the field from fields array, when FieldName contains in another string variable and I don't know it when write code, just in runtime. (mb smth like $ in php or Type.getType(string typeName) in C#)

 

And the second(closely wired with the first): How can i get Schema.DescribeSObjectResult when name of object contains in another string variable. Becouse make querry before getting  all info about recieving fields crossing with understandible of program.

 

Smth like this:

 

Schema.DescribeSObjectResult ObjDescribe = Schema.SObjectType.*Name of sObject*

 

 

 

 

 

 

code part:

 

 

Map<String,PropertyType> SelectedItems = new Map<String,PropertyType>();

for(oneProperty oneProp : DisplaiedProperties)
{           System.Debug('_____________________'+oneProp.PropertyValue+'_______________'+oneProp.PType);
SelectedItems.put(oneProp.PropertyValue,oneProp.PType);
}


for(string b:SelectedItems.keySet())
{
System.Debug('_____________________'+b+'_______________'+SelectedItems.get(b));
}

 

and part of debug log:

 

9:58:31.506|USER_DEBUG|[461,4]|DEBUG|_____________________Name_______________TheString
9:58:31.506|METHOD_EXIT|[461,4]|System.Debug(String)
9:58:31.506|METHOD_ENTRY|[462,4]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.put(String, Select_Filtered_Popup_controller.PropertyType)
9:58:31.506|METHOD_EXIT|[462,4]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.put(String, Select_Filtered_Popup_controller.PropertyType)
9:58:31.506|METHOD_ENTRY|[461,4]|System.Debug(String)
9:58:31.507|USER_DEBUG|[461,4]|DEBUG|_____________________Phone_______________TheString
9:58:31.507|METHOD_EXIT|[461,4]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[462,4]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.put(String, Select_Filtered_Popup_controller.PropertyType)
9:58:31.507|METHOD_EXIT|[462,4]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.put(String, Select_Filtered_Popup_controller.PropertyType)
9:58:31.507|METHOD_ENTRY|[461,4]|System.Debug(String)
9:58:31.507|USER_DEBUG|[461,4]|DEBUG|_____________________BillingCountry_______________TheString
9:58:31.507|METHOD_EXIT|[461,4]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[462,4]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.put(String, Select_Filtered_Popup_controller.PropertyType)
9:58:31.507|METHOD_EXIT|[462,4]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.put(String, Select_Filtered_Popup_controller.PropertyType)
9:58:31.507|METHOD_ENTRY|[467,16]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.keySet()
9:58:31.507|METHOD_EXIT|[467,16]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.keySet()
9:58:31.507|METHOD_ENTRY|[469,6]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[469,63]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.get(String)
9:58:31.507|METHOD_EXIT|[469,63]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.get(String)
9:58:31.507|USER_DEBUG|[469,6]|DEBUG|_____________________Name_______________TheString
9:58:31.507|METHOD_EXIT|[469,6]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[469,6]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[469,63]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.get(String)
9:58:31.507|METHOD_EXIT|[469,63]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.get(String)
9:58:31.507|USER_DEBUG|[469,6]|DEBUG|_____________________BillingCountry_______________TheString
9:58:31.507|METHOD_EXIT|[469,6]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[469,6]|System.Debug(String)
9:58:31.507|METHOD_ENTRY|[469,63]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.get(String)
9:58:31.507|METHOD_EXIT|[469,63]|MAP<String,Select_Filtered_Popup_controller.PropertyType>.get(String)
9:58:31.507|USER_DEBUG|[469,6]|DEBUG|_____________________Phone_______________TheString

 

 

 

 

How can i simply walk throught the Map in right direction???

Hello, i was trying to include static resources on my page with tags <apex:includeScript> and <apex:stylesheet>.

 

I used URLFOR to map the right path to resources.

So i wrote code:

<apex:includeScript value="{!URLFOR($Resource.all_res, '/js/json2.js')}" />

and like this.

 

As a result script wasn't included, and in the firebug debug window wrote this text:

 

"Failed to load source for: https://c.na7.visual.force.com/resource/1279700783000/all_res/js/json2.js"

 

I looked to "https://c.na7.visual.force.com/resource/1279700783000/all_res" in browser and it is really my static resource. After that i looks to "https://c.na7.visual.force.com/resource/1279700783000/all_res/js/json2.js" and find an empty page there. How it possible? Where i miss? And how can i include my recources?

At the first i am sorry about my English, but there are no resources except this to solve the problem with apex coding.

 

So I'll try to explain problem.

 

I need to make the part of code that would delete accounts which names have already written by user;

And of course I need to catch possible exceptions, so i try to use


List<Database.DeleteResult> deleteResults  = Database.delete(DeleteIdList);

 

and after that try to process List of deleteResults in the loop and check errors.

 

But it isn't work like i want. When record couldn't deleted generated DMLException.  Why? I didn't use any DML, i only used database method.

 

Will be thankfull for any ideas.