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, ...
Answered

how to change the value of custgroup and get subgroupid in salestable form ax 2012

(0) ShareShare
ReportReport
Posted on by 5

pastedimage1604049439643v1.png

 hi,

I add two fields in sales table  custgroup, subgroupid. from--- i change the value of customer group field select 10 custgroup than subgroupid is not selected same cutomergroup.

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Hi,

    I assume this "sub group" is some customization. Since it's a property of Customer group, it actually doens't necessarily make sense to copy it to the sales order. Otherwise you are duplicating data, and risk having wrong data as you have just described.

    But, you can add logic in insert and update methods to always initialize the sub group from CustGroup to solve your problem. But please consider one more time if it is a good idea to duplicate this data.

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi satendra singh,

    Is Sub group Id a customized field? You will need to write your code in Tables\SalesTable\modifiedField method to assign the new sub group Id whenever the customer group is changed.

  • satendra singh ax Profile Picture
    5 on at

    Hi,

    i modify the custgroup like that i selected coustmergroup 10 than sub groupid  field  default select first value .

    pastedimage1604050917728v1.png

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    I'm sorry but I don't understand.

    Do you want to automatically set subgroup, based on the selected customer group?

    Or do you want to only show subgroups related to specific customer group in the lookup?

    If you just want to impact the lookup, make sure that you have properly defined table relations between your SalesTable fields and Customer sub group table. The relation should include customer group id and customer sub group id. Then the user can only select such subgroups that are related to the already selected customer group.

  • satendra singh ax Profile Picture
    5 on at

    Hi Gunjan,

    Sub Group Id is Customized field. whenever i changed  the  customer group that time sub groupid  default first value select .

    pastedimage1604051673279v2.png

    pastedimage1604051617600v1.png

  • satendra singh ax Profile Picture
    5 on at

    hi,

    Do you want to automatically set subgroup, based on the selected customer group?

    yes.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Ok, then just add your code in the modifiedField method of SalesTable.

    If modified field is CustGroupId, select first customer sub group that has the same customer group id, and put that in the sub group field. Is it clear?

  • satendra singh ax Profile Picture
    5 on at

    hi,

    Yes

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi satendra singh,

    Were you able to get this working? Or are you still facing any issues?

  • satendra singh ax Profile Picture
    5 on at

    Hi Gunjan,

    I am writing the code in SalesTable /Methods /ModifiedField. Still I am facing this issue.

    pastedimage1604225003653v1.png

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 551 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans