Improved Formula Debugging
This topic includes the following:
Improved formula debugging
The formula debugger has the following improvements:
- When you click the Debug Formula button, the record selector popup window resizes dynamically to 80% of the width of the hosting window and 95% of its height.
- When you select a record, the formula debugging window is also sized dynamically.
- The formula debugging window now contains a toolbar to navigate through window sections. The toolbar does not scroll off of the screen.
The following screen shows the new formula debugging window.
New debugging variable for trigger formulas
The trigger formula debugger cannot execute database transactions. In previous Platform releases, a formula that created, updated, or deleted records failed in the debugger.
This release introduces a new variable, rbv_debugFormula, that allows you to conditionalize code that requires
a database transaction and debug the rest of the formula. Platform uses this variable when running the formula in the
debugger, but does not use it when running the actual trigger in the
application.
Use the following code pattern to detect both cases. In this
example, the function returns without creating a record if the variable rbv_debugFormula is present and has a value.
function createRBRecord(rbObjectName,recordData,isAttachReq,attachData){
if(this.rbv_debugFormula !== undefined && this.rbv_debugFormula){
rbv_api.println("Skipping create record for "+ rbObjectName);
return;
}
varrecId=rbv_api.createRecord(rbObjectName,recordData);
if(isAttachReq===true && recId){
rbv_api.attach(attachData["relName"],attachData["objName1"],
'{!id}',attachData["objName2"],recId);
}
}