How should I add the code to the application's script that is already there? After entering the specific code, the currency field must automatically populate. I'm new to C#, so I have no idea how to add the code.
The code that is currently being used on the application is shown below.
//Parameters:
//DataPool data
//ITrace trace
//pick the first four digits from barcode number as company code;
foreach (Document doc in data.RootNode.Documents)
{
//definition of fields
Field Bcode = (Field)doc.Fields["BarCode"];
Field Coco = (Field)doc.Fields["CompanyCode"];
Field Dpay = (Field)doc.Fields["ZDC_DOWNPAYMENT"];
Field Vendmt = (Field)doc.Fields["ZDC_VEND_MAINT"];
//if there is no barcode or improper barcode, assign "0000" as default barcode value,
//which is used as default company code;
//Coco.Value = Bcode.Value.Substring(0,4); - seem to cause stuck at ocr when placed here
//Coco.State = DataState.Ok;
Coco.Value = "----";
Coco.State = DataState.Ok;
if (Bcode.Value.Length < 5)
{
//Bcode.Value = "00000" ;
Bcode.Value = "" ;
//Bcode.Value = "10100" ;
//Coco.Value = "0000";
//Coco.State = DataState.Ok;
}
else
{
//Coco.Value = Bcode.Value.Substring(0,4);
//Coco.State = DataState.Ok;
}
//Coco.Value = Bcode.Value.Substring(0,4);
//Coco.State = DataState.Ok;
If I entered this code 1010, 1020, 1030 like shown below photo.
The currency must auto populate into USD not manually entered.