You need to sign in to do that
Don't have an account?
Hyperlink Formula Fields for JavaScript Disablement
Hello,
I want to ensure that I am reviewing this accurately. https://help.salesforce.com/articleView?id=Hyperlink-Formula-Fields-for-JavaScript-Disablement&language=en_US&type=1
Is there a way to report on all the formula fields and what the formulas are so that I can search to see if my org is affected by this change?
I don't believe that we will be affected, but I want to do my due diligence, so any help in how I should go about this would be greatly appreciated!
Thanks!
Stephanie
I want to ensure that I am reviewing this accurately. https://help.salesforce.com/articleView?id=Hyperlink-Formula-Fields-for-JavaScript-Disablement&language=en_US&type=1
Is there a way to report on all the formula fields and what the formulas are so that I can search to see if my org is affected by this change?
I don't believe that we will be affected, but I want to do my due diligence, so any help in how I should go about this would be greatly appreciated!
Thanks!
Stephanie
Please refer below link: It might help you:
https://success.salesforce.com/answers?id=9063A000000l1DAQAY
Regards
Syed
All Answers
Please refer below link: It might help you:
https://success.salesforce.com/answers?id=9063A000000l1DAQAY
Regards
Syed
Are you sure that there is only one way to include javasript in formula fields and will surely have "Javascript" keyword. I doubt.
However I read the article of salesforce.
"
Formula Options
Data TypeFormula
Decimal Places
Chart_API__c + Clipping_Service_Fees__c + Custom_Index_Fees__c+ DJIA_Fees__c + Fundamental_Feed_Fees__c + Historical_Feed_Fees__c + Index_Fees__c + InvestCenter_Fees__c +
Salesforce has provided below code to identify the Hyperlink/java script formula field in our org..
// Get all the standard and custom objects in the org List<EntityDefinition> entityDefs = [select QualifiedApiName from EntityDefinition]; // Forming a list of Entity API names List<String> entityNames = new List<String>(); for(EntityDefinition entityDef: entityDefs){ if(!entityDef.QualifiedApiName.endsWith('kav')){ entityNames.add(entityDef.QualifiedApiName); } } // Make the describe call Schema.DescribeSobjectResult[] results = Schema.describeSObjects(entityNames); System.debug('Got describe information for ' + results.size() + ' sObjects.'); // Check if there is a formula field with JavaSscript used in the HYPERLINK function for(Schema.DescribeSobjectResult res : results) { Map<String, SObjectField> fields = res.fields.getMap(); for(String fieldKey: fields.keySet()){ SObjectField sField = fields.get(fieldKey); Schema.DescribeFieldResult fieldResult = sField.getDescribe(); // This will have the formula string for fields of type Formula String calculatedFormulaString = fieldResult.getCalculatedFormula(); // If the formula uses a HYPERLINK function with javascript vbscript or data protocol // it cannot be used for security reasons if(null != calculatedFormulaString && calculatedFormulaString.startsWithIgnoreCase('HYPERLINK') && (calculatedFormulaString.containsIgnoreCase('javascript:') || calculatedFormulaString.containsIgnoreCase('vbscript:') || calculatedFormulaString.containsIgnoreCase('data:'))){ System.debug('Object name: ' + res.getLabel()); System.debug('Field name: ' + fieldKey); System.debug(calculatedFormulaString); } } }
But the problem is my org is too big, so i am getting CPU timeout error.
For this error salesforce has mention "If your org has a large number of custom objects, you might encounter an Apex CPU limit error when you run the script. If so, you can modify this code to split the list of entities and run it for each subset of entities"
So my question is how to modify code to split the list of entities and run?
Thanks
Deval