Display of Task ID Values in Custom Field 'Revenue Task' on Project Screen
Hi Team,
In the project screen, specifically in the Revenue Budget tab, I've included a custom field named "Revenue Task." I want this custom field to display values from the Task ID field in the Task tab. The current selector setup shows the value, but it only appears after saving the project. However, I need the selector value in the custom field to display before the project is saved.
Here is my code:
public class PMBudgetExt : PXCacheExtension<PX.Objects.PM.PMBudget> { #region UsrRevenueTask
Also set the field commitchanges=true, then also not getting values display in selector before the save.
I am getting the selector but in that the values are not displaying before save the project.
I’m not sure why you are duplicating the revenue task when revenue budget already has a task built in. But anyways why don’t you just copy the revenue task and its properties from PMBudget and add a Usr to the beginning and do the same for the page control instead of inventing wheel.
@aaghaei ,
Thank you for your response.
I'm trying to add the cost-type tasks to my custom selector “CostTask” in the revenue budget tab, but I'm still having trouble with the saving—it only saves after the project is saved.
Below is the image where I have taken the taskid , but in the custom selector of the revenue budget tab, the data isn't showing up.
I checked other standard selectors, and when changes are made in certain fields, the selector gets populated with updated data before saving.
Is I am missing something in custom selector code or need to set the specific properties.
public virtual int? UsrRevenueTask { get; set; } public abstract class usrRevenueTask : PX.Data.BQL.BqlInt.Field<usrRevenueTask> { }
#endregion
}
I have also set property AutoRefresh= True for the custom field.
If I’m understanding correctly, your selector is not pulling the new record because it is still in the cache and not yet committed to the database. I think that you need to add DirtyRead = true to your PXSelector as per this blog post.
Oh this is what you mean. In addition to the dirty read, You will need to set AutoRefresh = True in your page field properties.
@Django , @aaghaei ,
Thanks for your response, it has been worked .
Even though the selector displays the data, it's causing an error when I choose something from it, saying that "Revenue Task" can't be found in the system.
After that, when I save it, there aren't any errors displayed. It giving on first time selection.