One way or another, you will need to synchronize the record with the layout type.
You can use a variety of scripts with buttons and/or triggers for this.
One way, is to set the same On RecordLoad trigger for all your materials layouts. Your script might look like this:
If [YourTable::MaterialType = "Type1"]
Go To Layout ["Type 1" (Materials) ]
Else If [YourTable::MaterialType = "Type2"]
Go To Layout ["Type 2" (Materials) ]
//and so forth
Everytime you change records, the script will fire and select the appropriate layout.
If your Material Types and layout names exactly match, you can even do it with a single script step:
Go To Layout [YourTable::MaterialType] // use the layout name by calculation option.
Ok, I had done something just like the first suggestion earlier in the week and was thinking there was a different better way to do it. Which, as it turns out, there is. Thanks alot Phil.
Actually, this didn't work quite like I expected. So if I choose the material type from the drop down list it will change the layout to the correct layout for that material type. However, if I change the layout via the layout drop down screen, the record for the specification will still stay up no matter what layout I am in. I want to make it so that once I have chosen the material type from the material type drop down list, if i change the layout the normal way, I won't be able to see any records that don't have a matching material type. Right now, my material drop down list is almost like a duplicate layout drop down list.
Did you try setting up this script with the On RecordLoad Scripttrigger?
That way, any time your current record changes, the layout changes to match the specified material type for that record.
This assumes a form view layout.
If you are using a list or table view, this only works if all your records in the found set are of the same material type.
I am using a form view layout. The ON RecordLoad trigger worked. However, it had an unanticipated side effect. I am now unable to change the layout using the drop down layout list (when I am on a current record). Is there a way that I can still use the layout drop down list to switch to a different layout (that still only has records for the appropriate material) so that I can flip through records that way if I wanted to?
How does your drop down switch layouts? With a script trigger?
If the current layout is correct for your current record, changing layouts pops you back to the current layout as that is the specified layout for your current record. You should first find a record or records of the desired material type. You may simply need to perform a find for the desired material type and then the script trigger will switch you to the correct layout.