Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

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

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.

  • Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,417 on at
    RE: how to change the value of custgroup and get subgroupid in salestable form ax 2012

    Hi satendra singh,

    The code looks correct. One thing I can't see in the screenshot is if you have a break statement after the case statement for field "CustGroupId".

    Here you are setting the Sub-group Id to the value set for the same field in the customers form. If this code is still not setting the value for you, did you try to debug this method and check if the correct values are being fetched in this method?

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

    Hi Gunjan,

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

    pastedimage1604225003653v1.png

  • Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,417 on at
    RE: how to change the value of custgroup and get subgroupid in salestable form ax 2012

    Hi satendra singh,

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

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

    hi,

    Yes

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: how to change the value of custgroup and get subgroupid in salestable form ax 2012

    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?

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

    hi,

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

    yes.

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

    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

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: how to change the value of custgroup and get subgroupid in salestable form ax 2012

    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.

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

    Hi,

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

    pastedimage1604050917728v1.png

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,417 on at
    RE: how to change the value of custgroup and get subgroupid in salestable form ax 2012

    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.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,989 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,588 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans