Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Others
cms.evaluation
cms.general
comm.businessdesk
comm.campaigns_csf
comm.catalog
comm.datawarehousing
comm.deploy.
comm.general
comm.sdk
comm.solutionsites
comm.userprofilemgt
commerce.analysis
crm
crm.deployment
crm.developer
hiserver.general
mobility.miserver
sharep.portal.config
sharep.portal.dev
sharep.portal.docmgmt.
sharep.portal.installation
sharep.portal.sdk
sharep.portal.search
sharep.team.caml
sharep.teamservices
sharep.windowsservices
sharep.winservices.dev
sharepoint.portalserver
siteserv.knowledgemgr
siteserver.analysis
siteserver.commerce
siteserver.css
siteserver.general
siteserver.publishing
siteserver.sdk
siteserver.search
site-server.site-mgmt
site-server.webpost
  
 
date: Thu, 28 Aug 2008 11:40:37 -0500,    group: microsoft.public.crm.developer        back       


Set field value based on results of 3 other fields   
CRM 4.0
I have 4 fields; all are bit type with default = "No"

Field 1 = Compliance Question 1 | bit | No | Radio Button on Form
Field 2 = Compliance Question 2 | bit | No | Radio Button on Form
Field 3 = Compliance Question 3 | bit | No | Radio Button on Form

Field 4 = Compliant ? | bit | No | Radio Button on Form.

I would like to change Field 4 value from No to Yes if ALL 3 compliance 
questions  = "Yes" and leave it at "No" if ANY of the 3 compliance questions 
= "No"

Any help is greatly appreciated!!

TIA -
R. Fisher
date: Thu, 28 Aug 2008 11:40:37 -0500   author:   RJ Fisher

RE: Set field value based on results of 3 other fields   
Edit the code below and replace field1, field2, etc with your field names.  
Paste the edited code into the on change event of each of your three 
compliance question fields.  If these fields can be set by workflow or 
callout, paste the code in the onload event of the form as well to handle 
those scenarios.

if (crmForm.all.field1.DataValue == true && crmForm.all.field2l.DataValue == 
true && crmForm.all.field3.DataValue == true)
{
crmForm.all.field4.DataValue = true;
}
else
{
crmForm.all.field4.DataValue = false;
}
-- 
Richard Riddle
CRM Developer
Autonomix


"RJ Fisher" wrote:

> CRM 4.0
> I have 4 fields; all are bit type with default = "No"
> 
> Field 1 = Compliance Question 1 | bit | No | Radio Button on Form
> Field 2 = Compliance Question 2 | bit | No | Radio Button on Form
> Field 3 = Compliance Question 3 | bit | No | Radio Button on Form
> 
> Field 4 = Compliant ? | bit | No | Radio Button on Form.
> 
> I would like to change Field 4 value from No to Yes if ALL 3 compliance 
> questions  = "Yes" and leave it at "No" if ANY of the 3 compliance questions 
> = "No"
> 
> Any help is greatly appreciated!!
> 
> TIA -
> R. Fisher 
> 
> 
>
date: Thu, 28 Aug 2008 11:58:11 -0700   author:   Richard Riddle

RE: Set field value based on results of 3 other fields   
What Richard suggested will work just fine. A shorter way is to simply assign 
the value of the if part as the value of field4. Note this this shorthand can 
be confusing when used in complex situations, so Richards way would be easier 
to understand, especially when someone else has to read your code. But here's 
my alternative as one line:

crmForm.all.field4.DataValue = (crmForm.all.field1.DataValue == true && 
crmForm.all.field2.DataValue == true && crmForm.all.field3.DataValue && true);
-- 
Cheers

Paul Reyneke
CRM Blog - http://paulreyneke.blogspot.com/


"Richard Riddle" wrote:

> Edit the code below and replace field1, field2, etc with your field names.  
> Paste the edited code into the on change event of each of your three 
> compliance question fields.  If these fields can be set by workflow or 
> callout, paste the code in the onload event of the form as well to handle 
> those scenarios.
> 
> if (crmForm.all.field1.DataValue == true && crmForm.all.field2l.DataValue == 
> true && crmForm.all.field3.DataValue == true)
> {
> crmForm.all.field4.DataValue = true;
> }
> else
> {
> crmForm.all.field4.DataValue = false;
> }
> -- 
> Richard Riddle
> CRM Developer
> Autonomix
> 
> 
> "RJ Fisher" wrote:
> 
> > CRM 4.0
> > I have 4 fields; all are bit type with default = "No"
> > 
> > Field 1 = Compliance Question 1 | bit | No | Radio Button on Form
> > Field 2 = Compliance Question 2 | bit | No | Radio Button on Form
> > Field 3 = Compliance Question 3 | bit | No | Radio Button on Form
> > 
> > Field 4 = Compliant ? | bit | No | Radio Button on Form.
> > 
> > I would like to change Field 4 value from No to Yes if ALL 3 compliance 
> > questions  = "Yes" and leave it at "No" if ANY of the 3 compliance questions 
> > = "No"
> > 
> > Any help is greatly appreciated!!
> > 
> > TIA -
> > R. Fisher 
> > 
> > 
> >
date: Thu, 28 Aug 2008 13:00:01 -0700   author:   Bossie

Re: Set field value based on results of 3 other fields   
Even shorter :-)

crmForm.all.field4.DataValue = crmForm.all.field1.DataValue && 
crmForm.all.field2.DataValue && crmForm.all.field3.DataValue;

-- 
Michael Höhne, Microsoft Dynamics CRM MVP

CRM Blog: http://www.stunnware.com/?area=blog

"Bossie"  wrote in message 
news:D64B60D5-A9F2-4DAE-9ED2-79040AD849C5@microsoft.com...
> What Richard suggested will work just fine. A shorter way is to simply 
> assign
> the value of the if part as the value of field4. Note this this shorthand 
> can
> be confusing when used in complex situations, so Richards way would be 
> easier
> to understand, especially when someone else has to read your code. But 
> here's
> my alternative as one line:
>
> crmForm.all.field4.DataValue = (crmForm.all.field1.DataValue == true &&
> crmForm.all.field2.DataValue == true && crmForm.all.field3.DataValue && 
> true);
> -- 
> Cheers
>
> Paul Reyneke
> CRM Blog - http://paulreyneke.blogspot.com/
>
>
> "Richard Riddle" wrote:
>
>> Edit the code below and replace field1, field2, etc with your field 
>> names.
>> Paste the edited code into the on change event of each of your three
>> compliance question fields.  If these fields can be set by workflow or
>> callout, paste the code in the onload event of the form as well to handle
>> those scenarios.
>>
>> if (crmForm.all.field1.DataValue == true && crmForm.all.field2l.DataValue 
>> ==
>> true && crmForm.all.field3.DataValue == true)
>> {
>> crmForm.all.field4.DataValue = true;
>> }
>> else
>> {
>> crmForm.all.field4.DataValue = false;
>> }
>> -- 
>> Richard Riddle
>> CRM Developer
>> Autonomix
>>
>>
>> "RJ Fisher" wrote:
>>
>> > CRM 4.0
>> > I have 4 fields; all are bit type with default = "No"
>> >
>> > Field 1 = Compliance Question 1 | bit | No | Radio Button on Form
>> > Field 2 = Compliance Question 2 | bit | No | Radio Button on Form
>> > Field 3 = Compliance Question 3 | bit | No | Radio Button on Form
>> >
>> > Field 4 = Compliant ? | bit | No | Radio Button on Form.
>> >
>> > I would like to change Field 4 value from No to Yes if ALL 3 compliance
>> > questions  = "Yes" and leave it at "No" if ANY of the 3 compliance 
>> > questions
>> > = "No"
>> >
>> > Any help is greatly appreciated!!
>> >
>> > TIA -
>> > R. Fisher
>> >
>> >
>> >
date: Thu, 4 Sep 2008 15:02:52 +0200   author:   Michael Höhne am

Re: Set field value based on results of 3 other fields   
LOL true ;-)
-- 
Cheers

Paul Reyneke
CRM Blog - http://paulreyneke.blogspot.com/


"Michael Höhne" wrote:

> Even shorter :-)
> 
> crmForm.all.field4.DataValue = crmForm.all.field1.DataValue && 
> crmForm.all.field2.DataValue && crmForm.all.field3.DataValue;
> 
> -- 
> Michael Höhne, Microsoft Dynamics CRM MVP
> 
> CRM Blog: http://www.stunnware.com/?area=blog
> 
> "Bossie"  wrote in message 
> news:D64B60D5-A9F2-4DAE-9ED2-79040AD849C5@microsoft.com...
> > What Richard suggested will work just fine. A shorter way is to simply 
> > assign
> > the value of the if part as the value of field4. Note this this shorthand 
> > can
> > be confusing when used in complex situations, so Richards way would be 
> > easier
> > to understand, especially when someone else has to read your code. But 
> > here's
> > my alternative as one line:
> >
> > crmForm.all.field4.DataValue = (crmForm.all.field1.DataValue == true &&
> > crmForm.all.field2.DataValue == true && crmForm.all.field3.DataValue && 
> > true);
> > -- 
> > Cheers
> >
> > Paul Reyneke
> > CRM Blog - http://paulreyneke.blogspot.com/
> >
> >
> > "Richard Riddle" wrote:
> >
> >> Edit the code below and replace field1, field2, etc with your field 
> >> names.
> >> Paste the edited code into the on change event of each of your three
> >> compliance question fields.  If these fields can be set by workflow or
> >> callout, paste the code in the onload event of the form as well to handle
> >> those scenarios.
> >>
> >> if (crmForm.all.field1.DataValue == true && crmForm.all.field2l.DataValue 
> >> ==
> >> true && crmForm.all.field3.DataValue == true)
> >> {
> >> crmForm.all.field4.DataValue = true;
> >> }
> >> else
> >> {
> >> crmForm.all.field4.DataValue = false;
> >> }
> >> -- 
> >> Richard Riddle
> >> CRM Developer
> >> Autonomix
> >>
> >>
> >> "RJ Fisher" wrote:
> >>
> >> > CRM 4.0
> >> > I have 4 fields; all are bit type with default = "No"
> >> >
> >> > Field 1 = Compliance Question 1 | bit | No | Radio Button on Form
> >> > Field 2 = Compliance Question 2 | bit | No | Radio Button on Form
> >> > Field 3 = Compliance Question 3 | bit | No | Radio Button on Form
> >> >
> >> > Field 4 = Compliant ? | bit | No | Radio Button on Form.
> >> >
> >> > I would like to change Field 4 value from No to Yes if ALL 3 compliance
> >> > questions  = "Yes" and leave it at "No" if ANY of the 3 compliance 
> >> > questions
> >> > = "No"
> >> >
> >> > Any help is greatly appreciated!!
> >> >
> >> > TIA -
> >> > R. Fisher
> >> >
> >> >
> >> > 
>
date: Sun, 7 Sep 2008 13:57:01 -0700   author:   Bossie

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us