What does it mean when Dispatch gives the error "Serial number value was not set"?

Hello all, 

I've got a Dispatch code that'll be used for renaming, however when I run the code, sometimes I get the following error:

I'm not sure what it means, because, the serial number is defined and hypothetically each time a new part is added, there should be generation of a serial number. 

Any help would be greatly appreciated. Thank you in advance. 

SolidworksSolidworks Pdm/enterprise Pdm