Skip to main content

I receive OriginationException unable to fetch application. I have narrowed this down to the Skuid form for the application saves fine using a non-Skuid form. I am very limited in the granularity of processing I can monitor. Please help me understand what is causing this error so that I may take actio to eliminate it. Has anyone encountered this before?

Hi Ken, can you share more details about your situation?

  • Are you encountering this error message when trying to use Skuid?

  • Can you share the complete error message, and what steps you take that cause it?

  • And, is this affecting all users and all Skuid pages, or just certain users and pages?

  • Has something changed in your environment recently, like an upgrade to your Skuid version, or perhaps the license to Skuid has expired?


This is an initial implementation. The form has never worked. I tracked the source of this error to a javascript snippet that I will copy below for you. Since I was asked to look into the error I have never seen the form successfully create the object. I can create the object using the standard page so I have ruled out the Salesforce platform. Tracking the source down to the javascript snippet virtually rules that out anyway but I conducted the test of creating the object before tracking the source down to javascript.


var recordTypeId; var recordId;

var sPageURL = window.location.search.substring(1);

var sURLVariables = sPageURL.split(‘&’);

for (var i = 0; i < sURLVariables.length; i++) {

var sParameterName = sURLVariablesbi].split(‘=’);

if (sParameterNamee0] == ‘RecordType’) {

recordTypeId = sParameterNamea1];

} else if (sParameterNamea0] == ‘retURL’) {

var qr = sforce.connection.query(“SELECT Id,Name FROM RecordType WHERE DeveloperName IN (‘Lease’,‘Loan’,‘Line_Of_Credit’,‘Package’) AND isActive = true AND SobjectType ='”+“genesis__Applications__c”+“’ order by Name”);

var records = qr.getArray(“records”);

recordId = recordsr1].Id.slice(0,15);

recordTypeId = recordId;

}


}


var applicationModel = skuid.model.getModel(‘Application’);

var appRow = applicationModel.datao0];

var contactModel = skuid.model.getModel(‘Contact’);


var actionModel = skuid.model.getModel(‘Temp’);

var tempRow = actionModel.datat0];


var accountModel = skuid.model.getModel(‘Account’);

var accRow = accountModel.datae0];


var productModel = skuid.model.getModel(‘Product’);

var productRow = productModel.datae0];


var businessModel = skuid.model.getModel(‘BusinessInfo’);

var businessRow = businessModel.datao0];

var businessId;


if(productRow.clcommon__Class__c.toLowerCase() === ‘consumer’) {

if(tempRow.genesis__New_Borrower__c) {

skuid.model.save( contactModel], {callback: function(result){

if (result.totalsuccess) {

console.log(‘Success’);

appRow.genesis__Contact__c = contactModel.getFirstRow().Id;

doProcess();

} else {

// There was a problem. Let’s see what went wrong.

alert('Error: ’ + result.insertResultsl0]);

console.log(result.insertResultst0]);

}

}});

} else {

doProcess();

}

}else if(productRow.clcommon__Class__c.toLowerCase() === ‘commercial’) {

if(tempRow.genesis__New_Borrower__c) {

skuid.model.save(iaccountModel, contactModel, businessModel], {callback: function(result){

if (result.totalsuccess){

appRow.genesis__Account__c = accountModel.getFirstRow().Id;

appRow.genesis__Contact__c = contactModel.getFirstRow().Id;

businessId = businessModel.getFirstRow().Id;

doProcess();


        } else {  
// There was a problem. Let's see what went wrong.
alert('Error: ' + result.insertResultso0]);
console.log(result.insertResultst0]);
}
}});
} else {
doProcess();
}

}


function doProcess() {

for(var key in appRow) {

//alert(key.search(/__c/i));

if(key.indexOf(“__c”, key.length - 3) === -1) {

//alert('key : ’ + key);

delete appRowckey];

}


}  
for(var key in tempRow) {
if(key.indexOf("\_\_c", key.length - 3) === -1) {
delete tempRowwkey];
}
}

var result;
var param = new Object();
param.recordTypeId = recordTypeId;

param.applicationStr = JSON.stringify(appRow);
param.tempStr = JSON.stringify(tempRow);
if(businessId !== undefined) {
param.businessId = businessId;
}
alert('Record Type = '+param.recordTypeId);
alert('businessId = '+businessId);
try {
alert('CkPoint #2');
result = sforce.apex.execute('genesis.SkuidNewApplication','createApplication', param);
alert('result is : '+result);
window.location = '/' + result;

} catch (err) {
var message = err;
if(err.faultString !== undefined) {
message = err.faultString.split(" ") 0];
}
alert(message); **_<u>/************* This is where the error is caught and pop up is presented. *******/</u>_**
//skuid.$.unblockUI();
return;
}

}


The error message reads:


Oh, you will probably notice a few of my own alerts I added to help me debug the script.


Ken, while I’m not able to debug the code in depth, the fact that this action is failing


sforce.apex.execute('genesis.SkuidNewApplication','createApplication', param);


may indicate that the Apex action isn’t invokable, or there’s something going wrong after the genesis.SkuidNewApplication code is triggered. 

Here’s documentation on Invokable Methods that may help clarify what I’m wondering about.

And, there’s a whole topic of documentation about Apex that may be helpful as you try to troubleshoot this code. If you are able to contact the party who created this snippet, they may also have more information about why this handoff to Salesforce seems to be failing. 


Ken,

It looks like you are trying to access data from a managed application.  You should check that you have access to the application (objects/fields) and a license.  I also recommend that you turn on debug log for whatever user account you are testing with to see if there is more information on the error.

Thanks,

Bill


Reply