If you could let us know what kind of truck and engine it has we might be able to give you more information on what the stalling problem could be.
First thing that comes to mind and what I've found to be the problem on a few trucks I've repaired that was stalling until warmed up was the coolant temp sensor.
Depending on the make and year of the truck and the engine the coolant temp sensor could be on the front of the engine or towards the back.
The coolant temp sensor is usually made of brass and threads into the engine and has a connector on top of it that connects to the vehicles computer.
The coolant temp sensor lets the computer know what the temperature the engine is at and controls the fuel flow and throttle.
If you don't know where the coolant temp sensor is or how to change it out then it's best to take it to a mechanic and have them check your truck over.
Stalling can be due to fuel loss as well but since it only stalls until it is fully warmed up that leads me to believe it's a simple coolant temp sensor problem.
It could also be that the wire has corroded through on the coolant temp sensor or it could have become unplugged although that's really unlikely but anything could happen.