- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2025 01:55 AM
This is my reference qualifier its not working:
"I am calling the Script Include, and it is returning the correct value, as verified in the background script. Can someone please assist?"
Script Include:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2025 02:17 AM
I hope you are well and good.
Okay, I've analyzed the Script Include code you've provided. Here's a breakdown of the issues and how to fix them, along with explanations:
Issues and Corrections
Incorrect Return Value in getVendorFilter():
Problem: The getVendorFilter() function is returning vendorcode which is just the code, not the encoded query to filter the Original Purchase Order.
Solution: You need to return an encoded query string that can be used by the reference qualifier to filter records. The format should be 'vendor_code=' + vendorcode.
getVendorFilter: function(userId) {
// ... (rest of your code) ...
if (vendorGR.next()) {
var vendorcode = vendorGR.vendor_code.toString();
gs.info("Vendor Code: " + vendorcode); // Log for debugging
// Return the encoded query string
return 'vendor_code=' + vendorcode;
}
// Return an empty string or a default query if no vendor is found
return ''; // Or return a query like 'vendor_code=INVALID';
},
If you like this opinion and your problem is resolved after reviewing and applying it. Please kindly mark this your best answer(Accepted Solution) 🌠 OR mark it Helpful ⛑ if you think that you get some insight from this content relevant to your problem and help me to contribute more to this community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2025 02:11 AM
Hello @gautam_dhamija
Are you able to get the vendorcode in syslog table?
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2025 02:17 AM
I hope you are well and good.
Okay, I've analyzed the Script Include code you've provided. Here's a breakdown of the issues and how to fix them, along with explanations:
Issues and Corrections
Incorrect Return Value in getVendorFilter():
Problem: The getVendorFilter() function is returning vendorcode which is just the code, not the encoded query to filter the Original Purchase Order.
Solution: You need to return an encoded query string that can be used by the reference qualifier to filter records. The format should be 'vendor_code=' + vendorcode.
getVendorFilter: function(userId) {
// ... (rest of your code) ...
if (vendorGR.next()) {
var vendorcode = vendorGR.vendor_code.toString();
gs.info("Vendor Code: " + vendorcode); // Log for debugging
// Return the encoded query string
return 'vendor_code=' + vendorcode;
}
// Return an empty string or a default query if no vendor is found
return ''; // Or return a query like 'vendor_code=INVALID';
},
If you like this opinion and your problem is resolved after reviewing and applying it. Please kindly mark this your best answer(Accepted Solution) 🌠 OR mark it Helpful ⛑ if you think that you get some insight from this content relevant to your problem and help me to contribute more to this community