• Kate Brown
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

  I am working in a custom object and new to JavaScript. I want to create a button that basically says if a field equals "x" then update a different field to "A", if that field equals "y" then update the other field to "B", if the field is null then send an alert.

I got the button to work to update the field I need, but when I tried to create the if/then I got syntax errors.

Here is what I have so far:

{!REQUIRESCRIPT("/soap/ajax/27.0/connection.js")}
var objPrice_Quote__c = new sforce.SObject('Price_Quote__c');
objPrice_Quote__c.Id = '{!Price_Quote__c.Id}';
objPrice_Quote__c.Status__c = 'Customer Approval';
var result = sforce.connection.update([objPrice_Quote__c]);
location.reload(true);

 

Hey,

Can anyone give me an explanation on how to create "many-to-many" relationship - Between "Contacts" and "Products". So that the final result would be as follows:
1. Many contacts can have many products
2. The same product can be related to many products

Thanks
Can someone please give the complete Visualforce page code? Cannot get mine to work.

I have a working validation rule that has to be updated. Now the validation rule checks that either picklist field is selected or text field has user input (some value)


AND(
NOT(ISBLANK(TEXT(PicklistField__c ))),
NOT(ISBLANK(Text_field__c)))

This validation rule still has to work like this in the most of the cases, but there will be one new condition:
IF Another_Picklist__c has value "ABC",
user may not select PicklistField__c or fill in Text_field__c

So now there is a third field which has to be added to the already existing rule.

If Another_Picklist__c is not "ABC", the old rule should trigger just the way it is triggered right now:
AND(
NOT(ISBLANK(TEXT(PicklistField__c ))),
NOT(ISBLANK(Text_field__c)))

But if Another_Picklist equals "ABC", then user may not select PicklistField or add
value to Text_field.

Makes sense?

 

This is what I tried to do:


IF(NOT(ISPICKVAL(Another_Picklist__c, "ABC")),

(AND(
NOT(ISBLANK(TEXT(PicklistField__c ))),
NOT(ISBLANK(Text_Field__c)))),

(AND(
ISBLANK(TEXT(PicklistField__c)),
(ISBLANK(Text_Field__c)))
))

 

What happens here is that the end of the rule is not working alright. Any ideas what I'm doing wrong here?

 

Regards,

TP