You need to sign in to do that
Don't have an account?
boBNunny
Override of New button
Hi all. I've been able to override Edit and Delete buttons. But when I override the New button (on a child object), I just get a blank i-Frame, but no errors as shown on the status bar with an exclamation point. I've attached the "View Source" from the i-Frame. It seems it sees the script, but just doesn't want to execute it. Any ideas?
Code:
<script type="text/javascript">function getRecordIds(keyPrefix) { return [] }</script> <script type="text/javascript">this.__sfdcSessionId = 'URg3C3XdgX6J6zgBrjXUW9dKBYWdvmYiuDA1IIbxSiYw8wdSoYUAe9XIY4n4389T.Ps8ktT1SsV3Fh3TalS5iFtm0eZXn.oO3HqtZiMtDQ_9WR0F2VSOzr1Vmttbk__IheJaNwCU'</script> <script type="text/javascript"> alert("I'm starting"); if("Approved" == "Approved" && "Product Pricing Exception" == "Product Pricing Exception") { //go to the standard detail page alert("Sorry, once a Sales Exception is in Approved status, New is not authorized."); window.parent.location.href = "/a0860000002BlLN/d"; } else { //go to the standard new page alert("New!"); window.parent.location.href = "/setup/ui/recordtypeselect.jsp—ent=01I600000009SXk&retURL=%2Fa0860000002BlLN%2Fd&save_new_url=%2Fa08%2Fe%3FretURL%3D%252Fservlet%252Fservlet.Integration%253Flid%253D01NT00000004Ig1%2526eid%253Da0O%2526ic%253D1%2526CF00NT0000000ijhA%253DPreferred%252BPlus%252BDiscount%2526CF00NT0000000ijhA_lkid%253Da0860000002BlLN%2526scontrolCaching%253D1%2526retURL%253D%25252Fa0860000002BlLN%2526RecordType%253D012T00000004KRI%2526cancelURL%253D%25252Fa0860000002BlLN%2526ent%253D01IT0000000Cjpa%2526save_new%253D1%2526autoMapValues%253D1&nooverride=1"; }
I was able to get the code to work (I was missing an ending </script>).
However, another problem arises with the "New" record asking for RecordType before it hits the script, then after the script fires and calls the New screen, it asks for the RecordType again.
Does anyone have any idea how to bypass this behavior?
It wasn't what I wanted but does have the advantage of eliminating a step.
If you don't include that last TRUE bit, then you'll just redirect back to this script in an infinite loop.