I had something like that once, 2011 740 with a C9. I believe it was a battery cable that became loose. I would start there.
Ziegler and everyone else will tell you to check the main grounds on the machine as well. Not a bad idea. Not sure what machine you have, but likely has a ground cable under the cab, on the right side of the machine, of course by the battery, and also probably at the motor.