Good luck,
make sure you take all steps in the right order.
The K50 has some minor difference for the plastic door which covers the USB connector.
You have to take the complete plastic grip off, it looks like this:
You can see this square metal part which is glued into the grip but sometimes falls off so don't lose it.
This plastic USB door is hooked onto a nose on the front part, so you lift it to entangle it and when you assemble the camera after you finished exchanging the solenoid you first push this part through the hole again and pull it over this nose. See here:
This and the screws under the popup flash (2screws for the K50, 3 x for the K30) is the only difference.
Also you have that bit more space for the solenoid wires which is good.
Most important when re-assembling: Check the AF-M switch as described in my manual.
You don't want to miss this! Because if forgotten, the inner part of the switch moves and then those 2 parts won't connect: