Hi ,
In the standard anyone has the idea how the line properties are getting filtered for the specific project, which method the standard is using to get the line properties for the specific project.
I have a requirement in which I need to get the line properties for the projcode as table for the specific project, I am able to achieve the functionality by using execute query method in ProjLinePropertySetup Form but I am getting all the project lines.
Thanks!!
Got it....Thanks!!
If you are calling line property form from ProjTable then element.args().caller() will return ProjTable as menu item.
Add your logic in the executeQuery method of line property DataSource.
//declare buffer globally ProjTable projTable; //form init method - get the caller record. Public void init() { if(element.args().menuitemName() == menuItemDisplaystr(ProjTable) || element.args().menuitemName() == menuItemDisplaystr(ProjProjectsListPage) { projTable = element.args().record(); } } public void executeQuery() { if(element.args().menuitemName() == menuItemDisplaystr(ProjTable) || element.args().menuitemName() == menuItemDisplaystr(ProjProjectsListPage) { /add ProjId and ProjRange. LineProperty_ds.queryBuildDatasource().addRange(fieldNum(LineProperty, ProjId)).value (queryValue(projTable.ProjId)); //ad project code. } if(element.args().menuItemName() == menuItemDisplaystr(LinePropertyMenuItem) { //add only proj code as range. } super(); }
Thanks,
Girish S.
Hi Girish ,
Suppose I have 2 menu items A and B. Please let me know where I can write the following code to get the menu item name and add the range if I m calling from Proj table.
Thanks!!
So, in that case you need to add range to the ProjId and ProjCode based on the caller form.
On your custom line properties from get the caller menu item - Based on the caller menu item you can add the range accordingly.
If the form is called from Line Property form add only ProjCode as a range.
If the form is called inside Proj table form add both ProjCode and ProjId as range.
To get the caller menu item you can use "element.args.menuItemName()".
Thanks,
Girish S.
I tried using the clear ranges, but it is not working as I am calling the form from 2 different path.
1. Project management and account-->setup-->line properties
Here I have created the exact new form similar to line properties and write one extra execute query method so that I can get all the records of type table in projcode. This functionality I am able to achieve.
2. The same form I am calling from all projects-->line properties(similar to old one).
But here also I m getting the same result as from above form, but here I need records related to specific project.
How can I achieve the second functionality.
Seems you have written code in the executeQuery method to add range to ProjCode field. On the same method try to call the clearRanges method of QueryBuildDataSource class and check.
DataSourceName_ds.queryBuildDataSource().clearRanges();
Thanks,
Girish S.
Thanks Girish.
But my requirement is to get the records whose projcode is table only.
How to achieve the same.
Thanks!!
Hi D365 ER,
Refer to the form ProjLinePropertySetUp method updateNow >> UpdateQuery >> projCodeRange - In this method they are adding range to all the fields.
If you want to see the output of the range - Click on filter option on "Valid for" column on the ProjLinePropertySet form - You will be able to see all the ranges added from the code.
Thanks,
Girish S.
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156