Hi,
Help me with this error
Thanks
Discussion posts and replies are publicly visible
It's saying that no value was passed into the input 'propertyID_int' in the rule 'BGH_queryPropertyByPropertyId'
But I could find the error
The error message you're getting is saying that at run-time you are not passing an actual value to the Query Rule, where the Query Rule is expecting a value. The error lies in the UI where you're calling this Query rule.
=with( local!property_cdt: if( rule!APN_isBlank(ri!propertyID_int), {}, rule!BGH_queryPropertyByPropertyID( if(or( ri!partnerDirect_text=cons!BGH_LEAD_SEARCHRESULT_TYPE_DIRECT, ri!partnerDirect_text=cons!BGH_LEAD_SEARCHRESULT_TYPE_PARTNER, ri!partnerDirect_text=cons!BGH_LEAD_SEARCHRESULT_TYPE_EXTRANET ), ri!propertyID_int, rule!BGH_getSNAPPropertyIdByWebsiteId(ri!propertyID_int) ) ) ), local!latitude_dec: if( rule!APN_isBlank(local!property_cdt), 0, index( local!property_cdt, "latitude_dec", {} ) ), local!longitude_dec: if( rule!APN_isBlank(local!property_cdt), 0, index( local!property_cdt, "longitude_dec", {} ) ), local!cityName_text: if(and( local!latitude_dec = 0, local!longitude_dec = 0 ), {}, if(rule!APN_isBlank( local!property_cdt.cityID_int), rule!BGH_getCityNameFromLatLng( latitude: local!latitude_dec, longitude: local!longitude_dec ), index( rule!BGH_queryCityByCityId(local!property_cdt.cityID_int), "name_text", "" ) ) ), if( or( ri!partnerDirect_text = cons!BGH_LEAD_SEARCHRESULT_TYPE_DIRECT, ri!partnerDirect_text = "BGH" ), a!documentImage( document: cons!BGH_ICON_DIRECT_PROPERTY, caption: cons!BGH_CAPTION_IMAGE_LEAD_PROPERTY_TYPE_DIRECT, link: a!safeLink(uri: if(or( rule!APN_isBlank(local!cityName_text), rule!APN_isBlank(local!property_cdt.name_text) ), cons!BGH_WEB_SERVER_URL, rule!BGH_constructPropertyPageURL( cityName_text: local!cityName_text, propertyName_text: local!property_cdt.name_text, webPropID_int: ri!propertyID_int, partnerDirect_text: ri!partnerDirect_text ) ) ) ), ri!partnerDirect_text = cons!BGH_LEAD_SEARCHRESULT_TYPE_PARTNER, a!documentImage( document: cons!BGH_ICON_PARTNER_PROPERTY, caption: cons!BGH_CAPTION_IMAGE_LEAD_PROPERTY_TYPE_PARTNER, link: a!safeLink(uri: if(or( rule!APN_isBlank(local!cityName_text), rule!APN_isBlank(local!property_cdt.name_text) ), cons!BGH_WEB_SERVER_URL, rule!BGH_constructPropertyPageURL( cityName_text: local!cityName_text, propertyName_text: local!property_cdt.name_text, webPropID_int: ri!propertyID_int, partnerDirect_text: ri!partnerDirect_text ) ) ) ), ri!partnerDirect_text = cons!BGH_LEAD_SEARCHRESULT_TYPE_EXTRANET, a!documentImage( document: cons!BGH_ICON_EXTRANET_PROPERTY, caption: cons!BGH_CAPTION_IMAGE_LEAD_PROPERTY_TYPE_EXTRANET, link: a!safeLink(uri: if(or( rule!APN_isBlank(local!cityName_text), rule!APN_isBlank(local!property_cdt.name_text) ), cons!BGH_WEB_SERVER_URL, rule!BGH_constructPropertyPageURL( cityName_text: local!cityName_text, propertyName_text: local!property_cdt.name_text, webPropID_int: ri!propertyID_int, partnerDirect_text: ri!partnerDirect_text ) ) ) ), ri!partnerDirect_text = cons!BGH_LEAD_SEARCHRESULT_TYPE_TRAVELERS, a!documentImage( document: cons!BGH_ICON_EXTRANET_PROPERTY, caption: cons!BGH_CAPTION_IMAGE_LEAD_PROPERTY_TYPE_EXTENDED, link: a!safeLink(uri: if(or( rule!APN_isBlank(local!cityName_text), rule!APN_isBlank(local!property_cdt.name_text) ), cons!BGH_WEB_SERVER_URL, rule!BGH_constructPropertyPageURL( cityName_text: local!cityName_text, propertyName_text: local!property_cdt.name_text, webPropID_int: ri!propertyID_int, partnerDirect_text: ri!partnerDirect_text ) ) ) ), a!documentImage( document: cons!BGH_ICON_TRANSPARENT, caption: "N/A" ) ) )
But in code its not throwing any error.
Since this is a run time error, it means that the value you pass to the rule is null. You have a variable defined as the input for the query rule (which is why there is no design-time error), but what is the actual value of that variable? My guess is that either ri!propertyID_int or the result of rule!BGH_getSNAPPropertyIdByWebsiteId(ri!propertyID_int) is null, which is why you are seeing this error.
Thank you for your response, Peter...
But the same run time error in the test environment it working therein, but another environment it is throwing an error and I am unable to find the root cause. Could you please help me with that.
I guess what I'm saying is that the problem is not really related to rule!BGH_queryPropertyByPropertyID - it's related to the other variables.
The best way to investigate this it to determine:
1) How is ri!propertyID_int getting populated? Is it possible it isn't getting passed a value so it is null?
2) Given you know that 1 is providing a value, what happens when that value is being plugged into rule!BGH_getSNAPPropertyIdByWebsiteId(ri!propertyID_int)?
You have to investigate the full lifecycle of how those variables are defined and what may cause them to not have the correct value.