Skip to content

Instantly share code, notes, and snippets.

@smcllns
Created June 26, 2014 08:49
Show Gist options
  • Save smcllns/cca19a4e3f978dee6b35 to your computer and use it in GitHub Desktop.
Save smcllns/cca19a4e3f978dee6b35 to your computer and use it in GitHub Desktop.
/*
Above is how you comment-out code
AND(For_Special_Order__c = TRUE, ISCHANGED(PBSI__Sales_Order_Line__c ), OR(PBSI__Sales_Order__r.Sales_Order_Status__c <> "CANCELLED"),PBSI__Sales_Order__r.Sales_Order_Status__c <> "RESERVED")
Below is how you end a comment
*/
/* I wanted to write you an example but keep yours here for comparison. Delete all comments when done. */
/*
What I think you're trying to accomplish - correct if wrong:
- if special order item
- and if either status is changed to cancelled
- or if quantity is changed
- but not if sales order is tenative or previously cancelled
*/
AND(For_Special_Order__c = TRUE,
OR(
ISCHANGED( PBSI__Total_Unit_Qty_Needed__c ),
AND(
ISPICKVAL( PBSI__Sales_Order__r.PBSI__Status__c, "Cancelled" ),
ISPICKVAL( PRIORVALUE(PBSI__Sales_Order__r.PBSI__Status__c), "Cancelled" )
)
),
NOT(
OR(ISPICKVAL( PBSI__Sales_Order__r.PBSI__Status__c, "Tentative" ),ISPICKVAL( PRIORVALUE(PBSI__Sales_Order__r.PBSI__Status__c), "Cancelled" )
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment