Thanks for the serial number. The D series has seen several changes and it is very important to know which machine you have.
I would start by testing the neutralizer switches and then test the resistance of the solenoids.
The transmission solenoids are on the top of the transmission mounted together on a manifold. I will attach an image to show you the location.
You can easily test the circuits from the direction shift handle (FNR-forward-neutral-reverse) connector. Remove the covers around the steering column to access the connector under the shift handle. I will attach an image of the connector pin-out wires to help you see the wires to test. You will need a multi-meter to perform these tests.
To test the neutralizer switches, (buttons are located on the 4 speed shift handle and the loader handle) connect your meter to pins #2 and #9. Set your meter to read ohms and your meter should show OL indicating an open circuit. Press either switch and the meter should read less than 5 ohms, indicting a good closed circuit.
If your meter shows a closed circuit with pressing a button, this will prevent the transmission engaging since this is how these buttons work to neutralize the transmission for shifting or loading. Keep the buttons for sticking or a short in the wire harness.
If this test show the circuits are normal, next test the solenoids.
Connect your meter to pins #2 and #5, you meter is set to ohms and it should show about 8 ohms. This means the solenoid and wiring is good. If this does not show 8 ohms, disconnect the solenoid with the brown and yellow wire and test the solenoid directly for 8 ohms to see if it is correct.
Higher readings indicated poor connection or wiring, lower readings indicates short circuits.
Perform the same test on pins #4 and #6 for the reverse solenoid.
Let me know your results and we can see how to proceed from here.
If all circuit test are good, you will need to pressure test the transmission next.
I am assuming your parking brake is not an issue since this would cause an alarm to sound when you place the lever in either direction, if the parking brake switch was sticking.