Currency field shows different value when fetched as Reference column
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 03:35 AM
Hello Team,
Can you help me to guide, why the value is different when field added to view as reference field?
Problem Statement: On [Expense Lines] entity's view I have added a reference column "TimeCard.ResourcePlan.SalesRates", which is showing value in base currency and not the value!
Expected outcome: column "TimeCard.ResourcePlan.SalesRates" should show value as there on resource plan that is Project specific currency
Actual outcome: column "TimeCard.ResourcePlan.SalesRates" is behaving wired as the value is appearing in converted base currency rather than as specified in project.resourceplan!
- Labels:
-
Project Portfolio Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 01:38 AM
Hello All, Please guide on same this is closed as solved but still waiting for expert advice on same. Thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2024 12:13 PM
Hey @shikhagrover ,
I faced a similar issue before. I used the below steps to get it resolved:
- Go to the `Expense Lines` table.
- Open the view where you added the reference column.
To address the currency issue:
- Verify the field `TimeCard.ResourcePlan.SalesRates` is correctly referenced.
- Check the `TimeCard` table for currency settings.
- Ensure `ResourcePlan` settings are correct for project-specific currency.
If the issue persists, consider these steps:
- Create a new `Business Rule` on the `Expense Lines` table.
- Set `When` to `before` and `query`.
- Add a `Condition` if necessary to target specific records.
- In the `Script` field, add:
// Fetch the SalesRates in project-specific currency
var resourcePlan = new GlideRecord('resource_plan');
if (resourcePlan.get(current.time_card.resource_plan)) {
current.time_card.resource_plan.sales_rates = resourcePlan.sales_rates;
}
Alternatively, you can create a `Calculated Field`:
- Navigate to `System Definition` > `Dictionary`.
- Find or create an entry for the `Expense Lines` table.
- Set `Type` to `Calculated`.
- In the `Calculated Value` field, add:
// Calculate the sales rates in project-specific currency
var resourcePlan = new GlideRecord('resource_plan');
if (resourcePlan.get(current.time_card.resource_plan)) {
answer = resourcePlan.sales_rates;
} else {
answer = 0; // Default value if not found
}
Give this a try, and let me know if it doesn't work, I'd be happy to assist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 04:17 AM
Would be really helpful if I get the confirmation that currency field(when created custom) behaves the same way as mentioned in problem statement, by design? So accordingly I can raise the ticket with SNC and for now check on suggested workaround.
I just want to be sure that this is by design/function or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 01:02 AM
Thanks a lot for taking time, looking into the problem and suggesting the workaround.
As suggested, I have verified the table references and column settings all are good as offered by SNC. Even though this Currency field(Saled Rate) when referred (as dot walked) is showing the behavior that is such column shows stored value (value stored table with base currency and not as per project currency).
Could you reproduce same behaviour on PDI and confirm if this is by design? As suggested workaround would be an overhead on system to get the values.