Email button with code not working | Community
Skip to main content
ReluctantProgrammer
Level 4
December 16, 2022
Solved

Email button with code not working

  • December 16, 2022
  • 1 reply
  • 668 views

I have a form that has an email with code that prompts an error when a required field is not populated.  A request came through from the owner asking for creation of a drop down field (Invoice Type) that has 3 choices.  Based on which choice is selected, certain fields appear and are required.  They can't be set as required up front because they aren't always shown.  Anyway, I've set the fields so they appear when they should and the fields are noted as required but now the email button does not work. Could there be conflicting logic between the email button and the code in the Invoice Type? I don't think the new fields can be coded into the email button but I really don't know.  This is way beyond my knowledge or comprehension.  I appreciate any guidance. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Vijay_Katoch

In your email button script, correct the below line:

in the below code, check you're if statement code:

if (form1.Page1.ddInvoiceType.rawValue== null)
{
xfa.host.setFocus(form1.Page1.ddInvoiceType.rawValue);
form1.Page1.ddInvoiceType.border.edge.color.value = "230,0,0";
}

 

Check the somExpression in below code:

I have corrected this:

cSubject: "INV: " + Page1.subAgencyAddress.LocalPublicAgency.rawValue + " " + Page1.subNumbersDate.StateJobNo.rawValue,

 

Fix these two points, your email functionality will work.

1 reply

Vijay_Katoch
Community Advisor
Vijay_KatochCommunity AdvisorAccepted solution
Community Advisor
December 22, 2022

In your email button script, correct the below line:

in the below code, check you're if statement code:

if (form1.Page1.ddInvoiceType.rawValue== null)
{
xfa.host.setFocus(form1.Page1.ddInvoiceType.rawValue);
form1.Page1.ddInvoiceType.border.edge.color.value = "230,0,0";
}

 

Check the somExpression in below code:

I have corrected this:

cSubject: "INV: " + Page1.subAgencyAddress.LocalPublicAgency.rawValue + " " + Page1.subNumbersDate.StateJobNo.rawValue,

 

Fix these two points, your email functionality will work.