function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Akis AthanasiadisAkis Athanasiadis 

Custom Button and Return URL on Object with Record Type

I have an object named Maintenance Fees which is a child to Contracts and to Product Assignment. its related list is only under Product Assignment.
This object has also a record type.
I have created a custom button which reads the record types and proceeds to the next page having both Product Assignment and Contracts  lookup fields already filled in. The issue is when I save the record that I go to the home page instead of returning to the maintenance fee record that was just created.
The code that I used is this:

 
https://cs109.salesforce.com/setup/ui/recordtypeselect.jsp?ent=01I0Q0000008y23&retURL=%2F{!Contract.Id}&save_new_url=%2Fa0i%2Fe%3FCF00N0Q000000dqIP%3D{!Asset_Product_Association__c.Contract__c}%26CF00N0Q000000dqIP_lkid%3D{!Contract.Id}%26saveURL%3D%252F{!Contract.Id}%26retURL&CF00N0Q000000dqIU={!Asset_Product_Association__c.Product__c}&CF00N0Q000000dqIP={!Contract.Id}&saveURL=%2F{!Contract.Id}&saveURL={!Contract.Id}

Any Ideas?