Benutzer mit den meisten Antworten
Bit field value not saving

Frage
-
I have a field type BIT on my form and code which sets the value depending on another picklist field value selected.
Below code is on the OnChange of the picklist.
if(ckPicklist == 'Value1') { crmForm.all.new_bitValue.DataValue = true; } else if(ckPicklist == 'Value2') { crmForm.all.new_bitValue.DataValue = false; }
It's working fine however if I save the form and reopen it the set BIT value is not saved??
Antworten
-
Hi,
if the bitfield is shown as picklist, you have to use crmForm.all.new_bitValue.DataValue = 1; to save the field as true.
Is the bitfield readonly on the form, you must use crmForm.all.new_bitValue.forcesubmit = true; to save the changes in the database.
Viele Grüße
Michael Sulz
MVP für Microsoft Dynamics CRM- Als Antwort vorgeschlagen Michael Sulz Donnerstag, 11. Februar 2010 13:25
- Als Antwort markiert Morjo Donnerstag, 11. Februar 2010 13:41
- Bearbeitet Michael Sulz Donnerstag, 11. Februar 2010 17:26
-
Hi,
what you want to store, the Picklist2 or the bit field? The code you postet stores the bit field, not the picklist2.
To store the picklist2, use crmForm.all.new_Picklist2.forcesubmit = true;
Viele Grüße
Michael Sulz
MVP für Microsoft Dynamics CRM- Als Antwort markiert Michael Sulz Freitag, 7. Januar 2011 13:44
Alle Antworten
-
Hi,
if the bitfield is shown as picklist, you have to use crmForm.all.new_bitValue.DataValue = 1; to save the field as true.
Is the bitfield readonly on the form, you must use crmForm.all.new_bitValue.forcesubmit = true; to save the changes in the database.
Viele Grüße
Michael Sulz
MVP für Microsoft Dynamics CRM- Als Antwort vorgeschlagen Michael Sulz Donnerstag, 11. Februar 2010 13:25
- Als Antwort markiert Morjo Donnerstag, 11. Februar 2010 13:41
- Bearbeitet Michael Sulz Donnerstag, 11. Februar 2010 17:26
-
Hi Michael,
I just realized im having the same issue with a different picklist not saving.
if(ckPicklist == 'Value1') { crmForm.all.new_bitValue.DataValue = true; crmForm.all.new_bitValue.forcesubmit; crmForm.all.new_Picklist2.SelectedText = 'something'; } else if(ckPicklist == 'Value2') { crmForm.all.new_bitValue.DataValue = false; crmForm.all.new_bitValue.forcesubmit; crmForm.all.new_Picklist2.SelectedText = 'something else'; }
I tried the forcesubmit but won't work? -
Hi,
what you want to store, the Picklist2 or the bit field? The code you postet stores the bit field, not the picklist2.
To store the picklist2, use crmForm.all.new_Picklist2.forcesubmit = true;
Viele Grüße
Michael Sulz
MVP für Microsoft Dynamics CRM- Als Antwort markiert Michael Sulz Freitag, 7. Januar 2011 13:44