-2

The below code is mentioned in formula editor and this is showing

The formula expression is invalid: Incorrect number of parameters for function 'PRIORVALUE()'. Expected 1, received 2

  PRIORVALUE(([Opportunity].Status__c ), "Exported"))
1
  • 3
    I should think you would be able to look through documentation and find examples on your own by now.
    – Derek F
    Commented Feb 16, 2023 at 13:30

2 Answers 2

0

The correct syntax for using prior value for picklist fields is-

ISPICKVAL(PRIORVALUE(Field), 'Value')

Update your formula as given below-

ISPICKVAL(PRIORVALUE(Opportunity.Status__c), 'Exported')
0

As mentioned in the Error You have one Extra ) at the end . Can you try this.

  PRIORVALUE(([Opportunity].Status__c ), "Exported")

If Status is picklist field then you have to use ISPICKVAL() function as well like below.

 ISPICKVAL( PRIORVALUE([Opportunity].Status__c), 'Exported')

As per the updated question your if current values is Exported then only you should be able to change it to Delivered.

Which means the validation should be as below.

AND(ISPICKVAL(Opportunity.Status__c,'Delivered'), NOT( ISPICKVAL( PRIORVALUE(Opportunity.Status__c), 'Exported')))

This check if we are changing Status to Delivered and prior value is not Exported it shows the Error

8
  • This is picklist and when i use ispickval this is showing error The formula expression is invalid: Formula result is data type (Boolean), incompatible with expected data type (Text). Commented Feb 16, 2023 at 12:56
  • Can you edit the question and confirm what should be the output of the formula? Commented Feb 16, 2023 at 12:56
  • after exported next status is delivered. so if prior status is not exported then it should not changed to delivered Commented Feb 16, 2023 at 13:00
  • Do you need validation rule for this? Commented Feb 16, 2023 at 13:01
  • yes, i need this Commented Feb 16, 2023 at 13:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .