Need help in making some fields mandatory based on one field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 10:16 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 10:20 PM
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?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader