Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics RMS (Archived)

status.htm and MsgBox fire event

(0) ShareShare
ReportReport
Posted on by 65

Hey all!

 Here is the deal. Right now I stuck a script inside the status.htm file that when a customer is loaded, a MsgBox will pop up saying that the customer is expired if the CustomDate1 (rewards member date) field is equal to todays date or earlier (which is what we need). The only problem is, when I click ok, the box continues to show up, and will not go away, and I know its because the TimerID interval keeps firing it.

Of course, the novice, obvious solution would be, if I click ok (If vbOK) to clearInterval.(TimerID),  but the only problem with that now, is that when we load up another customer for another sale, the status.htm does not get updated.

 I created another Function to try to get past it, but it is not working.

 Here is the VBS code I am working with:

 <object id="qsBridge" style="left: 0px; top: 0px" height="0" width="0" classid="clsid:44C4C3AC-D0F1-11D2-919D-006008C88FC3"
        viewastext>
  <param name="_ExtentX" value="26">
  <param name="_ExtentY" value="26">
</object>
<script language="VBScript">
<!--
Dim TimerID
dim RHRewardsInfo
dim tablScrollStyle

Dim myDateString
myDateString = Date()
Dim confirmMsg


Function displayVariables
Dim QSRules
Set QSRules = qsBridge.RequestQSRules()
 Set RHRewardsInfo=CreateObject("RetailHero.RMS.AddIns.HeroPoints30.POS.Info")

 If Not QSRules Is Nothing Then
  If QSRules.Transaction.Customer.Loaded Then  
      txtCustomer.innerText= QSRules.Transaction.Customer.Name
   txtAccount.innerText = QSRules.Transaction.Customer.AccountNumber
   txtAddress.innerText = QSRules.Transaction.Customer.HomeAddress.StreetAddress
   txtExpDate.innerText   = QSRules.Transaction.Customer.CustomDate1
   txtMember.innerText = RHRewardsInfo.CheckCustomerExceptionList(QSRules.Transaction.Customer.AccountNumber)
   txtAvailablePoints.innerText=RHRewardsInfo.GetCustomerPoints(QSRules.Transaction.Customer.AccountNumber)
   txtTransactionSubtotal.innerText=FormatCurrency(QSRules.Transaction.SubTotal)
   txtDiscountableSubtotal.innerText=FormatCurrency(RHRewardsInfo.GetSubTotalDiscountable(QSRules.Session))
   
      txtTotalSavings.innerText= "$" & QSRules.Transaction.Customer.TotalSavings & ".00"
   
   GetPointsSchedule.innerHTML=RHRewardsInfo.GetPointsSchedule
   tablScrollStyle="height: 120px; overflow: scroll"
   tableScroll.style.cssText="height: 120px; overflow: auto"
  else
   txtCustomer.innerText="Load customer"
   txtAccount.innerHTML = "&nbsp;"
   txtAddress.innerHTML = "&nbsp;"
   txtExpDate.innerHTML   = "&nbsp;"
   txtMember.innerHTML = "&nbsp;"
   txtAvailablePoints.innerHTML="&nbsp;"
   txtTransactionSubtotal.innerHTML="&nbsp;"
   txtDiscountableSubtotal.innerHTML="&nbsp;"
   GetPointsSchedule.innerHTML="&nbsp;"
  End If
 End if

End function

function displayError
Dim QSRules
Set QSRules = qsBridge.RequestQSRules()
If Not QSRules Is Nothing Then
    If QSRules.Transaction.Customer.Loaded Then
  olieDate = QSRules.Transaction.Customer.CustomDate1 
   If olieDate <= myDateString Then
   confirmMsg = MsgBox("Customer rewards has expired, renew?",4,"Rewards Expired")   
    If confirmMsg = vbYes Then
       TimerID2 = window.setInterval("displayError()", 10000)
    End If
   End If  
 End If
End If
end function

Function doStartup()
   displayVariables
   displayError
   TimerID = window.setInterval("displayVariables()", 1000)
   TimerID2 = window.setInterval("displayError()", 1000)
End Function

//-->

</script>

I need your help, please..

 Thanks in advance!

*This post is locked for comments

  • Aaron Olin Profile Picture
    Aaron Olin 65 on at
    Re: Re: status.htm and MsgBox fire event

    [quote user="ScottM"]

    I don't have a solution, but I was looking for something exactly like this.
    I haven't done anything with VBS in RMS, if this gets figured out, would it be possible to describe going about this?

    We have received complaints from expired members that they weren't informed of their expiration and this pop-up would be a great help!

    Hope you get if working Aaron.

     

    Thank you.

    [/quote]

    I think the only way possible to do it would be to fire a message box when you hit the tender button to check whether or not the customdate1 field is less than or equal to todays date. Although, I think that might involve making .DLL's and what not, but I don't know the first step into the situation. I mean, I have Visual Basic. I already have the VBScript to fire it. I just need to know how to reference the tender button to fire it.

     If anyone could help out, that would be great! I have the customization guide, but cannot make heads or tails with it.

  • ScottM Profile Picture
    ScottM 540 on at
    Re: status.htm and MsgBox fire event

    I don't have a solution, but I was looking for something exactly like this.
    I haven't done anything with VBS in RMS, if this gets figured out, would it be possible to describe going about this?

    We have received complaints from expired members that they weren't informed of their expiration and this pop-up would be a great help!

    Hope you get if working Aaron.

     

    Thank you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans