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
Karthikeyan ChandranKarthikeyan Chandran 

How to update a Text field with $ or %?

Hi All,

I have a picklist field "Closing Fee Values" with values Amount,Percentage. i just want to display the symbol in prefix($), suffix(%) in the value entered in the text field 'Closing Fee' (Numbers).

Ex: 
Closing Fee Values - Amount
Closing Fee - 100

After saving the record field 'Closing Fee' value should display '$100'

Can this possible?

Thanks & Regards,
Karthikeyan Chandran
Best Answer chosen by Karthikeyan Chandran
Karthikeyan ChandranKarthikeyan Chandran
Hi william,

My appologise that i haven't replied back to you on this conversation,the issue got resolved by Deepak and i got answer from success community.

Here the solution - 
Workflow Rule specs - 

Evaluation Criteria: created and every time it's edited [2ND OPTION]
Rule Criteria: formula evaluates to true
Formula: 
AND( OR( ISNEW(), ISCHANGED(Closing_Fee__c), ISCHANGED(Closing_Fee_Values__c) ), NOT(ISBLANK(Closing_Fee__c)), NOT(ISBLANK(TEXT(Closing_Fee_Values__c))) )

Field Update specs - 

Formula: 
IF( TEXT(Closing_Fee_Values__c) = "Amount", "$" + SUBSTITUTE( SUBSTITUTE( Closing_Fee__c, "$", "" ), "%", "" ), SUBSTITUTE( SUBSTITUTE( Closing_Fee__c, "$", "" ), "%", "" ) + "%" )

URL - https://success.salesforce.com/answers?id=90630000000wkgyAAA 

Thanks & Regards,
Karthikeyan Chandran

All Answers

William TranWilliam Tran
Are you referring to out of the box layout or VF page?

I have a picklist field "Closing Fee Values" with values Amount,Percentage?  what does this mean =  $100%  or $100, 50% or ?

Ex: 
Closing Fee Values - Amount
Closing Fee - 100

I don't under this example

thx
Karthikeyan ChandranKarthikeyan Chandran
Hi william,

My appologise that i haven't replied back to you on this conversation,the issue got resolved by Deepak and i got answer from success community.

Here the solution - 
Workflow Rule specs - 

Evaluation Criteria: created and every time it's edited [2ND OPTION]
Rule Criteria: formula evaluates to true
Formula: 
AND( OR( ISNEW(), ISCHANGED(Closing_Fee__c), ISCHANGED(Closing_Fee_Values__c) ), NOT(ISBLANK(Closing_Fee__c)), NOT(ISBLANK(TEXT(Closing_Fee_Values__c))) )

Field Update specs - 

Formula: 
IF( TEXT(Closing_Fee_Values__c) = "Amount", "$" + SUBSTITUTE( SUBSTITUTE( Closing_Fee__c, "$", "" ), "%", "" ), SUBSTITUTE( SUBSTITUTE( Closing_Fee__c, "$", "" ), "%", "" ) + "%" )

URL - https://success.salesforce.com/answers?id=90630000000wkgyAAA 

Thanks & Regards,
Karthikeyan Chandran
This was selected as the best answer