Michael
Fri Sep 08 13:42:32 CDT 2006
Yes, you can get these values. However you must include the fields on the
form, which I guess is the problem.
--
Michael
http://www.stunnware.com/crm2
----------------------------------------------------------
"JamesE" <JamesE@discussions.microsoft.com> schrieb im Newsbeitrag
news:B7AD70DD-3458-4F0C-B729-603E1A31780C@microsoft.com...
> Hi Michael,
>
> I've just tried the var stateText = crmForm.all.statecode.SelectedText;
> syntax and the error 'crmForm.all.statecode.SelectedText' is null or not
> an
> object appears.
>
> Are you sure you can get the text from statecode. It would be good
> because
> I want to only populate a field when the status is open.
>
> Thanks for the prompt help.
>
> James
>
> "Michael Höhne" wrote:
>
>> Hi James,
>>
>> You can use one of the following to retrieve either the text or the
>> integer
>> value of the state and status fields:
>>
>> var stateText = crmForm.all.statecode.SelectedText;
>> var state = parseInt(crmForm.all.statecode.DataValue);
>> var statusText = crmForm.all.statuscode.SelectedText;
>> var status = parseInt(crmForm.all.statuscode.DataValue);
>>
>> When assigning it to a field, use the DataValue property in favor of the
>> value property (crmForm.new_statusreasonwhenlastopen.DataValue). When
>> saving
>> the value to a text field, you don't need to convert the state/status to
>> an
>> integer with the parseInt function. However, if you want to create
>> reports
>> later on, an integer value reflecting the status may be beneficial.
>>
>> --
>> Michael
>>
>>
http://www.stunnware.com/crm2
>>
>> ----------------------------------------------------------
>>
>> "JamesE" <JamesE@discussions.microsoft.com> schrieb im Newsbeitrag
>> news:8474257C-46F3-4B9A-9BF9-A7AF6AD91870@microsoft.com...
>> > Hi,
>> >
>> > I want to copy a picklist value to a text field using the onLoad event.
>> > The
>> > reason for this is because I was to record what the status reason was
>> > when
>> > the record was last open. Therefore when the record gets disqualified
>> > we
>> > can
>> > see what the status reason was when it was last open.
>> >
>> > Is this possible?
>> >
>> > Here is my code so far
>> >
>> > var i;
>> > i = crmForm.statuscode.value;
>> > crmForm.new_statusreasonwhenlastopen.value = i;
>> >
>> > Thanks
>> >
>> > James
>>
>>
>>