How to disable the Tax3 field of Sales Order screen if the customer is not TCS Applicable

By | May 27, 2021

There was a requirement from the user to add a check box on Customer master as “TCS Applicable” and “Tax Level 3” field of detail line on the Sales Order screen should be activated only when the “TCS Applicable” check box for any customer is ticked, otherwise it should be disabled.

To achieve the above requirement follow the below steps:
Step 1:
Go to OBPC(Customer) window and add a checkbox on header screen and name it as “TCS Applicable” as per below screenshot:

New Stuff: Error: “Too Many Tables open” in Sage X3

Customer Master
Customer Master

Step 2:
Add below code to “SPESOH” script in $APRES_MODIF event:

#####################################################################################

IF !Clalev([F:ZBPC]) : Local File BPCUSTOMER[ZBPC] Endif
FOR [F:ZBPC] WHERE [F:ZBPC]BPCNUM=[M:SOH0]BPCORD

IF[M:SOH0]BPCORD=[F:ZBPC]BPCNUM AND [F:ZBPC]ZTCS <> 2
Diszo [M:SOH4] VACITM3
Endif

NEXT

######################################################################

Step 3:
Compile the “SPESOH” script.

Output:

Output
Output

In the above screenshot the “Tax level 3” field is disabled because the customer is not “TCS Applicable” (TCS Applicable check box is not checked for this customer in cusstomer master).

In this way we can activate a tax field only when the selected Customer is TCS Applicable.