Skip to main content
Post a question

Notifications

Community site session details

Community site session details

Session Id : CEFEpI5BBSNi9trjmZo4T4
Microsoft Dynamics RMS (Archived)

status.htm and MsgBox fire event

Like (0) ShareShare
ReportReport
Posted on 4 Jun 2010 18:02:32 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
    65 on 08 Jun 2010 at 14:43:26
    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
    540 on 08 Jun 2010 at 14:33:57
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,476 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,592 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Loading complete