Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Can't use Evaluate () in Custom Function?


Kent_S

Recommended Posts

I'm trying to figure out why I can't use the Evaluate () function in a custom function (at least in the way I want). Here's what's going on...

 

I downloaded a sample file from http://www.databasepros.com (created by Reed Wycuff) of this nifty little ChangeLog2, which shows how to use a single auto-enter calc to create a change log. While looking at the formula, I thought it would be really cool to make it into a more modular Custom Function. I took the original formula of:

 

Let([x = Evaluate("Get(ActiveFieldContents)";[ Text;Number;Date;Time ]);y = " Text:Number:Date:Time "];(

 

Case(

 

PatternCount(y;Get(ActiveFieldName));

 

"- " &

 

GetAsText(Get(CurrentDate)) & " | " &

 

GetAsText(Get(CurrentTime)) & " | " &

 

Get(AccountName) & " | " &

 

Get(ActiveFieldName) & " = " &

 

x &

 

Case(not IsEmpty(Log);"¶") & Log

 

)))

 

and tried to substitute the actual names of the fields (shown above as Text;Number;Date;Time)with Function Parameters (field1;field2 ) I defined in the Custom Function dialog, as you'll see in the following:

 

Let ( [x = Evaluate("Get(ActiveFieldContents)";[ field1;field2 ]);y = Substitute ( " field1;field2 " ; ";" ; ":")];

 

Case(

 

PatternCount(y;Get(ActiveFieldName));

 

"- " &

 

GetAsText(Get(CurrentDate)) & " | " &

 

GetAsText(Get(CurrentTime)) & " | " &

 

Get(AccountName) & " | " &

 

Get(ActiveFieldName) & " = " &

 

x &

 

Case(not IsEmpty(logField);"¶") & logField

 

))

 

I figured that in doing it this way there'd be no chance of one field name occurrence not jiving with the other occurrence in the formula, thus making setup and maintenance of the log really simple.

 

Thanks in advance for any suggestions offered!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...

Important Information

Terms of Use