5

Yet another "what gives" question.

I have a custom object that is updated upon a button click on a VisualForce Page.

I can see in my debug logs that the object has been updated. But when I refresh the page or query for the object's new data, nothing comes up and there is no DML_END in the debugs. Is it possible that something is happening later down in the process and rolling back the update?

VFP (button click):

<apex:page id="CalculatorLinkOnDemand" standardController="FPC_Funding_del__c" extensions="OnlineSalesCalculator" action="{!onlineCalculatorLinkGeneratorOnDemand}">

APEX Controller:

public PageReference onlineCalculatorLinkGeneratorOnDemand(){
    String funderId = ApexPages.currentPage().getParameters().get('funderId');
    system.debug('funderID:: ' + funderId);
    callTokenizer(funderId);
    return new pageReference('/' + funderId);
}

@future(callout=true)
public static void callTokenizer(Id funderId){
    //WEBSERVICE CALL OUT AND PARSING TO GET TOKEN
    //excluding for simplicity of question
        system.debug('tokenCredMap:: ' + tokenCredMap);
        tokencred = tokenCredMap.get(funderId);
        if(tokencred != null){
            fpc_funding_del__c f = new fpc_funding_del__c(Id= funderId,CalculatorLink__c= tokencred);
            system.debug('f:: ' +f );
            update f;
        }
}

DEBUG LOGS:

ENTIRE LOG: DEFAULT LEVEL:

40.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;NBA,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WAVE,INFO;WORKFLOW,INFO
08:59:55.0 (388318)|USER_INFO|[EXTERNAL]|00534000009QnEt|test@test.com| Standard Time|GMT-07:00
08:59:55.0 (426163)|EXECUTION_STARTED
08:59:55.0 (430090)|CODE_UNIT_STARTED|[EXTERNAL]|FutureHandler - state load
08:59:55.0 (1634138)|CODE_UNIT_FINISHED|FutureHandler - state load
08:59:55.0 (2482510)|EXECUTION_FINISHED
08:59:55.13 (13681374)|USER_INFO|[EXTERNAL]|00534000009QnEe|GMT-07:00
08:59:55.13 (13701877)|EXECUTION_STARTED
08:59:55.13 (13708707)|CODE_UNIT_STARTED|[EXTERNAL]|01pm0000000Kd6Y|OnlineSalesCalculator.callTokenizer(Id)
08:59:55.13 (14873019)|SYSTEM_MODE_ENTER|false
08:59:55.13 (14928582)|SYSTEM_MODE_EXIT|false
08:59:55.13 (14966817)|SYSTEM_MODE_ENTER|false
08:59:55.13 (17101411)|CALLOUT_REQUEST|[79]|System.HttpRequest[Endpoint=https://aksdjf;kljads/Token, Method=POST]
08:59:55.13 (398611941)|CALLOUT_RESPONSE|[79]|System.HttpResponse[Status=OK, StatusCode=200]
08:59:55.13 (398840960)|USER_DEBUG|[83]|DEBUG|svcAuth LT:::::::::: token 310d4a01-d979-4097-98f4-24a5bU
08:59:55.13 (400536534)|CALLOUT_REQUEST|[97]|System.HttpRequest[Endpoint=https://stag;saldkf/enizer/api/ Method=POST]
08:59:55.13 (735402288)|CALLOUT_RESPONSE|[97]|System.HttpResponse[Status=OK, StatusCode=200]
08:59:55.13 (735559841)|USER_DEBUG|[99]|DEBUG|tokencred:: [{"Id":"a0Dm0000004bPKnEAM","Token":"lQHYmzhsWURl-YYOzHuW"}]
08:59:55.13 (736938014)|USER_DEBUG|[115]|DEBUG|tokenCredMap:: {null=null, a0Dm0000004bPKnEAM=lQHYmzhsWURl-YYOzHuW}
08:59:55.13 (739060951)|USER_DEBUG|[120]|DEBUG|f:: FPC_Funding_del__c:{Id=a0Dm0000004bPKnEAM, CalculatorLink__c=lQHYmzhsWURl-YYOzHuW}
08:59:55.13 (739118354)|DML_BEGIN|[121]|Op:Update|Type:FPC_Funding_del__c|Rows:1

PARTIAL LOG FINEST:

08:50:19.10 (546545311)|VARIABLE_ASSIGNMENT|[117]|tokencred|"NqOGxtx7HQxQn1JC47v5"
08:50:19.10 (546552084)|STATEMENT_EXECUTE|[118]
08:50:19.10 (546554090)|STATEMENT_EXECUTE|[119]
08:50:19.10 (546620908)|HEAP_ALLOCATE|[119]|Bytes:4
08:50:19.10 (548315088)|VARIABLE_ASSIGNMENT|[119]|this.Id|"a0Dm0000004bPKnEAM"|0x5a21b5f3
08:50:19.10 (548350149)|VARIABLE_ASSIGNMENT|[119]|this.CalculatorLink__c|"NqOGxtx7HQxQn1JC47v5"|0x5a21b5f3
08:50:19.10 (548380921)|VARIABLE_SCOPE_BEGIN|[119]|f|FPC_Funding_del__c|true|false
08:50:19.10 (548404613)|VARIABLE_ASSIGNMENT|[119]|f|{"Id":"a0Dm0000004bPKnEAM","CalculatorLink__c":"NqOGxtx7HQxQn1JC47v5"}|0x5a21b5f3
08:50:19.10 (548413541)|STATEMENT_EXECUTE|[120]
08:50:19.10 (548417576)|HEAP_ALLOCATE|[120]|Bytes:4
08:50:19.10 (548443007)|SYSTEM_METHOD_ENTRY|[120]|String.valueOf(Object)
08:50:19.10 (548484592)|HEAP_ALLOCATE|[120]|Bytes:82
08:50:19.10 (548499992)|SYSTEM_METHOD_EXIT|[120]|String.valueOf(Object)
08:50:19.10 (548508994)|HEAP_ALLOCATE|[120]|Bytes:86
08:50:19.10 (548518803)|SYSTEM_METHOD_ENTRY|[120]|System.debug(ANY)
08:50:19.10 (548525622)|USER_DEBUG|[120]|DEBUG|f:: FPC_Funding_del__c:{Id=a0Dm0000004bPKnEAM, CalculatorLink__c=NqOGxtx7HQxQn1JC47v5}
08:50:19.10 (548532917)|SYSTEM_METHOD_EXIT|[120]|System.debug(ANY)
08:50:19.10 (548537731)|STATEMENT_EXECUTE|[121]
08:50:19.10 (548563191)|HEAP_ALLOCATE|[121]|Bytes:8
08:50:19.10 (548580674)|DML_BEGIN| 
[121]|Op:Update|Type:FPC_Funding_del__c|Rows:1
08:50:19.10 (548597219)|LIMIT_USAGE|[121]|DML|1|150
08:50:19.10 (548610448)|LIMIT_USAGE|[121]|DML_ROWS|1|10000
08:50:19.10 (548627080)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:8
08:50:19.635 (635721081)|CUMULATIVE_PROFILING_BEGIN
08:50:19.635 (635721081)|CUMULATIVE_PROFILING|No profiling information for SOQL operations
08:50:19.635 (635721081)|CUMULATIVE_PROFILING|No profiling information for SOSL operations
08:50:19.635 (635721081)|CUMULATIVE_PROFILING|DML operations|
Class.OnlineSalesCalculator.callTokenizer: line 121, column 1: Update: 
FPC_Funding_del__c: executed 0 times in 0 ms
08:50:19.635 (635721081)|CUMULATIVE_PROFILING|method invocations|
Class.OnlineSalesCalculator.callTokenizer: line 97, column 1: global 
System.HttpResponse send(ANY): executed 1 time in 316 ms
Class.OnlineSalesCalculator.callTokenizer: line 79, column 1: global 
System.HttpResponse send(ANY): executed 1 time in 213 ms
Class.OnlineSalesCalculator.callTokenizer: line 69, column 1: global public 
static Map<String,LinkShorteningAPI__c> getAll(): executed 2 times in 1 ms
External entry point: public static void callTokenizer(Id): executed 0 times in 0 ms
 Class.OnlineSalesCalculator.callTokenizer: line 74, column 1: global void setMethod(String): executed 1 time in 0 ms
 Class.OnlineSalesCalculator.callTokenizer: line 75, column 1: global void setEndpoint(String): executed 1 time in 0 ms
 Class.OnlineSalesCalculator.callTokenizer: line 76, column 1: global void setHeader(String, String): executed 1 time in 0 ms
 Class.OnlineSalesCalculator.callTokenizer: line 77, column 1: global void setBody(String): executed 1 time in 0 ms
 Class.OnlineSalesCalculator.callTokenizer: line 80, column 1: global String getBody(): executed 1 time in 0 ms
 Class.OnlineSalesCalculator.callTokenizer: line 83, column 1: global public static void debug(ANY): executed 1 time in 0 ms
 Class.OnlineSalesCalculator.callTokenizer: line 90, column 1: global void setMethod(String): executed 1 time in 0 ms
 08:50:19.635 (635721081)|CUMULATIVE_PROFILING_END

As you can see there is no DML_END. Why would this be?

  • Is this the entire debug or just an excerpt? I ask because if this is the entire log it looks like you have your log levels stripped down pretty heavily so maybe using a different logging level could reveal your answer. – gNerb Aug 24 '18 at 15:39
  • yes, that's the end of the debug. I have it on the default level but can run it again on finer. – Olivia Aug 24 '18 at 15:48
  • So it's not the full log, just the end of it, which is fine, I just felt like I had to check :) – gNerb Aug 24 '18 at 15:49
  • 1
    ah I found the issue. One of my triggers broke because of my updates but my IDE did not display the error. So when it fired off the trigger, all processes stopped. – Olivia Aug 24 '18 at 16:38
  • 1
    Can you post an answer to your own question and outline the error, behavior, and steps you used to troubleshoot so that others with a similar issue can take a look. – gNerb Aug 24 '18 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.