web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

In ER format mapping, can you use IF to conditionally bind different lists to a Range?

(0) ShareShare
ReportReport
Posted on by 139

For simplicity, let's say my ranges and cells are as follows:

InvoiceLines_TypeItems
----InvoiceLines_TypeItems_Rows
--------InvoiceLines_TypeItems_Rows_Description
--------InvoiceLines_TypeItems_Rows_Quantity
--------InvoiceLines_TypeItems_Rows_NetAmount
----InvoiceLines_TypeItems_TotalAmount

We have 4 invoice itemisation formats, but for simplicity let's say we have 2: all transactions listed (description, quantity, and netamount are taken directly from the model, per line) vs rolled up into categories (description = category, quantity and netamount are summed)

If we duplicate the ranges for each itemisation format and use the Enabled flag to control which range gets printed, it turns out in our performance tracing that everything gets executed anyway, and the Enabled flag merely controls visibility but not ER execution. In our actual format mapping with everything we're printing and the 4 itemisation formats, this is causing invoice printing time to double what it would be if it didn't execute the parts that don't need to be printed.

SO, I need to combine ranges where the display looks the same, and use ER to conditionally bind different things to the same range/cell. Which means the second range, "----InvoiceLines_TypeItems_Rows", needs to bind to different lists because the "all transactions" list and the "grouped by category" list are different. Further on for the child cells (description, quantity, netamount), I need to again bind different things to them conditionally.

This is my formula for the range ----InvoiceLines_TypeItems_Rows:

----InvoiceLines_TypeItems_Rows = 
IF(model.InvoiceFormat="Summary", 
model.'$ProjectList'.'$Items'.'$LineItems_byCategory', 
model.'$ProjectList'.'$Items'.'$LineItems')

I am having difficulty getting this range conditional binding to work (I have no problem with the child cells conditional binding). Has anyone successfully tried to conditionally bind different lists to a Range element in ER format mapping?

I have the same question (0)
  • Jeremy Driscoll Profile Picture
    on at
    RE: In ER format mapping, can you use IF to conditionally bind different lists to a Range?

    Hi Lexicon_

    Without testing this, it seems like the If statement should work correctly. Are you seeing error messages? What are the results of trying to bind to the range this way?

    Thanks,

    Jeremy Driscoll

    Microsoft Support Engineer

  • Suggested answer
    Alireza Eshaghzadeh Profile Picture
    14,637 Super User 2025 Season 2 on at
    RE: In ER format mapping, can you use IF to conditionally bind different lists to a Range?

    Hi Lexicon_ ,

    If you want to use "PSAInvoiceFormats" on Project Proposal journal, you should use enum and not string. You can use following:

    • Detailed invoice(DetailInvoice)
    • Summary invoice by category(SummaryByCategory)
    • Summary invoice(SummaryInvoice)
    • User defined(ManageInvoice)

    Regarding your formula for InvoiceLines_TypeItems_Rows, Where do you want to create this calculated field for the conditional binding (e.g.  on model mapping designer  or format designer)? Do you get an error message by saving the formula?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 813

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 738 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 566 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans