walkup up: reason for visit

chercm
Mega Sage

i created a widget page and make use of the following : 

 

i hard coded that when the user check in using scanning badge code or user id selection it will create an interaction using the code below . Some one made a change and now it is creating interaction using another reason detail called XTS and i saw it on the reason detail . how idea how to fix mine ?

 

 

image.png

 

function createInteraction(userSysId, locationId, identifier, checkInType) {
var facade = new sn_walkup.ExtPointUtil().loadExtension('InteractionFacade');
var reasonDetails = getReasonDetails('Something is not working');
if (!reasonDetails) {
reasonDetails = createReason('Something is not working');
}
if (reasonDetails) {
var reasonId = reasonDetails.sys_id;
var reasonDescription = reasonDetails.description;
var badgeId = checkInType === "badge";
var interactionSysId;

try {
interactionSysId = facade.createInteraction(
'' + userSysId,
locationId,
reasonId,
reasonDescription,
false,
'',
'',
false,
false,
badgeId
);

2 REPLIES 2

sundaram080713
Tera Expert

Since you’re using a facade like this:

var facade = new sn_walkup.ExtPointUtil().loadExtension('InteractionFacade');

it’s a good idea to check the code inside the createInteraction method. Sometimes, these methods have extra logic that might override your inputs:

  • Parameter Overwrites: Look for anything in that method that might be defaulting the reason to “XTS.”

  • Extra Validations: See if there’s any validation or transformation that happens to the reason fields before the interaction record is finally created.

If your instance uses domain separation:

  • Domain Mismatch: Your code might be looking in one domain, but the records (or even the widget) could be in another. A mismatch like this might cause your system to grab a default or fallback value—like “XTS”—because it can’t find your intended record.





    thank you !!
    please mark it helpfull if you find it usefull.