You need to sign in to do that
Don't have an account?
Feel Free To Ask
Validation Rule : When field "X" is changed, I want "Y" field equal to "Z".
I want to create a validation rule in the account object.
I have two text data type fields. I have tried with workflow it is working fine but need a validation rule for this.
When field "Location" is changed, I want "Status" field equal to "Moved".
Please guide me on this. Thanks for help.
I have two text data type fields. I have tried with workflow it is working fine but need a validation rule for this.
When field "Location" is changed, I want "Status" field equal to "Moved".
Please guide me on this. Thanks for help.
Actually, Validation rule use to prevent the user if criteria does matched as mentioned in Validation rule and Display Error message.
So here Validation rule will not work. Please use Workflow as well.
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
All Answers
Actually, Validation rule use to prevent the user if criteria does matched as mentioned in Validation rule and Display Error message.
So here Validation rule will not work. Please use Workflow as well.
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
validation rule is used for restrict user to update,delete and insert record based on criteria matches . if you don't want to use workflow then you can use formula field if status datatype is text but if status is picklist then you can use process builder or flow builder.
but I think workflow is good approach.
let me know if you are satisfie with my answer.
don't forget to mark it as best answer.
Thank you
public class printpdf {
public List<QuoteLineItem> prd{get;set;}
private final ApexPages.StandardController theController;
public printpdf(ApexPages.StandardController controller) {
theController = controller;
prd = [Select Id , QuoteId, Product2Id, Product2.Name, Product2.Description, Product2.ProductCode, Product2.Cross_Distr_Channel_Status__c, Product2.GB_Enterprise_Prod_Hier_Level_5__c from QuoteLineItem where QuoteId=:thecontroller.getId()];
}
}
@isTest
public class printpdfTests {
@testsetup static void data_setup(){
QuoteLineItem prd= new QuoteLineItem();
prd.Id = '0Q01N000001FMNfSAO';
prd.Product2.Name = '(20-0950)CORTRAK* 2 ENTERAL ACCESS SYSTEM';
prd.Product2.Cross_Distr_Channel_Status__c = 'S -Saleable';
}
@istest static void printpdf(){
List<QuoteLineItem> prd = [Select Id , QuoteId, Product2Id, Product2.Name, Product2.Description, Product2.ProductCode, Product2.Cross_Distr_Channel_Status__c, Product2.GB_Enterprise_Prod_Hier_Level_5__c from QuoteLineItem where QuoteId= '0Q01N000001FMNfSAO'];
printpdf.printpdf(prd);
}
}