Jump to content
  • 0
GIOVAN

Calculated Field Details Page change when checkbox is enabled

Question

Hello,

We need to approve all overtime hours. We can search from a Tabular report and then open Details Page to approve the overtime.

I want that when I checked BRW_Overtime_Approve. The field BRW_Overtime_Approved_Date = '[@cbTimestamp]' and field BRW_Overtime_Approved_by = '[@authfield:BRW_Employee_Full_Name]'.
I have done this with Calculated Field to get the info. Fields BRW_Overtime_Approved_Date  and  BRW_Overtime_Approved_Date are Hidden and On load, receive: Data Source Field CalculatedField1 and CalculatedField2.

CalculatedField1:

CASE WHEN [@field:BRW_OverTime_Approve]=1
THEN 
'[@authfield:BRW_Employee_Full_Name]'
ELSE
''
END

CalculatedField2:

CASE WHEN [@field:BRW_OverTime_Approve]=1
THEN 
'[@cbTimestamp]'
ELSE
''
END

The problem with this is that it works only when the datapage load, when we unchecked BRW_Overtime_Approve, CalculatedField1 and CalculatedField2 do not change automatically. Can anyone help me with this.

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Thanks George for taking the effort to do this.
I forgot that we choice Calculated Value in the Details Page.

I have done this, now I am getting the following 2 problems:

1. The formula for BRW_OverTimeAproved_by is good but the Details Page is showing System.Object instead of the Full_Name.

2. When I used the following formula for BRW_OverTime_Approved_Date the Calculated Value give the error the formula is not good.  BRW_OverTime_Approved_Date is an Date/Time field.

CASE WHEN [@field:BRW_OverTime_Approve]=1
THEN 
[@cbTimestamp]
ELSE
''
END

When I change [@cbTimestamp] in GetDate() the formula seems to be okay but on Details Page is showing also System.Object. I never got this System.Object Before.

Error_1.png

Error_2.png

Share this post


Link to post
Share on other sites
  • 0
CASE WHEN '[@field:BRW_OverTime_Approve]'=1
THEN 
'[@cbTimestamp]'
ELSE
''
END

I have discovered that behavior with System.Object When you have search section before Details Form. Regarding your second question, you should add '' to your formula

Share this post


Link to post
Share on other sites
  • 0

Thanks George for your reply. I added ' ' to the formula. Now this error is showing.

"Incompatible data type. The result of the formula is Text (255) but must be Date/Time."

Any idea why?

Error_3.png

Share this post


Link to post
Share on other sites
  • 0
On 3/22/2019 at 3:41 PM, GIOVAN said:

Thanks George for your reply. I added ' ' to the formula. Now this error is showing.

"Incompatible data type. The result of the formula is Text (255) but must be Date/Time."

Any idea why?

Error_3.png

What type of this field in your table?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...