+ Start a Discussion
Jeet PadhyaJeet Padhya 

URGENT HELP REQUIRED WITH VALIDATION

PROBLEM STATEMENT : When I Clone a ticket and save it, the status of the ticket stays the same. For ex, if i clone a ticket that has the status CLOSED, the new ticket also has the status closed. Now, the person cloning the ticket can change the status manually, but this still leaves a chance for Human errors.

I want a validation rule that should check if the status of the ticket is opened while creating a record.

I tried
IF( AND((BMCServiceDesk__FKStatus__c) != "OPENED",ISBLANK(PRIORVALUE((BMCServiceDesk__FKStatus__c)))), TRUE, FALSE)

I also tried
IF( AND((BMCServiceDesk__FKStatus__c) != "OPENED",ISNULL(PRIORVALUE((BMCServiceDesk__FKStatus__c)))), TRUE, FALSE)

But none of it works. Please help!
 

Best Answer chosen by Jeet Padhya
Krishna SambarajuKrishna Sambaraju
If "Status" a lookup field try this. Assuming that the Name field on the lookup object displays actual text of Status.
AND(
             ISNEW(), 
             BMCServiceDesk__FKStatus__r.Name != 'Opened'
)
Hope this works.

All Answers

Krishna SambarajuKrishna Sambaraju
If you want to stop creating a record with "Closed" status you can use the following validation rule.

AND(ISNEW(), TEXT(BMCServiceDesk__FKStatus__c) == 'Closed', true, false)

The above validation will fire when the status is closed for a newly created record.

Hope this helps.
Jeet PadhyaJeet Padhya
None of the above solutions worked. Any other suggestions?
phiberoptikphiberoptik
Not sure what the true and false are, in your VR, Krishna, but they are not necessary. It should just be:
 
AND(
          ISNEW(), 
          ISPICKVAL(BMCServiceDesk__FKStatus__c, "Closed")
         )

 
Krishna SambarajuKrishna Sambaraju
Yes, they are not required. I may be thinking of an IF condition when I was giving this solution.
 
Jeet PadhyaJeet Padhya
Hi phiberoptik, ISPICKVAL cannot be used as Status is a Lookup field. Also, i tried your validation with an '==' but this seems to give me an error even when the status is anything else. So, basically, i just cant save a new ticket

Any suggestions?
 
Jeet PadhyaJeet Padhya
i basically want a validation rule that states that whenever a new ticket is created, the status(lookup field) should be OPENED only. Any other status is unacceptable.

Regards,

JP
Krishna SambarajuKrishna Sambaraju
If "Status" a lookup field try this. Assuming that the Name field on the lookup object displays actual text of Status.
AND(
             ISNEW(), 
             BMCServiceDesk__FKStatus__r.Name != 'Opened'
)
Hope this works.
This was selected as the best answer
Jeet PadhyaJeet Padhya
Worked like a charm.

Thanks Krishna!
phiberoptikphiberoptik
Glad it worked out. Was not aware Status was a lookup. Odd that BMC created it that way, but none the less, glad Krishna came through for you.