hello everyone,

I'm working with crm 3.0 and got the following issue.

I have some fields that are disabled for the user, but are showing data
calculated from other fields.

When I save the form I enable them, otherwise they would not be saved.

That works fine when the user uses the Save & Close button.

But when the user click on the Save button and he hasn't made any changes,
the disabled fields become enabled.

I've been trying to workaround this problem, but with no result.

I tried to use the OnLoad event to disable the fields everytime, but when
the Save button is clicked the OnLoad event doesn't trigger. I tried to
modify a fields value and return it back to its original value to get that
field isDirty attribute to true, but that didn't work either.

Is there a way to set a field's isDirty attribute to True programmaticaly?

Any help will be appreciated.

Thanks
Eduardo

RE: isDirty attribute by DaveG

DaveG
Tue Jun 12 19:42:00 CDT 2007

Eduardo,

If I understand correctly, you are trying to save fields that are normally
disabled. If that is true, you don't have to dynamically enable them before
saving. Instead, during the OnSave event, you can use the ForceSubmit
property to save disabled field. Let's say you have an integer field called
disabledfield, to save the value, call this during the OnSave event

crmForm.all.disabledfield.DataValue = 1;
crmForm.all.disabledfield.ForceSubmit = true;

To answer your question about the IsDirty property, the SDK defines it as a
Get (Read-Only) property, so I don't think you can change it programmatically

Hope this helps.

"Eduardo" wrote:

> hello everyone,
>
> I'm working with crm 3.0 and got the following issue.
>
> I have some fields that are disabled for the user, but are showing data
> calculated from other fields.
>
> When I save the form I enable them, otherwise they would not be saved.
>
> That works fine when the user uses the Save & Close button.
>
> But when the user click on the Save button and he hasn't made any changes,
> the disabled fields become enabled.
>
> I've been trying to workaround this problem, but with no result.
>
> I tried to use the OnLoad event to disable the fields everytime, but when
> the Save button is clicked the OnLoad event doesn't trigger. I tried to
> modify a fields value and return it back to its original value to get that
> field isDirty attribute to true, but that didn't work either.
>
> Is there a way to set a field's isDirty attribute to True programmaticaly?
>
> Any help will be appreciated.
>
> Thanks
> Eduardo
>

Re: isDirty attribute by Eduardo

Eduardo
Wed Jun 13 15:55:21 CDT 2007

Thank you very much Dave...

I'll try this... sounds like this will work fine.

Eduardo

"DaveG" <DaveG@discussions.microsoft.com> wrote in message
news:030765B7-8067-4248-9F6D-4D6582BF8B88@microsoft.com...
> Eduardo,
>
> If I understand correctly, you are trying to save fields that are normally
> disabled. If that is true, you don't have to dynamically enable them
> before
> saving. Instead, during the OnSave event, you can use the ForceSubmit
> property to save disabled field. Let's say you have an integer field
> called
> disabledfield, to save the value, call this during the OnSave event
>
> crmForm.all.disabledfield.DataValue = 1;
> crmForm.all.disabledfield.ForceSubmit = true;
>
> To answer your question about the IsDirty property, the SDK defines it as
> a
> Get (Read-Only) property, so I don't think you can change it
> programmatically
>
> Hope this helps.
>
> "Eduardo" wrote:
>
>> hello everyone,
>>
>> I'm working with crm 3.0 and got the following issue.
>>
>> I have some fields that are disabled for the user, but are showing data
>> calculated from other fields.
>>
>> When I save the form I enable them, otherwise they would not be saved.
>>
>> That works fine when the user uses the Save & Close button.
>>
>> But when the user click on the Save button and he hasn't made any
>> changes,
>> the disabled fields become enabled.
>>
>> I've been trying to workaround this problem, but with no result.
>>
>> I tried to use the OnLoad event to disable the fields everytime, but when
>> the Save button is clicked the OnLoad event doesn't trigger. I tried to
>> modify a fields value and return it back to its original value to get
>> that
>> field isDirty attribute to true, but that didn't work either.
>>
>> Is there a way to set a field's isDirty attribute to True
>> programmaticaly?
>>
>> Any help will be appreciated.
>>
>> Thanks
>> Eduardo
>>


Re: isDirty attribute by buddyankur

buddyankur
Fri Jun 15 09:09:16 CDT 2007

> > crmForm.all.disabledfield.ForceSubmit = true;

ForceSubmit is working!!!!! : )

What a cool sokution .
Thanks Dave


RE: isDirty attribute by AKB

AKB
Fri Sep 07 01:34:02 PDT 2007

Worked for me too! :-)

"DaveG" wrote:

> Eduardo,
>
> If I understand correctly, you are trying to save fields that are normally
> disabled. If that is true, you don't have to dynamically enable them before
> saving. Instead, during the OnSave event, you can use the ForceSubmit
> property to save disabled field. Let's say you have an integer field called
> disabledfield, to save the value, call this during the OnSave event
>
> crmForm.all.disabledfield.DataValue = 1;
> crmForm.all.disabledfield.ForceSubmit = true;
>
> To answer your question about the IsDirty property, the SDK defines it as a
> Get (Read-Only) property, so I don't think you can change it programmatically
>
> Hope this helps.
>
> "Eduardo" wrote:
>
> > hello everyone,
> >
> > I'm working with crm 3.0 and got the following issue.
> >
> > I have some fields that are disabled for the user, but are showing data
> > calculated from other fields.
> >
> > When I save the form I enable them, otherwise they would not be saved.
> >
> > That works fine when the user uses the Save & Close button.
> >
> > But when the user click on the Save button and he hasn't made any changes,
> > the disabled fields become enabled.
> >
> > I've been trying to workaround this problem, but with no result.
> >
> > I tried to use the OnLoad event to disable the fields everytime, but when
> > the Save button is clicked the OnLoad event doesn't trigger. I tried to
> > modify a fields value and return it back to its original value to get that
> > field isDirty attribute to true, but that didn't work either.
> >
> > Is there a way to set a field's isDirty attribute to True programmaticaly?
> >
> > Any help will be appreciated.
> >
> > Thanks
> > Eduardo
> >