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
prasanna kovuriprasanna kovuri 

specific record type selection

Hi,

I have a custom object that have nearly 20 record types on it. this object is related list on some other object. parent object have two types of records. Here what is the problem exactly I need to show some record types under parent1 type record and remaing record types on parent2 type record when user clicks on new button on the related list. 

can you please provide me the sample visualforce and apex code to acheive this.

Thanks in advance.
Sanjay Mulagada 11Sanjay Mulagada 11
    Create two separate Visual Flows one each for different type of Parent Record type.
     Now create a custom button and write a condition like this,
if ("{!Parent.RecordType}" == "001XXXXXXXXXSDS")
{
window.location = "/flow/Screen1";
}

else
{
window.location = "/flow/Screen2";
}
     Now add this button to you related list.
In your Screen1 include only the Record types you needed when ParentRecord type = x; and Screen 2 the rest; using Flows create records.