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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

CredManCreditMax

(1) ShareShare
ReportReport
Posted on by 560
Hi,
 
In the customer form there is a field called "total credit limit" which comes from a display method called credManCreditMax
 
If I have a class where i need to return that value for a certain customer, how can I do that? Do i need to replicate the logic inside this display method in my new class? Or is there another way?
  • Suggested answer
    Jonas "Jones" Melgaard Profile Picture
    5,016 Most Valuable Professional on at
    Hey
    I think it's this field, right?
     
    Nope, I'll just call the creditMax method on CustTable directly, it will do the same. Much of Credit Management is internal so it's not easy to deal with.
     
     
     
     
  • DELDYN Profile Picture
    560 on at
    Hi Jonas,

    yes that's the field, and the method is called credManCreditMax and not creditMax

    you mean i should call creditMax method directly without anything else like this?? as it's calling credManCreditMax in the extension? 

    like this:
    CustTable::creditMax(_custAccout);
     
  • Jonas "Jones" Melgaard Profile Picture
    5,016 Most Valuable Professional on at
    Yes, exactly.
    The CoC extension to the method will handle scenarios where Credit Management is enabled and then call the credManCreditMax for you.
  • DELDYN Profile Picture
    560 on at
    Hi,
     
    So this total credit limit field won't appear in the customer form if this feature is not enabled?
     
    I just want to make sure that it will always return the correct value
  • Jonas "Jones" Melgaard Profile Picture
    5,016 Most Valuable Professional on at
    Exactly, if the credit management feature is disabled it will not show the "CredMan" fields in the form, only the old credit max fields.
     
    So for the most correct value, it's best to call the creditMax method on CustTable.
  • DELDYN Profile Picture
    560 on at
    Hi,

    But in this case, if the credMan feature is disabled, it means it will return another value as per the original method
     
    but in reality CredManCreditMax doesn't appear in the form because the feature is diabled, so shouldn't I return 0 in this case?
  • Jonas "Jones" Melgaard Profile Picture
    5,016 Most Valuable Professional on at
    No, I don't think so.
     
    If you have deactivated the credit management feature, the original CreditMax field will be showed.
    In that case, you will have a value in the original Credit Max field that is visible on the customer form, but your method will return 0.
  • Suggested answer
    Saif Ali Sabri Profile Picture
    2,820 Super User 2026 Season 2 on at

    You can instantiate the form’s data source table (CustTable, for example) and directly call the display method on it, which would avoid duplicating logic. For example:

    CustTable custTable = CustTable::find(yourCustomerAccount);
    CreditLimitType totalCreditLimit = custTable.credManCreditMax();

    This approach keeps the logic consistent with the display method, so any updates in the credManCreditMax method will automatically reflect wherever you call it.

  • Jonas "Jones" Melgaard Profile Picture
    5,016 Most Valuable Professional on at
    The issue here is that credManCreditMax method has the access modifier "internal", meaning that it is only available from inside the "Credit Management" model; You cannot call it from other models.
    Hence why we need to call the public display method "CreditMax", that then calls the Credit Management display method if that feature is enabled.
     
    Your code will most likely not compile.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 415 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 374

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 365 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans