i have 2 types of invoices X & Y and i created my own document definition from flexi layout studio which contains couple of fields say
1.Date 2. ID 3. Total Amount 4. Identifier
Difference between 2 invoices is where Identifier field will be not available in invoice X.
Date & ID are both mandatory fields in both the invoices X & Y and i made them as mandatory which is working fine.
Now Total Amount is mandatory for the invoice X where Identifier field is not available and the same way Total Amount is not mandatory for the invoice Y where identifier is available.
Here i am unable to make TotalAmount as mandatory for only Invoice X. Below is the code i have added in the field level rules (TotalAmount) in the document definition. Can you please help here.
if (( Context.Field("Identifier").Text == "" )& (Context.Field("TotalAmount").Text == ""))
Context.Field("TotalAmount").Value = false;
Context.CheckSucceeded = false;
Context.ErrorMessage = FCTools.LocalizedStrings.Get( "REQUIRED_FIELD_NOT_F" );
Please suggest here how to make the totalamount field as mandatory for one type of invoice.
Note:TotalAmount is single field in document def using for both the invoices.
Thanks in advance.