The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Need help in making some fields mandatory based on one field

Vrashikesh
Giga Contributor

Hello There,
xml : 
<urn:AmountAccepted>?</urn:AmountAccepted> (Required if receiving by amount)

<urn:AmountCurrency>?</urn:AmountCurrency> (Required if receiving by amount)

<urn:AmountRejected>?</urn:AmountRejected> (Required if receiving by amount)

<urn:Comment>?</urn:Comment> (Optional)

<urn:DateOfDelivery>?</urn:DateOfDelivery> (Optional)

<urn:IsReceivingByCount>?</urn:IsReceivingByCount> (Required)

<urn:LineExtrinsics>?</urn:LineExtrinsics> (Optional)

<urn:NumberAccepted>?</urn:NumberAccepted> (Required if receiving by count)

<urn:NumberRejected>?</urn:NumberRejected> (Required if receiving by count)

In above xml if isreceivingbycount is true then i want to mark NumberAccepted and NumberRejected are required.
if isreceivingbycount is false then I want to mark AmountAccepted, AmountCurrency, AmountRejected as required 

can anyone help me to write a JS code for this in servicenow actions.
NOTE: I am using SOAP API in this action 
Thanks in advance 


1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@Vrashikesh 

you need to parse and get value for each tag and validate it

you can use SOAP parser

what did you start with and where are you stuck?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader