Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

how the line properties are coming for the specific project

(0) ShareShare
ReportReport
Posted on by 167

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!!

  • D365 ER Profile Picture
    D365 ER 167 on at
    RE: how the line properties are coming for the specific project

    Got it....Thanks!!

  • Verified answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: how the line properties are coming for the specific project

    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.

  • D365 ER Profile Picture
    D365 ER 167 on at
    RE: how the line properties are coming for the specific project

    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!!

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: how the line properties are coming for the specific project

    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.

  • D365 ER Profile Picture
    D365 ER 167 on at
    RE: how the line properties are coming for the specific project

    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.

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: how the line properties are coming for the specific project

    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.

  • D365 ER Profile Picture
    D365 ER 167 on at
    RE: how the line properties are coming for the specific project

    Thanks Girish.

    But my requirement is to get the records whose  projcode is table only.

    How to achieve the same.

    Thanks!!

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: how the line properties are coming for the specific project

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,160 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans