-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
4Questions
-
10Replies
unable to update custome setting from force.com sites
Ok i give up and need some help....
I have pageRefrenece method that needs to generate a list of strings for the search auto complete to use, based on search params and cache time. (This is all using force.com sites) So when the user goes to search i first check to see if any of the params have changed by comparing them to a saved custom setting that holds the last searched data. If its a new search or one of the params have changed, the method updates the list of strings accordingly and then updates the custom setting with the new search params... this is where it is failing.
As a part of trouble shooting i took the block of code and put it in the Execute Anonymous and ran it with more system.debug lines to see why it might be failing.... but no error this time. In the system logs for the page, when i run it i see the error System.LimitException: DML currently not allowed as shown below:
16:06:07.604 (2914726000)|STATEMENT_EXECUTE|[482]|Try
16:06:07.604 (2914754000)|STATEMENT_EXECUTE|[482]|Block with 2 statements
16:06:07.604 (2914795000)|STATEMENT_EXECUTE|[483]|database.update(SOBJECT:SelfServiceSettings__c)
16:06:07.604 (2915155000)|METHOD_ENTRY|[483]|Database.update(SObject)
16:06:07.604 (2915213000)|HEAP_ALLOCATE|[483]|Bytes:8
16:06:07.604 (2915246000)|DML_BEGIN|[483]|Op:Update|Type:SelfServiceSettings__c|Rows:1
16:06:07.604 (2915291000)|EXCEPTION_THROWN|[483]|System.LimitException: DML currently not allowed
16:06:07.604 (2915384000)|METHOD_EXIT|[483]|Database.update(SObject)
16:06:07.605 (2915453000)|METHOD_EXIT|[493]|SelfServiceTemplateCon.titleSearch()
16:06:07.605 (2915490000)|SYSTEM_MODE_EXIT|APEX_SHARING_HONORED
but when i run the block in the Execute Anonymous the logs dont show the same error:
15:58:57.903 (129162000)|STATEMENT_EXECUTE|[27]|Try
15:58:57.903 (129190000)|STATEMENT_EXECUTE|[27]|Block with 2 statements
15:58:57.903 (129240000)|STATEMENT_EXECUTE|[28]|database.update(SOBJECT:SelfServiceSettings__c)
15:58:57.903 (129275000)|METHOD_ENTRY|[28]|Database.update(SObject)
15:58:57.903 (129344000)|HEAP_ALLOCATE|[28]|Bytes:8
15:58:57.904 (129386000)|DML_BEGIN|[28]|Op:Update|Type:SelfServiceSettings__c|Rows:1
15:58:57.904 (129529000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
15:58:57.930 (156215000)|DML_END|[28]
15:58:57.930 (156272000)|METHOD_EXIT|[28]|Database.update(SObject)
15:58:57.930 (156324000)|STATEMENT_EXECUTE|[29]|system.debug(String)
I thought the issue might be the 'with sharing' i had on the class but it still failed even when i removed that...
here is the code....
string lang = 'en';
string prod = 'lmipro2';
list<string> titleListToShow = new List<string>();
List<string> doctypes = new List<string>();
//normally more than one added to list but for testing lets just deal with one
doctypes.add('Video__kav');
if(selfservicehelperclass.seeIfNewListIsNeeded(doctypes, lang, prod) || titleListToShow == null){
titleListToShow = selfservicehelperclass.getAllTitleLists(doctypes, lang, prod);
system.debug('\n\n in titleSearch titleListToShow: ' + titleListToShow + '\n\n ');
string dcToSave;
for(string stype: doctypes){
if(selfservicehelperclass.CheckForNullString(dcToSave)){
dcToSave = dcToSave + ',' + stype;
}else{
dcToSave = stype;
}
}
system.debug('\n\n in titleSearch dcToSave: ' + dcToSave + '\n\n ');
SelfServiceSettings__c selfSerSet = SelfServiceSettings__c.getOrgDefaults();
system.debug('\n\n in titleSearch selfSerSet before update: ' + selfSerSet + '\n\n ');
selfSerSet.LastTitleSearch__c = datetime.now();
selfSerSet.docTypesSearched__c = dcToSave;
try{
database.update(selfSerSet);
system.debug('\n\n in titleSearch sss: ' + selfSerSet + '\n\n ');
}catch(exception e){
system.debug('\n\n in titleSearch e: ' + e + '\n\n ');
}
}
- TankGirl
- November 10, 2010
- Like
- 0
Issue with Apex:outputlink and forced click
Problem:
I have a search field in the case view that needs to search and redirect to a 'full search' page when a users hits enter in the field.
The enter part isn't an issue, the issue is that since this is inside the case layout page, I can not use a commandbutton/ commandlink since if I do it would redirect to the page but it will show inline=1 in the URL and thus treat it as an inline page and hide the header/sidebar. If I use the output link it will go to the page and not add inline=1 in the URL and show the header. BUT if I use the outputlink, when I force a click on the button, it performs the method, but not the redirect, so it just sits there.
In my method I put in system.debug and watched the system log, it showed that it did reach the method and did what was in it, but once it got to the return part with the new page reference, it just didn't do it. If I were to physically click the button instead of having the event listener do a jQuery .click() it will refresh to the new page.
To make sure it was nothing on the page that was wrong, or to see if it was just an outputlink, I did a test page with just simple methods and nothing in it but the required for testing. First i tested the commandlink/commandbutton:
<apex:page controller="LinkOnClickCon"> <apex:includeScript value="{!URLFOR($Resource.knowledgeTicket, '/jquery-1.4.2.min.js')}"/> <script type="text/javascript" language="JavaScript"> jQuery.noConflict(); jQuery(document).ready(function() { jQuery('.searchtoolstextbox').keypress(function(e) { code = e.keyCode ? e.keyCode : e.which; //alert(code.toString()); if (code.toString() == 13){ e.preventDefault(); if(jQuery('.searchtoolstextbox').val().length >= 3){ jQuery('.fullsearchbutton').click(); } } }); }); </script> <apex:form id="form"> <apex:inputText id="kbsearchtext" value="{!userkeywords}" styleClass="searchtoolstextbox" /> <apex:actionRegion id="FullSearchActionRegion"> <apex:commandlink id="btnFullSearch1" styleClass="btn fullsearchbutton" action="{!getactionTwo}" onclick="alert('I was clicked');" value="Full Search"> <apex:actionSupport event="onClick" action="{!getactionTwo}" status="workstatus" /> </apex:commandlink> </apex:actionRegion> <apex:actionStatus id="workstatus" startText="working..." stopText="" /> </apex:form> </apex:page>
and controller:
public with sharing class LinkOnClickCon { public string userkeywords{get; set;} Public pagereference getactionTwo(){ system.debug('\n ACTION Two METHOD userkeywords: '+userkeywords+'\n The enter key was clicked and so this should now be called.'); string kywrds = userKeywords; if(kywrds == NULL || kywrds == ''){kywrds = 'keyword';} kywrds = EncodingUtil.urlEncode(kywrds, 'UTF-8'); system.debug('\n\n METHOD getactionTwo() - keywords: ' + kywrds + '\n \n'); PageReference ref = new PageReference('/apex/knowledge?keywords=' + kywrds ); system.debug('\n\n METHOD getactionTwo() - pageRef: ' + ref.getUrl() + '\n \n'); ref.setRedirect(true); return ref; } }
With the commandlink/command button it works, it redirects to the new page (but like I said earlier, if I use this in the case layout it will redirect with a URL pram of inline=1 witch is bad).
The system log:
19.0 APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;VALIDATION,INFO;WORKFLOW,INFO 11:51:36.499 (18334000)|EXECUTION_STARTED 11:51:36.499 (18404000)|CODE_UNIT_STARTED|[EXTERNAL]|066Q00000008nD9|VF: /apex/linkonclick 11:51:36.499 (18701000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|LinkOnClickCon get(userkeywords) 11:51:36.499 (18733000)|SYSTEM_MODE_ENTER|APEX_FULL 11:51:36.500 (19058000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|userkeywords 11:51:36.500 (19090000)|CODE_UNIT_FINISHED|userkeywords 11:51:36.500 (19126000)|CODE_UNIT_FINISHED|LinkOnClickCon get(userkeywords) 11:51:36.501 (20273000)|CODE_UNIT_STARTED|[EXTERNAL]|LinkOnClickCon set(userkeywords,offline) 11:51:36.501 (20308000)|SYSTEM_MODE_ENTER|APEX_FULL 11:51:36.501 (20603000)|CODE_UNIT_STARTED|[EXTERNAL]|LinkOnClickCon set(userkeywords,offline) 11:51:36.501 (20648000)|METHOD_ENTRY|[1]|01pQ0000000DK56|LinkOnClickCon.LinkOnClickCon() 11:51:36.501 (20687000)|STATEMENT_EXECUTE|[1]|Static initialization: LinkOnClickCon 11:51:36.501 (20716000)|SYSTEM_MODE_ENTER|APEX_SHARING_HONORED 11:51:36.501 (20755000)|STATEMENT_EXECUTE|[1]|ThisBlock with 1 statement 11:51:36.501 (20787000)|SYSTEM_MODE_EXIT|APEX_SHARING_HONORED 11:51:36.501 (20812000)|METHOD_EXIT|[1]|LinkOnClickCon 11:51:36.501 (20856000)|CODE_UNIT_FINISHED|LinkOnClickCon set(userkeywords,offline) 11:51:36.501 (20883000)|CODE_UNIT_FINISHED|LinkOnClickCon set(userkeywords,offline) 11:51:36.502 (21653000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|LinkOnClickCon invoke(getactionTwo) 11:51:36.502 (21758000)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this|{"userkeywords":"offline"}|0x1efb058 11:51:36.502 (21795000)|SYSTEM_MODE_ENTER|APEX_SHARING_HONORED 11:51:36.502 (21828000)|STATEMENT_EXECUTE|[5]|Block with 9 statements 11:51:36.502 (21888000)|STATEMENT_EXECUTE|[6]|system.debug(String) 11:51:36.502 (21924000)|METHOD_ENTRY|[6]|System.debug(ANY) 11:51:36.502 (21969000)|HEAP_ALLOCATE|[6]|Bytes:41 11:51:36.503 (22010000)|HEAP_ALLOCATE|[6]|Bytes:102 11:51:36.503 (22039000)|USER_DEBUG|[6]|DEBUG| ACTION Two METHOD userkeywords: offline The enter key was clicked and so this should now be called. 11:51:36.503 (22072000)|METHOD_EXIT|[6]|System.debug(ANY) 11:51:36.503 (22127000)|STATEMENT_EXECUTE|[7]|DeclareVar: String kywrds 11:51:36.503 (22157000)|VARIABLE_SCOPE_BEGIN|[7]|kywrds|String|false 11:51:36.503 (22201000)|VARIABLE_ASSIGNMENT|[7]|kywrds|"offline" 11:51:36.503 (22232000)|VARIABLE_ASSIGNMENT|[7]|kywrds|"offline" 11:51:36.503 (22264000)|STATEMENT_EXECUTE|[8]|Condition 11:51:36.503 (22377000)|STATEMENT_EXECUTE|[8]|Condition 11:51:36.503 (22432000)|STATEMENT_EXECUTE|[9]|String kywrds <= MethodInvocation 11:51:36.503 (22476000)|METHOD_ENTRY|[9]|system.EncodingUtil.urlEncode(String, String) 11:51:36.503 (22524000)|STATEMENT_EXECUTE|[1]|Static initialization: system.EncodingUtil 11:51:36.503 (22571000)|STATEMENT_EXECUTE|[1]|ThisBlock with 1 statement 11:51:36.503 (22607000)|VARIABLE_SCOPE_BEGIN|[9]|s|String|false 11:51:36.503 (22648000)|VARIABLE_ASSIGNMENT|[9]|s|"offline" 11:51:36.503 (22675000)|VARIABLE_SCOPE_BEGIN|[9]|enc|String|false 11:51:36.503 (22711000)|VARIABLE_ASSIGNMENT|[9]|enc|"UTF-8" 11:51:36.503 (22859000)|METHOD_EXIT|[9]|system.EncodingUtil.urlEncode(String, String) 11:51:36.503 (22899000)|VARIABLE_ASSIGNMENT|[9]|kywrds|"offline" 11:51:36.503 (22929000)|VARIABLE_ASSIGNMENT|[9]|kywrds|"offline" 11:51:36.503 (22978000)|STATEMENT_EXECUTE|[10]|system.debug(String) 11:51:36.504 (23023000)|METHOD_ENTRY|[10]|System.debug(ANY) 11:51:36.504 (23060000)|HEAP_ALLOCATE|[10]|Bytes:44 11:51:36.504 (23089000)|HEAP_ALLOCATE|[10]|Bytes:47 11:51:36.504 (23115000)|USER_DEBUG|[10]|DEBUG| METHOD getactionTwo() - keywords: offline 11:51:36.504 (23145000)|METHOD_EXIT|[10]|System.debug(ANY) 11:51:36.504 (23197000)|STATEMENT_EXECUTE|[11]|DeclareVar: System.PageReference ref 11:51:36.504 (23226000)|VARIABLE_SCOPE_BEGIN|[11]|ref|PageReference|true 11:51:36.504 (23267000)|HEAP_ALLOCATE|[11]|Bytes:32 11:51:36.504 (23358000)|HEAP_ALLOCATE|[11]|Bytes:38 11:51:36.504 (23432000)|STATEMENT_EXECUTE|[12]|system.debug(String) 11:51:36.504 (23465000)|METHOD_ENTRY|[12]|System.debug(ANY) 11:51:36.504 (23503000)|METHOD_ENTRY|[12]|System.PageReference.getUrl() 11:51:36.504 (23558000)|METHOD_EXIT|[12]|System.PageReference.getUrl() 11:51:36.504 (23587000)|HEAP_ALLOCATE|[12]|Bytes:68 11:51:36.504 (23615000)|HEAP_ALLOCATE|[12]|Bytes:71 11:51:36.504 (23641000)|USER_DEBUG|[12]|DEBUG| METHOD getactionTwo() - pageRef: /apex/knowledge?keywords=offline 11:51:36.504 (23671000)|METHOD_EXIT|[12]|System.debug(ANY) 11:51:36.504 (23720000)|STATEMENT_EXECUTE|[13]|System.PageReference.setRedirect(Boolean) 11:51:36.504 (23754000)|METHOD_ENTRY|[13]|System.PageReference.setRedirect(Boolean) 11:51:36.504 (23791000)|METHOD_EXIT|[13]|System.PageReference.setRedirect(Boolean) 11:51:36.504 (23829000)|STATEMENT_EXECUTE|[14]|Return 11:51:36.504 (23871000)|SYSTEM_MODE_EXIT|APEX_SHARING_HONORED 11:51:36.504 (23923000)|CODE_UNIT_FINISHED|LinkOnClickCon invoke(getactionTwo) 11:51:36.504 (23999000)|VF_APEX_CALL|btnFullSearch1|{!getactionTwo}|PageReference:/apex/knowledge?keywords=offline 11:51:36.505|CUMULATIVE_LIMIT_USAGE 11:51:36.505|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 0 out of 100 Number of query rows: 0 out of 10000 Number of SOSL queries: 0 out of 20 Number of DML statements: 0 out of 100 Number of DML rows: 0 out of 10000 Number of script statements: 9 out of 200000 Maximum heap size: 0 out of 3000000 Number of callouts: 0 out of 10 Number of Email Invocations: 0 out of 10 Number of fields describes: 0 out of 100 Number of record type describes: 0 out of 100 Number of child relationships describes: 0 out of 100 Number of picklist describes: 0 out of 100 Number of future calls: 0 out of 10 Number of find similar calls: 0 out of 10 Number of System.runAs() invocations: 0 out of 20 11:51:36.505|CUMULATIVE_LIMIT_USAGE_END 11:51:36.505 (24720000)|CODE_UNIT_FINISHED|VF: /apex/linkonclick 11:51:36.505 (24746000)|EXECUTION_FINISHED
But if I switch the page to use a outputlink instead:
<apex:form id="form"> <apex:inputText id="kbsearchtext" value="{!userkeywords}" styleClass="searchtoolstextbox" /> <apex:actionRegion id="FullSearchActionRegion"> <apex:outputlink id="btnFullSearch1" styleClass="btn fullsearchbutton" value="{!actionTwo}" onclick="alert('I was clicked');" > Full Search <apex:actionSupport event="onClick" action="{!getactionTwo}" status="workstatus" /> </apex:outputlink> </apex:actionRegion> <apex:actionStatus id="workstatus" startText="working..." stopText="" /> </apex:form>
And I hit enter in the field, nothing happens, it wont even see the string from the users input.
here is the system log:
19.0 APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;VALIDATION,INFO;WORKFLOW,INFO 12:10:46.852 (23228000)|EXECUTION_STARTED 12:10:46.852 (23314000)|CODE_UNIT_STARTED|[EXTERNAL]|066Q00000008nD9|VF: /apex/linkonclick 12:10:46.853 (23528000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|LinkOnClickCon <init> 12:10:46.853 (23563000)|SYSTEM_MODE_ENTER|APEX_FULL 12:10:46.853 (23676000)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this|{}|0x663ab9 12:10:46.853 (23716000)|STATEMENT_EXECUTE|[1]|Instance initialization: LinkOnClickCon 12:10:46.853 (23737000)|SYSTEM_MODE_ENTER|APEX_SHARING_HONORED 12:10:46.853 (23796000)|STATEMENT_EXECUTE|[3]|DeclarePropertyAccessor: public String userkeywords { get; set; } 12:10:46.853 (23821000)|VARIABLE_SCOPE_BEGIN|[3]|userkeywords|String|false 12:10:46.853 (23842000)|SYSTEM_MODE_EXIT|APEX_SHARING_HONORED 12:10:46.853 (23861000)|CODE_UNIT_FINISHED|LinkOnClickCon <init> 12:10:46.885 (55535000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|LinkOnClickCon get(userkeywords) 12:10:46.885 (55570000)|SYSTEM_MODE_ENTER|APEX_FULL 12:10:46.885 (55720000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|userkeywords 12:10:46.885 (55744000)|CODE_UNIT_FINISHED|userkeywords 12:10:46.885 (55766000)|CODE_UNIT_FINISHED|LinkOnClickCon get(userkeywords) 12:10:46.885 (56145000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|LinkOnClickCon get(actionTwo) 12:10:46.885 (56171000)|SYSTEM_MODE_ENTER|APEX_FULL 12:10:46.886 (56736000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|LinkOnClickCon invoke(getactionTwo) 12:10:46.886 (56798000)|STATEMENT_EXECUTE|[1]|Static initialization: LinkOnClickCon 12:10:46.886 (56826000)|SYSTEM_MODE_ENTER|APEX_SHARING_HONORED 12:10:46.886 (56857000)|STATEMENT_EXECUTE|[1]|ThisBlock with 1 statement 12:10:46.886 (56882000)|SYSTEM_MODE_EXIT|APEX_SHARING_HONORED 12:10:46.886 (56942000)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this|{}|0x663ab9 12:10:46.886 (56969000)|SYSTEM_MODE_ENTER|APEX_SHARING_HONORED 12:10:46.886 (56996000)|STATEMENT_EXECUTE|[5]|Block with 9 statements 12:10:46.886 (57043000)|STATEMENT_EXECUTE|[6]|system.debug(String) 12:10:46.886 (57073000)|METHOD_ENTRY|[6]|System.debug(ANY) 12:10:46.886 (57113000)|HEAP_ALLOCATE|[6]|Bytes:38 12:10:46.886 (57135000)|HEAP_ALLOCATE|[6]|Bytes:99 12:10:46.886 (57152000)|USER_DEBUG|[6]|DEBUG| ACTION Two METHOD userkeywords: null The enter key was clicked and so this should now be called. 12:10:46.886 (57173000)|METHOD_EXIT|[6]|System.debug(ANY) 12:10:46.886 (57215000)|STATEMENT_EXECUTE|[7]|DeclareVar: String kywrds 12:10:46.886 (57237000)|VARIABLE_SCOPE_BEGIN|[7]|kywrds|String|false 12:10:46.886 (57274000)|VARIABLE_ASSIGNMENT|[7]|kywrds|null 12:10:46.886 (57294000)|VARIABLE_ASSIGNMENT|[7]|kywrds|null 12:10:46.886 (57320000)|STATEMENT_EXECUTE|[8]|Condition 12:10:46.886 (57398000)|STATEMENT_EXECUTE|[8]|Block with 1 statement 12:10:46.887 (57452000)|STATEMENT_EXECUTE|[8]|String kywrds <= Literal 12:10:46.887 (57492000)|VARIABLE_ASSIGNMENT|[8]|kywrds|"keyword" 12:10:46.887 (57515000)|VARIABLE_ASSIGNMENT|[8]|kywrds|"keyword" 12:10:46.887 (57556000)|STATEMENT_EXECUTE|[9]|String kywrds <= MethodInvocation 12:10:46.887 (57592000)|METHOD_ENTRY|[9]|system.EncodingUtil.urlEncode(String, String) 12:10:46.887 (57628000)|STATEMENT_EXECUTE|[1]|Static initialization: system.EncodingUtil 12:10:46.887 (57659000)|STATEMENT_EXECUTE|[1]|ThisBlock with 1 statement 12:10:46.887 (57687000)|VARIABLE_SCOPE_BEGIN|[9]|s|String|false 12:10:46.887 (57720000)|VARIABLE_ASSIGNMENT|[9]|s|"keyword" 12:10:46.887 (57740000)|VARIABLE_SCOPE_BEGIN|[9]|enc|String|false 12:10:46.887 (57768000)|VARIABLE_ASSIGNMENT|[9]|enc|"UTF-8" 12:10:46.887 (57896000)|METHOD_EXIT|[9]|system.EncodingUtil.urlEncode(String, String) 12:10:46.887 (57928000)|VARIABLE_ASSIGNMENT|[9]|kywrds|"keyword" 12:10:46.887 (57951000)|VARIABLE_ASSIGNMENT|[9]|kywrds|"keyword" 12:10:46.887 (57988000)|STATEMENT_EXECUTE|[10]|system.debug(String) 12:10:46.887 (58011000)|METHOD_ENTRY|[10]|System.debug(ANY) 12:10:46.887 (58041000)|HEAP_ALLOCATE|[10]|Bytes:44 12:10:46.887 (58064000)|HEAP_ALLOCATE|[10]|Bytes:47 12:10:46.887 (58081000)|USER_DEBUG|[10]|DEBUG| METHOD getactionTwo() - keywords: keyword 12:10:46.887 (58102000)|METHOD_EXIT|[10]|System.debug(ANY) 12:10:46.887 (58142000)|STATEMENT_EXECUTE|[11]|DeclareVar: System.PageReference ref 12:10:46.887 (58164000)|VARIABLE_SCOPE_BEGIN|[11]|ref|PageReference|true 12:10:46.887 (58197000)|HEAP_ALLOCATE|[11]|Bytes:32 12:10:46.887 (58276000)|HEAP_ALLOCATE|[11]|Bytes:38 12:10:46.887 (58334000)|STATEMENT_EXECUTE|[12]|system.debug(String) 12:10:46.887 (58358000)|METHOD_ENTRY|[12]|System.debug(ANY) 12:10:46.887 (58386000)|METHOD_ENTRY|[12]|System.PageReference.getUrl() 12:10:46.888 (58436000)|METHOD_EXIT|[12]|System.PageReference.getUrl() 12:10:46.888 (58460000)|HEAP_ALLOCATE|[12]|Bytes:68 12:10:46.888 (58483000)|HEAP_ALLOCATE|[12]|Bytes:71 12:10:46.888 (58500000)|USER_DEBUG|[12]|DEBUG| METHOD getactionTwo() - pageRef: /apex/knowledge?keywords=keyword 12:10:46.888 (58521000)|METHOD_EXIT|[12]|System.debug(ANY) 12:10:46.888 (58557000)|STATEMENT_EXECUTE|[13]|System.PageReference.setRedirect(Boolean) 12:10:46.888 (58582000)|METHOD_ENTRY|[13]|System.PageReference.setRedirect(Boolean) 12:10:46.888 (58611000)|METHOD_EXIT|[13]|System.PageReference.setRedirect(Boolean) 12:10:46.888 (58641000)|STATEMENT_EXECUTE|[14]|Return 12:10:46.888 (58674000)|SYSTEM_MODE_EXIT|APEX_SHARING_HONORED 12:10:46.888 (58697000)|CODE_UNIT_FINISHED|LinkOnClickCon invoke(getactionTwo) 12:10:46.888 (58726000)|CODE_UNIT_FINISHED|LinkOnClickCon get(actionTwo) 12:10:46.899|CUMULATIVE_LIMIT_USAGE 12:10:46.899|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 0 out of 100 Number of query rows: 0 out of 10000 Number of SOSL queries: 0 out of 20 Number of DML statements: 0 out of 100 Number of DML rows: 0 out of 10000 Number of script statements: 10 out of 200000 Maximum heap size: 0 out of 3000000 Number of callouts: 0 out of 10 Number of Email Invocations: 0 out of 10 Number of fields describes: 0 out of 100 Number of record type describes: 0 out of 100 Number of child relationships describes: 0 out of 100 Number of picklist describes: 0 out of 100 Number of future calls: 0 out of 10 Number of find similar calls: 0 out of 10 Number of System.runAs() invocations: 0 out of 20 12:10:46.899|CUMULATIVE_LIMIT_USAGE_END 12:10:46.899 (69855000)|CODE_UNIT_FINISHED|VF: /apex/linkonclick 12:10:46.899 (69877000)|EXECUTION_FINISHED
But when I physically click the button it works, redirects to the correct page, and see's the users input text.
So is this a bug with salesforce?
- TankGirl
- October 18, 2010
- Like
- 0
Taking the developer certification test and have questions...
I am not, how you would say, a normal learner... And am nervous about the upcoming test, anyone take it before? What is there to expect, like should I be trying to memorize terms of Some sort? I hope the test is just to build an app and not written cause I am really bad at explaining in words what I am would need to do, vs just doing it.... do they have a dyslexic version of the test? LOL?
I do have a copy of the both dev 401 and dev 501 work books but they seem kinda of lacking in content. like its only the slide show that a techer would use and not the text they would say... i dont know if that makes sence...
IDK i just really want to do well on the test and want to know what i sould expect/study.....
Thanks!
- TankGirl
- October 12, 2010
- Like
- 0
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY issue
I created an escalation form and in it there is the ability to attach files it uses a custom controller and VF page. This works fine for all of our onsite users (users that don't need to authenticate / do the challenge user email), all profiles, they can attach files to the form/case without any issues. But 2 of our user profiles, if they are offsite, get this error when trying to attach files:
System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
and i looked up the error:
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY
An operation affects an object that is cross-referenced by the specified object, but the logged-in user does not have sufficient permissions on the cross-referenced object. For example, if the logged-in user attempts to modify an account record, that user might not have permission to approve, reject, or reassign a ProcessInstanceWorkitem that is submitted after that action.
But like I said these same users/user profiles ARE able to attach files through my form when logging in 'onsite'.I tried to compare the the the difference between the profiles but since there is no easy way to do that its going to take me a while.
Does anyone know what permissions/security could be affecting this?
- TankGirl
- July 22, 2010
- Like
- 0
unable to update custome setting from force.com sites
Ok i give up and need some help....
I have pageRefrenece method that needs to generate a list of strings for the search auto complete to use, based on search params and cache time. (This is all using force.com sites) So when the user goes to search i first check to see if any of the params have changed by comparing them to a saved custom setting that holds the last searched data. If its a new search or one of the params have changed, the method updates the list of strings accordingly and then updates the custom setting with the new search params... this is where it is failing.
As a part of trouble shooting i took the block of code and put it in the Execute Anonymous and ran it with more system.debug lines to see why it might be failing.... but no error this time. In the system logs for the page, when i run it i see the error System.LimitException: DML currently not allowed as shown below:
16:06:07.604 (2914726000)|STATEMENT_EXECUTE|[482]|Try
16:06:07.604 (2914754000)|STATEMENT_EXECUTE|[482]|Block with 2 statements
16:06:07.604 (2914795000)|STATEMENT_EXECUTE|[483]|database.update(SOBJECT:SelfServiceSettings__c)
16:06:07.604 (2915155000)|METHOD_ENTRY|[483]|Database.update(SObject)
16:06:07.604 (2915213000)|HEAP_ALLOCATE|[483]|Bytes:8
16:06:07.604 (2915246000)|DML_BEGIN|[483]|Op:Update|Type:SelfServiceSettings__c|Rows:1
16:06:07.604 (2915291000)|EXCEPTION_THROWN|[483]|System.LimitException: DML currently not allowed
16:06:07.604 (2915384000)|METHOD_EXIT|[483]|Database.update(SObject)
16:06:07.605 (2915453000)|METHOD_EXIT|[493]|SelfServiceTemplateCon.titleSearch()
16:06:07.605 (2915490000)|SYSTEM_MODE_EXIT|APEX_SHARING_HONORED
but when i run the block in the Execute Anonymous the logs dont show the same error:
15:58:57.903 (129162000)|STATEMENT_EXECUTE|[27]|Try
15:58:57.903 (129190000)|STATEMENT_EXECUTE|[27]|Block with 2 statements
15:58:57.903 (129240000)|STATEMENT_EXECUTE|[28]|database.update(SOBJECT:SelfServiceSettings__c)
15:58:57.903 (129275000)|METHOD_ENTRY|[28]|Database.update(SObject)
15:58:57.903 (129344000)|HEAP_ALLOCATE|[28]|Bytes:8
15:58:57.904 (129386000)|DML_BEGIN|[28]|Op:Update|Type:SelfServiceSettings__c|Rows:1
15:58:57.904 (129529000)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
15:58:57.930 (156215000)|DML_END|[28]
15:58:57.930 (156272000)|METHOD_EXIT|[28]|Database.update(SObject)
15:58:57.930 (156324000)|STATEMENT_EXECUTE|[29]|system.debug(String)
I thought the issue might be the 'with sharing' i had on the class but it still failed even when i removed that...
here is the code....
string lang = 'en';
string prod = 'lmipro2';
list<string> titleListToShow = new List<string>();
List<string> doctypes = new List<string>();
//normally more than one added to list but for testing lets just deal with one
doctypes.add('Video__kav');
if(selfservicehelperclass.seeIfNewListIsNeeded(doctypes, lang, prod) || titleListToShow == null){
titleListToShow = selfservicehelperclass.getAllTitleLists(doctypes, lang, prod);
system.debug('\n\n in titleSearch titleListToShow: ' + titleListToShow + '\n\n ');
string dcToSave;
for(string stype: doctypes){
if(selfservicehelperclass.CheckForNullString(dcToSave)){
dcToSave = dcToSave + ',' + stype;
}else{
dcToSave = stype;
}
}
system.debug('\n\n in titleSearch dcToSave: ' + dcToSave + '\n\n ');
SelfServiceSettings__c selfSerSet = SelfServiceSettings__c.getOrgDefaults();
system.debug('\n\n in titleSearch selfSerSet before update: ' + selfSerSet + '\n\n ');
selfSerSet.LastTitleSearch__c = datetime.now();
selfSerSet.docTypesSearched__c = dcToSave;
try{
database.update(selfSerSet);
system.debug('\n\n in titleSearch sss: ' + selfSerSet + '\n\n ');
}catch(exception e){
system.debug('\n\n in titleSearch e: ' + e + '\n\n ');
}
}
- TankGirl
- November 10, 2010
- Like
- 0
Issue with Apex:outputlink and forced click
Problem:
I have a search field in the case view that needs to search and redirect to a 'full search' page when a users hits enter in the field.
The enter part isn't an issue, the issue is that since this is inside the case layout page, I can not use a commandbutton/ commandlink since if I do it would redirect to the page but it will show inline=1 in the URL and thus treat it as an inline page and hide the header/sidebar. If I use the output link it will go to the page and not add inline=1 in the URL and show the header. BUT if I use the outputlink, when I force a click on the button, it performs the method, but not the redirect, so it just sits there.
In my method I put in system.debug and watched the system log, it showed that it did reach the method and did what was in it, but once it got to the return part with the new page reference, it just didn't do it. If I were to physically click the button instead of having the event listener do a jQuery .click() it will refresh to the new page.
To make sure it was nothing on the page that was wrong, or to see if it was just an outputlink, I did a test page with just simple methods and nothing in it but the required for testing. First i tested the commandlink/commandbutton:
<apex:page controller="LinkOnClickCon"> <apex:includeScript value="{!URLFOR($Resource.knowledgeTicket, '/jquery-1.4.2.min.js')}"/> <script type="text/javascript" language="JavaScript"> jQuery.noConflict(); jQuery(document).ready(function() { jQuery('.searchtoolstextbox').keypress(function(e) { code = e.keyCode ? e.keyCode : e.which; //alert(code.toString()); if (code.toString() == 13){ e.preventDefault(); if(jQuery('.searchtoolstextbox').val().length >= 3){ jQuery('.fullsearchbutton').click(); } } }); }); </script> <apex:form id="form"> <apex:inputText id="kbsearchtext" value="{!userkeywords}" styleClass="searchtoolstextbox" /> <apex:actionRegion id="FullSearchActionRegion"> <apex:commandlink id="btnFullSearch1" styleClass="btn fullsearchbutton" action="{!getactionTwo}" onclick="alert('I was clicked');" value="Full Search"> <apex:actionSupport event="onClick" action="{!getactionTwo}" status="workstatus" /> </apex:commandlink> </apex:actionRegion> <apex:actionStatus id="workstatus" startText="working..." stopText="" /> </apex:form> </apex:page>
and controller:
public with sharing class LinkOnClickCon { public string userkeywords{get; set;} Public pagereference getactionTwo(){ system.debug('\n ACTION Two METHOD userkeywords: '+userkeywords+'\n The enter key was clicked and so this should now be called.'); string kywrds = userKeywords; if(kywrds == NULL || kywrds == ''){kywrds = 'keyword';} kywrds = EncodingUtil.urlEncode(kywrds, 'UTF-8'); system.debug('\n\n METHOD getactionTwo() - keywords: ' + kywrds + '\n \n'); PageReference ref = new PageReference('/apex/knowledge?keywords=' + kywrds ); system.debug('\n\n METHOD getactionTwo() - pageRef: ' + ref.getUrl() + '\n \n'); ref.setRedirect(true); return ref; } }
With the commandlink/command button it works, it redirects to the new page (but like I said earlier, if I use this in the case layout it will redirect with a URL pram of inline=1 witch is bad).
The system log:
19.0 APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;VALIDATION,INFO;WORKFLOW,INFO 11:51:36.499 (18334000)|EXECUTION_STARTED 11:51:36.499 (18404000)|CODE_UNIT_STARTED|[EXTERNAL]|066Q00000008nD9|VF: /apex/linkonclick 11:51:36.499 (18701000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|LinkOnClickCon get(userkeywords) 11:51:36.499 (18733000)|SYSTEM_MODE_ENTER|APEX_FULL 11:51:36.500 (19058000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|userkeywords 11:51:36.500 (19090000)|CODE_UNIT_FINISHED|userkeywords 11:51:36.500 (19126000)|CODE_UNIT_FINISHED|LinkOnClickCon get(userkeywords) 11:51:36.501 (20273000)|CODE_UNIT_STARTED|[EXTERNAL]|LinkOnClickCon set(userkeywords,offline) 11:51:36.501 (20308000)|SYSTEM_MODE_ENTER|APEX_FULL 11:51:36.501 (20603000)|CODE_UNIT_STARTED|[EXTERNAL]|LinkOnClickCon set(userkeywords,offline) 11:51:36.501 (20648000)|METHOD_ENTRY|[1]|01pQ0000000DK56|LinkOnClickCon.LinkOnClickCon() 11:51:36.501 (20687000)|STATEMENT_EXECUTE|[1]|Static initialization: LinkOnClickCon 11:51:36.501 (20716000)|SYSTEM_MODE_ENTER|APEX_SHARING_HONORED 11:51:36.501 (20755000)|STATEMENT_EXECUTE|[1]|ThisBlock with 1 statement 11:51:36.501 (20787000)|SYSTEM_MODE_EXIT|APEX_SHARING_HONORED 11:51:36.501 (20812000)|METHOD_EXIT|[1]|LinkOnClickCon 11:51:36.501 (20856000)|CODE_UNIT_FINISHED|LinkOnClickCon set(userkeywords,offline) 11:51:36.501 (20883000)|CODE_UNIT_FINISHED|LinkOnClickCon set(userkeywords,offline) 11:51:36.502 (21653000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|LinkOnClickCon invoke(getactionTwo) 11:51:36.502 (21758000)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this|{"userkeywords":"offline"}|0x1efb058 11:51:36.502 (21795000)|SYSTEM_MODE_ENTER|APEX_SHARING_HONORED 11:51:36.502 (21828000)|STATEMENT_EXECUTE|[5]|Block with 9 statements 11:51:36.502 (21888000)|STATEMENT_EXECUTE|[6]|system.debug(String) 11:51:36.502 (21924000)|METHOD_ENTRY|[6]|System.debug(ANY) 11:51:36.502 (21969000)|HEAP_ALLOCATE|[6]|Bytes:41 11:51:36.503 (22010000)|HEAP_ALLOCATE|[6]|Bytes:102 11:51:36.503 (22039000)|USER_DEBUG|[6]|DEBUG| ACTION Two METHOD userkeywords: offline The enter key was clicked and so this should now be called. 11:51:36.503 (22072000)|METHOD_EXIT|[6]|System.debug(ANY) 11:51:36.503 (22127000)|STATEMENT_EXECUTE|[7]|DeclareVar: String kywrds 11:51:36.503 (22157000)|VARIABLE_SCOPE_BEGIN|[7]|kywrds|String|false 11:51:36.503 (22201000)|VARIABLE_ASSIGNMENT|[7]|kywrds|"offline" 11:51:36.503 (22232000)|VARIABLE_ASSIGNMENT|[7]|kywrds|"offline" 11:51:36.503 (22264000)|STATEMENT_EXECUTE|[8]|Condition 11:51:36.503 (22377000)|STATEMENT_EXECUTE|[8]|Condition 11:51:36.503 (22432000)|STATEMENT_EXECUTE|[9]|String kywrds <= MethodInvocation 11:51:36.503 (22476000)|METHOD_ENTRY|[9]|system.EncodingUtil.urlEncode(String, String) 11:51:36.503 (22524000)|STATEMENT_EXECUTE|[1]|Static initialization: system.EncodingUtil 11:51:36.503 (22571000)|STATEMENT_EXECUTE|[1]|ThisBlock with 1 statement 11:51:36.503 (22607000)|VARIABLE_SCOPE_BEGIN|[9]|s|String|false 11:51:36.503 (22648000)|VARIABLE_ASSIGNMENT|[9]|s|"offline" 11:51:36.503 (22675000)|VARIABLE_SCOPE_BEGIN|[9]|enc|String|false 11:51:36.503 (22711000)|VARIABLE_ASSIGNMENT|[9]|enc|"UTF-8" 11:51:36.503 (22859000)|METHOD_EXIT|[9]|system.EncodingUtil.urlEncode(String, String) 11:51:36.503 (22899000)|VARIABLE_ASSIGNMENT|[9]|kywrds|"offline" 11:51:36.503 (22929000)|VARIABLE_ASSIGNMENT|[9]|kywrds|"offline" 11:51:36.503 (22978000)|STATEMENT_EXECUTE|[10]|system.debug(String) 11:51:36.504 (23023000)|METHOD_ENTRY|[10]|System.debug(ANY) 11:51:36.504 (23060000)|HEAP_ALLOCATE|[10]|Bytes:44 11:51:36.504 (23089000)|HEAP_ALLOCATE|[10]|Bytes:47 11:51:36.504 (23115000)|USER_DEBUG|[10]|DEBUG| METHOD getactionTwo() - keywords: offline 11:51:36.504 (23145000)|METHOD_EXIT|[10]|System.debug(ANY) 11:51:36.504 (23197000)|STATEMENT_EXECUTE|[11]|DeclareVar: System.PageReference ref 11:51:36.504 (23226000)|VARIABLE_SCOPE_BEGIN|[11]|ref|PageReference|true 11:51:36.504 (23267000)|HEAP_ALLOCATE|[11]|Bytes:32 11:51:36.504 (23358000)|HEAP_ALLOCATE|[11]|Bytes:38 11:51:36.504 (23432000)|STATEMENT_EXECUTE|[12]|system.debug(String) 11:51:36.504 (23465000)|METHOD_ENTRY|[12]|System.debug(ANY) 11:51:36.504 (23503000)|METHOD_ENTRY|[12]|System.PageReference.getUrl() 11:51:36.504 (23558000)|METHOD_EXIT|[12]|System.PageReference.getUrl() 11:51:36.504 (23587000)|HEAP_ALLOCATE|[12]|Bytes:68 11:51:36.504 (23615000)|HEAP_ALLOCATE|[12]|Bytes:71 11:51:36.504 (23641000)|USER_DEBUG|[12]|DEBUG| METHOD getactionTwo() - pageRef: /apex/knowledge?keywords=offline 11:51:36.504 (23671000)|METHOD_EXIT|[12]|System.debug(ANY) 11:51:36.504 (23720000)|STATEMENT_EXECUTE|[13]|System.PageReference.setRedirect(Boolean) 11:51:36.504 (23754000)|METHOD_ENTRY|[13]|System.PageReference.setRedirect(Boolean) 11:51:36.504 (23791000)|METHOD_EXIT|[13]|System.PageReference.setRedirect(Boolean) 11:51:36.504 (23829000)|STATEMENT_EXECUTE|[14]|Return 11:51:36.504 (23871000)|SYSTEM_MODE_EXIT|APEX_SHARING_HONORED 11:51:36.504 (23923000)|CODE_UNIT_FINISHED|LinkOnClickCon invoke(getactionTwo) 11:51:36.504 (23999000)|VF_APEX_CALL|btnFullSearch1|{!getactionTwo}|PageReference:/apex/knowledge?keywords=offline 11:51:36.505|CUMULATIVE_LIMIT_USAGE 11:51:36.505|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 0 out of 100 Number of query rows: 0 out of 10000 Number of SOSL queries: 0 out of 20 Number of DML statements: 0 out of 100 Number of DML rows: 0 out of 10000 Number of script statements: 9 out of 200000 Maximum heap size: 0 out of 3000000 Number of callouts: 0 out of 10 Number of Email Invocations: 0 out of 10 Number of fields describes: 0 out of 100 Number of record type describes: 0 out of 100 Number of child relationships describes: 0 out of 100 Number of picklist describes: 0 out of 100 Number of future calls: 0 out of 10 Number of find similar calls: 0 out of 10 Number of System.runAs() invocations: 0 out of 20 11:51:36.505|CUMULATIVE_LIMIT_USAGE_END 11:51:36.505 (24720000)|CODE_UNIT_FINISHED|VF: /apex/linkonclick 11:51:36.505 (24746000)|EXECUTION_FINISHED
But if I switch the page to use a outputlink instead:
<apex:form id="form"> <apex:inputText id="kbsearchtext" value="{!userkeywords}" styleClass="searchtoolstextbox" /> <apex:actionRegion id="FullSearchActionRegion"> <apex:outputlink id="btnFullSearch1" styleClass="btn fullsearchbutton" value="{!actionTwo}" onclick="alert('I was clicked');" > Full Search <apex:actionSupport event="onClick" action="{!getactionTwo}" status="workstatus" /> </apex:outputlink> </apex:actionRegion> <apex:actionStatus id="workstatus" startText="working..." stopText="" /> </apex:form>
And I hit enter in the field, nothing happens, it wont even see the string from the users input.
here is the system log:
19.0 APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;VALIDATION,INFO;WORKFLOW,INFO 12:10:46.852 (23228000)|EXECUTION_STARTED 12:10:46.852 (23314000)|CODE_UNIT_STARTED|[EXTERNAL]|066Q00000008nD9|VF: /apex/linkonclick 12:10:46.853 (23528000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|LinkOnClickCon <init> 12:10:46.853 (23563000)|SYSTEM_MODE_ENTER|APEX_FULL 12:10:46.853 (23676000)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this|{}|0x663ab9 12:10:46.853 (23716000)|STATEMENT_EXECUTE|[1]|Instance initialization: LinkOnClickCon 12:10:46.853 (23737000)|SYSTEM_MODE_ENTER|APEX_SHARING_HONORED 12:10:46.853 (23796000)|STATEMENT_EXECUTE|[3]|DeclarePropertyAccessor: public String userkeywords { get; set; } 12:10:46.853 (23821000)|VARIABLE_SCOPE_BEGIN|[3]|userkeywords|String|false 12:10:46.853 (23842000)|SYSTEM_MODE_EXIT|APEX_SHARING_HONORED 12:10:46.853 (23861000)|CODE_UNIT_FINISHED|LinkOnClickCon <init> 12:10:46.885 (55535000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|LinkOnClickCon get(userkeywords) 12:10:46.885 (55570000)|SYSTEM_MODE_ENTER|APEX_FULL 12:10:46.885 (55720000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|userkeywords 12:10:46.885 (55744000)|CODE_UNIT_FINISHED|userkeywords 12:10:46.885 (55766000)|CODE_UNIT_FINISHED|LinkOnClickCon get(userkeywords) 12:10:46.885 (56145000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|LinkOnClickCon get(actionTwo) 12:10:46.885 (56171000)|SYSTEM_MODE_ENTER|APEX_FULL 12:10:46.886 (56736000)|CODE_UNIT_STARTED|[EXTERNAL]|01pQ0000000DK56|LinkOnClickCon invoke(getactionTwo) 12:10:46.886 (56798000)|STATEMENT_EXECUTE|[1]|Static initialization: LinkOnClickCon 12:10:46.886 (56826000)|SYSTEM_MODE_ENTER|APEX_SHARING_HONORED 12:10:46.886 (56857000)|STATEMENT_EXECUTE|[1]|ThisBlock with 1 statement 12:10:46.886 (56882000)|SYSTEM_MODE_EXIT|APEX_SHARING_HONORED 12:10:46.886 (56942000)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this|{}|0x663ab9 12:10:46.886 (56969000)|SYSTEM_MODE_ENTER|APEX_SHARING_HONORED 12:10:46.886 (56996000)|STATEMENT_EXECUTE|[5]|Block with 9 statements 12:10:46.886 (57043000)|STATEMENT_EXECUTE|[6]|system.debug(String) 12:10:46.886 (57073000)|METHOD_ENTRY|[6]|System.debug(ANY) 12:10:46.886 (57113000)|HEAP_ALLOCATE|[6]|Bytes:38 12:10:46.886 (57135000)|HEAP_ALLOCATE|[6]|Bytes:99 12:10:46.886 (57152000)|USER_DEBUG|[6]|DEBUG| ACTION Two METHOD userkeywords: null The enter key was clicked and so this should now be called. 12:10:46.886 (57173000)|METHOD_EXIT|[6]|System.debug(ANY) 12:10:46.886 (57215000)|STATEMENT_EXECUTE|[7]|DeclareVar: String kywrds 12:10:46.886 (57237000)|VARIABLE_SCOPE_BEGIN|[7]|kywrds|String|false 12:10:46.886 (57274000)|VARIABLE_ASSIGNMENT|[7]|kywrds|null 12:10:46.886 (57294000)|VARIABLE_ASSIGNMENT|[7]|kywrds|null 12:10:46.886 (57320000)|STATEMENT_EXECUTE|[8]|Condition 12:10:46.886 (57398000)|STATEMENT_EXECUTE|[8]|Block with 1 statement 12:10:46.887 (57452000)|STATEMENT_EXECUTE|[8]|String kywrds <= Literal 12:10:46.887 (57492000)|VARIABLE_ASSIGNMENT|[8]|kywrds|"keyword" 12:10:46.887 (57515000)|VARIABLE_ASSIGNMENT|[8]|kywrds|"keyword" 12:10:46.887 (57556000)|STATEMENT_EXECUTE|[9]|String kywrds <= MethodInvocation 12:10:46.887 (57592000)|METHOD_ENTRY|[9]|system.EncodingUtil.urlEncode(String, String) 12:10:46.887 (57628000)|STATEMENT_EXECUTE|[1]|Static initialization: system.EncodingUtil 12:10:46.887 (57659000)|STATEMENT_EXECUTE|[1]|ThisBlock with 1 statement 12:10:46.887 (57687000)|VARIABLE_SCOPE_BEGIN|[9]|s|String|false 12:10:46.887 (57720000)|VARIABLE_ASSIGNMENT|[9]|s|"keyword" 12:10:46.887 (57740000)|VARIABLE_SCOPE_BEGIN|[9]|enc|String|false 12:10:46.887 (57768000)|VARIABLE_ASSIGNMENT|[9]|enc|"UTF-8" 12:10:46.887 (57896000)|METHOD_EXIT|[9]|system.EncodingUtil.urlEncode(String, String) 12:10:46.887 (57928000)|VARIABLE_ASSIGNMENT|[9]|kywrds|"keyword" 12:10:46.887 (57951000)|VARIABLE_ASSIGNMENT|[9]|kywrds|"keyword" 12:10:46.887 (57988000)|STATEMENT_EXECUTE|[10]|system.debug(String) 12:10:46.887 (58011000)|METHOD_ENTRY|[10]|System.debug(ANY) 12:10:46.887 (58041000)|HEAP_ALLOCATE|[10]|Bytes:44 12:10:46.887 (58064000)|HEAP_ALLOCATE|[10]|Bytes:47 12:10:46.887 (58081000)|USER_DEBUG|[10]|DEBUG| METHOD getactionTwo() - keywords: keyword 12:10:46.887 (58102000)|METHOD_EXIT|[10]|System.debug(ANY) 12:10:46.887 (58142000)|STATEMENT_EXECUTE|[11]|DeclareVar: System.PageReference ref 12:10:46.887 (58164000)|VARIABLE_SCOPE_BEGIN|[11]|ref|PageReference|true 12:10:46.887 (58197000)|HEAP_ALLOCATE|[11]|Bytes:32 12:10:46.887 (58276000)|HEAP_ALLOCATE|[11]|Bytes:38 12:10:46.887 (58334000)|STATEMENT_EXECUTE|[12]|system.debug(String) 12:10:46.887 (58358000)|METHOD_ENTRY|[12]|System.debug(ANY) 12:10:46.887 (58386000)|METHOD_ENTRY|[12]|System.PageReference.getUrl() 12:10:46.888 (58436000)|METHOD_EXIT|[12]|System.PageReference.getUrl() 12:10:46.888 (58460000)|HEAP_ALLOCATE|[12]|Bytes:68 12:10:46.888 (58483000)|HEAP_ALLOCATE|[12]|Bytes:71 12:10:46.888 (58500000)|USER_DEBUG|[12]|DEBUG| METHOD getactionTwo() - pageRef: /apex/knowledge?keywords=keyword 12:10:46.888 (58521000)|METHOD_EXIT|[12]|System.debug(ANY) 12:10:46.888 (58557000)|STATEMENT_EXECUTE|[13]|System.PageReference.setRedirect(Boolean) 12:10:46.888 (58582000)|METHOD_ENTRY|[13]|System.PageReference.setRedirect(Boolean) 12:10:46.888 (58611000)|METHOD_EXIT|[13]|System.PageReference.setRedirect(Boolean) 12:10:46.888 (58641000)|STATEMENT_EXECUTE|[14]|Return 12:10:46.888 (58674000)|SYSTEM_MODE_EXIT|APEX_SHARING_HONORED 12:10:46.888 (58697000)|CODE_UNIT_FINISHED|LinkOnClickCon invoke(getactionTwo) 12:10:46.888 (58726000)|CODE_UNIT_FINISHED|LinkOnClickCon get(actionTwo) 12:10:46.899|CUMULATIVE_LIMIT_USAGE 12:10:46.899|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 0 out of 100 Number of query rows: 0 out of 10000 Number of SOSL queries: 0 out of 20 Number of DML statements: 0 out of 100 Number of DML rows: 0 out of 10000 Number of script statements: 10 out of 200000 Maximum heap size: 0 out of 3000000 Number of callouts: 0 out of 10 Number of Email Invocations: 0 out of 10 Number of fields describes: 0 out of 100 Number of record type describes: 0 out of 100 Number of child relationships describes: 0 out of 100 Number of picklist describes: 0 out of 100 Number of future calls: 0 out of 10 Number of find similar calls: 0 out of 10 Number of System.runAs() invocations: 0 out of 20 12:10:46.899|CUMULATIVE_LIMIT_USAGE_END 12:10:46.899 (69855000)|CODE_UNIT_FINISHED|VF: /apex/linkonclick 12:10:46.899 (69877000)|EXECUTION_FINISHED
But when I physically click the button it works, redirects to the correct page, and see's the users input text.
So is this a bug with salesforce?
- TankGirl
- October 18, 2010
- Like
- 0
Using Apex to get DataCategorySelection from a specific Knowledge Article
I'm wondering if this is possible. We're basically building a bigger, better, more scalable editor interface, pretty much replacing components that don't scale (list views, filters) with our own VF, and one of the requests I got was to grab the data categories associated with the article when listing them.
Should something like this work?
Select f.Localized_Title__c, f.Id, (Select ParentId, DataCategoryGroupName, DataCategoryName From DataCategorySelections) From FAQ__kav f where PublishStatus = 'Online'
I know I'd have to iterate through the data categories in separate logic before binding to VF (or do it in an apex:repeat), but theoretically, no issues here right?
- paul-lmi
- September 28, 2010
- Like
- 0
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY issue
I created an escalation form and in it there is the ability to attach files it uses a custom controller and VF page. This works fine for all of our onsite users (users that don't need to authenticate / do the challenge user email), all profiles, they can attach files to the form/case without any issues. But 2 of our user profiles, if they are offsite, get this error when trying to attach files:
System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
and i looked up the error:
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY
An operation affects an object that is cross-referenced by the specified object, but the logged-in user does not have sufficient permissions on the cross-referenced object. For example, if the logged-in user attempts to modify an account record, that user might not have permission to approve, reject, or reassign a ProcessInstanceWorkitem that is submitted after that action.
But like I said these same users/user profiles ARE able to attach files through my form when logging in 'onsite'.I tried to compare the the the difference between the profiles but since there is no easy way to do that its going to take me a while.
Does anyone know what permissions/security could be affecting this?
- TankGirl
- July 22, 2010
- Like
- 0
Filtering Knowledge using 'with data category' and strings
I am trying to pass a string representing a data category to a controller and then filter my SOQL query for knowledge based on that.
Ideally I would like to do something like:
public String release { get; set; }
public List<FAQ__kav> getFAQsForRelease()
{
List<FAQ__kav> faqlist = [select id, Title, Answer__c from FAQ__kav WHERE PublishStatus = 'Online' WITH DATA CATEGORY Releases__c ABOVE release];
return faqlist;
}
but I can't figure out if there is any possible way to convert the string object 'release' into an datacategory type. Maybe a helper function or something?
I realize a big block of if / else if statements would do the trick, but I am hoping there is a cleaner solution. Thanks in advance.
- gbabey
- April 20, 2010
- Like
- 0
VF page displayed without sidebar and header
Hi,
I have a VF page that displays details for custom object.
This VF page is accessed via a CommandButton, which calls a method in the Controller --
PageReference SRPage = new PageReference('/'+customObject.id);
The resulting VF page is displayed in the existing window without any sidebar or header. I would like it to display the SF sidebar and header. How can I achieve this?
Thanks.
- we-mp
- March 08, 2010
- Like
- 0
returning a PageReference from Controller and Salesforce appends ?inline=1 to the URL
Hello All,
I have a custom page and controller. I am trying to do some error handling within the controller as such:
public PageReference sendMail2PM(){
string PMID = [select Deliverable_Owner__c from P4_Contract_Deliverable__c where id = :this.cd.id].Deliverable_Owner__c;
string PMEmail = [select email from contact where id=:PMID].email;
if(PMEmail==null){
PageReference errorPage = new PageReference('https://cs1.salesforce.com/apex/errorLanding');
errorPage.setRedirect(true);
return errorPage;
}
}
My problem is that when the redirect happens, somehow "inline=1" gets appended to the URL. It seems that when the inline parameter is present then the page renders without headers or sidebars. I want the header and sidebar so users know they are still in saleforce.
Where is the "inline=1" coming from and how do I get rid of it? Or else how do I make the redirect happen with headers and sidebars?
- Frodo
- February 05, 2009
- Like
- 0
user hitting enter key on inputfield in tabbed view
How can I get pressing enter to be the same as clicking the button?
Thanks in advance!!
Jim
- JimRae
- August 27, 2008
- Like
- 1