function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
K_devK_dev 

Convert this trigger formula into workflow field update formula

Please convert into a formula that I can enter in a formula editor of workflow.

 

descString += posToUpdate.Name != NULL ? posToUpdate.Name : '' ;
descString += dbPosition.VanaHCM__Position_Title__c != NULL ? '-'+ dbPosition.VanaHCM__Position_Title__c: '' ;
descString += dbPosition.Hire_Type__c != NULL ? '-'+ dbPosition.Hire_Type__c.left(1): '' ;
descString += posToUpdate.Funding_Type__c != NULL ? + posToUpdate.Funding_Type__c.left(1): '' ;
descString += posToUpdate.Funding_Status__c != NULL ? + posToUpdate.Funding_Status__c.left(1): '' ;
descString += posToUpdate.Position_FTE__c != NULL ? '-'+posToUpdate.Position_FTE__c: '' ;
if(descString.startsWith('-') && descString.length() >0){
descString = descString.substring(1);

K_devK_dev

Is this one right 

Name'-' VanaHCM__Position_Title__c '-' Hire_Type__c.Left(1)AND Funding_Type__c.left(1)AND Funding_Status__c.left(1)'-' VanaHCM__FTE__c

K_devK_dev

Name &'-'& VanaHCM__Position_Title__c & '-' & LEFT(ISPICKVAL(Hire_Type__c,1)) & LEFT(ISPICKVAL(Funding_Type__c,1))& Left(ISPICKVAL(Funding_Status__c,1)) & '-' &  VanaHCM__FTE__c


 Error: Incorrect parameter type for function 'ISPICKVAL()'. Expected Text Literal, received Number

 

PLEASE CHECK THIS ERROR AND RESOLVE IT

 

K_devK_dev

Name &'-'& VanaHCM__Position_Title__c & '-' & LEFT(TEXT(ISPICKVAL(Hire_Type__c),1) & LEFT(TEXT(ISPICKVAL(Funding_Type__c),1)& Left(TEXT(ISPICKVAL(Funding_Status__c),1) & '-' & VanaHCM__FTE__c

 

 

Jeff TalbotJeff Talbot

Are you trying to get the first letter of each picklist value? If so, you don't want the ISPICKVAL function at all.

 

Name &'-'& VanaHCM__Position_Title__c & '-' & LEFT(TEXT(Hire_Type__c),1) & LEFT(TEXT(Funding_Type__c),1) & Left(TEXT(Funding_Status__c),1) & '-' & VanaHCM__FTE__c

 

If I'm wrong and you're trying for something else, then here's a couple of problems with your formula.

 

1) You're missing the text_literal part of the ISPICKVAL function:

 ISPICKVAL(picklist_field, text_literal)

 

2) The LEFT function you're using needs text, and you're giving it a true/false value (The ISPICKVAL function results in a value of true or false).