Auto Value - Miscellaneous Charges

Hello,

In the sales order lines (DAX 2009), button: SETUP> MISCELLANEOUS CHARGES
When inserting a new burden, would like to see the group of automated sales tax item.
As for the charge code = “FREIGHT SAID”, the tax group should be the Order Item.
In the form MarkupTrans, I thought of putting something like this:

    if (markupTrans.MarkupCode == 'FREIGHT SAID')
      {
      markupTrans.TaxChargeItemGroup = 1; 
      } 
But it did not work because when you select FREIGHT SAID, it does not automatically change the group field sales tax item, which is a BaseEnum. 
![0245.444004.png|1128x218](upload://drvkBOyOmRiH5DHuNJMRHOwe5AZ.png)

Thanks

I can see taxItemGroup that can be defaulted from the misc charge code, but what is this taxChargeItemGroup?

Friend, taxChargeItemGroup is “BaseEnum” I quoted above.
I want to leave as “1” when selecting “SHIPPING SAID” in the combobox.

Hugs

So, you want your enum field to be filled based on the chosen markup code? If so i would suggest having a setup for the markup code(rather than hard coding). Store the value against the markup code(MarkupTable). So that it can be defaulted from the mark up code by having the code in \Data Dictionary\Tables\MarkupTrans\Methods\initFromMarkupTable

Friend,
I did as you indicated, but still did not work.
This is the code already exists in the table below.
Stated correctly?
Hugs.

void initFromMarkupTrans(MarkupTrans source)
{
this.ModuleType = source.ModuleType;
this.MarkupCategory = source.MarkupCategory;
this.LineNum = source.LineNum;
this.Txt = source.Txt;
this.MarkupCode = source.MarkupCode;
this.CurrencyCode = source.CurrencyCode;
this.MarkupCode = source.MarkupCode;
this.TaxChargeItemGroup = source.TaxChargeItemGroup;

if (this.MarkupCode == ‘FRETE SAID’)
{
this.TaxChargeItemGroup = 1;
}

//
if (TaxParameters::checkTaxParameters_IN())
{
this.TaxGroup = ‘’;
this.TaxItemGroup = ‘’;
}

else
{
//
this.TaxGroup = this.TaxGroup ? this.TaxGroup : source.TaxGroup;
this.TaxItemGroup = this.TaxItemGroup ? this.TaxItemGroup : source.TaxItemGroup;
if (!this.taxCombinationAllowed())
this.TaxItemGroup = ‘’;

//
this.TaxChargeItemGroup = source.TaxChargeItemGroup;
//
//
}
//
this.Keep = source.Keep;
}

The value you set is being overwritten in else (if it goes to else)

rather than assigning the value, use **TaxChargeItemGroup::**yourenumvalue (select from the list of enum values)

Kranthi,

So I commented out the line of a customization that says:

this.TaxChargeItemGroup = source.TaxChargeItemGroup;

I left my new same like this:

if (this.MarkupCode == ‘SAID FREIGHT’)
{
this.TaxChargeItemGroup = 1;
}

Still did not work …
I understand correctly what you suggested or not?
Sorry for the confusion.

avoid doing this kind of assignment for enum fields, see \Data Dictionary\Tables\MarkupTable\Methods\initValue

If you still see a problem, try to debug the method and see how the value is being updated.