feridun, I think your 1st suggestion is close to what I need. Here is the exact code that I placed in the "onSave" event.
It appears to work when I Save the form, however the value is not populated in the table because when I open the record, the field is blank again.
Any ideas?
Here is the code:
if (crmForm.all.new_royalsupp
switch (crmForm.all.new_manufactu
{
case "1":
crmForm.all.new_supportacc
break
case "2":
crmForm.all.new_supportacc
break
case "3":
crmForm.all.new_supportacc
break
case "4":
crmForm.all.new_supportacc
break
case "5":
crmForm.all.new_supportacc
break
case "6":
crmForm.all.new_supportacc
break
default:
crmForm.all.new_supportacc
break
}
}





by: feridunPosted on 2009-06-10 at 09:46:46ID: 24593619
The solution depends on the logic neeed for the two fields to test. If Price always has to be greater than zero then I would enclose the switch statement inside an if statement something like this:
ue > 0) {
) "One";
"Two";
"Default";
) ue > 5) { "One";
"Two";
"Default";
if (crmForm.all.PRICE.DataVal
switch (crmForm.all.MFG.DataValue
{
case "One":
crmForm.all.RSA.DataValue=
break
case "Two":
crmForm.all.RSA.DataValue=
break
default:
crmForm.all.RSA.DataValue=
break
}
}
This script would do nothing if price was not > 0.
If on the other hand, the price test might vary you could do something like this:
switch (crmForm.all.MFG.DataValue
{
case "One":
// test for PRICE> 5 as an example
if (crmForm.all.PRICE.DataVal
crmForm.all.RSA.DataValue=
}
break
case "Two":
// add in the appropriate test for price as per case one
crmForm.all.RSA.DataValue=
break
default:
crmForm.all.RSA.DataValue=
break
}
Hope this helps.