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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

CredManCreditMax

(1) ShareShare
ReportReport
Posted on by 484
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?
I have the same question (0)
  • Suggested answer
    Jonas "Jones" Melgaard Profile Picture
    4,985 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
    484 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
    4,985 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
    484 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
    4,985 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
    484 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
    4,985 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,351 Super User 2025 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
    4,985 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

Responsible AI policies

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

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans