Question Status

Suggested Answer
Cosminco asked a question on 23 Apr 2013 10:45 AM

Hello,

I'm trying to calculate some fields on a quote OnLoad event. One of the fields is a float field. Everything is calculated well but when I open the quote for the first time there is a warning "You must enter a number between .....".

Is there a way to somehow initialize that field with a value. I suppose that this will solve my problem.

Thanks in advance

Reply
Suggested Answer
Jason Lattimer responded on 23 Apr 2013 11:29 AM

Try something like in the form's OnLoad event:

This will only fire when the first time the record is opened (being created) before it is saved the first time. 

if (crmForm.FormType == 1) {
    var val = "1"; //Initial value
    crmForm.all.fieldname.DataValue = parseFloat(val);
}

Jason Lattimer
My Blog -  Follow me on Twitter -  LinkedIn

Reply
Suggested Answer
Ben Hosking responded on 4 Jan 2014 4:54 PM

have you added the floats to the quote form or are they the default fields.

If they are default fields then I would recommend installing the latest rollup because this might be a bug which has already been fixed

has this issue been resolved

Ben  Hosking

If the my post helped you please mark my post as the suggested answer

Hosk's Dynamic CRM Blog   |  @BenHosk |  Rockstar365

Hosks CRM Dev YouTube Channel

Reply
Suggested Answer
Jason Lattimer responded on 23 Apr 2013 11:29 AM

Try something like in the form's OnLoad event:

This will only fire when the first time the record is opened (being created) before it is saved the first time. 

if (crmForm.FormType == 1) {
    var val = "1"; //Initial value
    crmForm.all.fieldname.DataValue = parseFloat(val);
}

Jason Lattimer
My Blog -  Follow me on Twitter -  LinkedIn

Reply
AFTAB HUSSAIN responded on 3 Jan 2014 5:51 PM

Hello,

Are you still facing this issue ?

Which update rollup you are on for CRM 4.0. Make sure that we are on latest update rollup if possible.

Check this link too - community.dynamics.com/.../39315.aspx

Thank You !

Reply
Suggested Answer
Ben Hosking responded on 4 Jan 2014 4:54 PM

have you added the floats to the quote form or are they the default fields.

If they are default fields then I would recommend installing the latest rollup because this might be a bug which has already been fixed

has this issue been resolved

Ben  Hosking

If the my post helped you please mark my post as the suggested answer

Hosk's Dynamic CRM Blog   |  @BenHosk |  Rockstar365

Hosks CRM Dev YouTube Channel

Reply