If this is your first offense, the prosecutor might offer you a ACOD - Marijuana (CPL 170.56), which means you must stay out of ANY kind of trouble for a year, otherwise the charge for which you were ACOD'd will be restored, and you will have to face the more recent charges as well. If you stay out of trouble for a year, the charge will be dismissed and sealed, and you can state on applications that you have no arrest record
You're lucky they didn't slap Criminal Possession of Marijuana, 5th degree (a B Misdemeanor) on you, since you had the pot in your possession in a public place. Conviction on that would give you a criminal record. UPM is a violation; hence, you will not pick up a criminal record upon conviction.