My question involves criminal law for the state of: Iowa

I was caught shoplift last Friday in a local food store. The value of the goods is around $12. I was taken to the store security office and the store guards did the paper work and then called the police. The police gave me ticket (5th theft) and told me that I need go to the court next week.
Since I need a clear criminal record for my future immigration. I consulted some lawyers today. One lawyer said I can plea no guilt first, then the case will go to the trail. After that, if I was sencentenced guilt. then we can ask for "deferred judgement". But I was told by the others that I should plea guilt the first time I go to the court, then ask for "deferred judgement". Once the case went to the trail, I will never get the change to ask for "deferred judgement". I am confused now. Could you please when I can apply for " deferred judgement", before the case go to the trail or after? or maybe I can ask for at both time?
Any help is appreciated.