11/30/2024 10:21:51 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
|
|
|
|
Datagrid Editing Event
Posted: 06 Dec 07 9:56 AM
|
Hi, In Salesprocess tab, there is an event written by Saleslogix as below
Function grdSalesProcessEditing(Sender, PrimaryKeyValue, FieldName, Value)
This message box pops twice when you click on same cell in grid again
--------------------------- Warning --------------------------- The 'New Sales Step1' step has not been completed. You must complete the step before proceeding. --------------------------- OK ---------------------------
How to fix this issue? Any help much appreciated!!
|
|
|
| |
|
Re: Datagrid Editing Event
Posted: 07 Dec 07 11:33 AM
|
There are about four or five places that actually pop that message box in the code, so it could be any number of things.
But before I mention something to do - what are you looking to have fixed? Is it that the message pops twice? If that's it, then you want to make sure it is popping only that message twice - modify the message a little and see if the modification is visible both times that the message pops up. |
|
|
|
Re: Datagrid Editing Event
Posted: 07 Dec 07 4:50 PM
|
Hi Jeff,
Thanks for replying. I have tried several things to supress the message box firing twice in the edit event. Function grdSalesProcessEditing(Sender, PrimaryKeyValue, FieldName, Value)
If I keep a flag, then the message box will not fire the second time if the user checks the same cell again. Here's the sample code:
Function grdSalesProcessEditing(Sender, PrimaryKeyValue, FieldName, Value) Dim strReqStepName, strReqStepID
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' New code starts '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If cboSalesProcess.Text = "Group Booking" Then Select Case grdSalesProcess.GetCurrentField("Description") Case "Waiting to be booked" Msgbox "message here" grdSalesProcessEditing = False Exit Function End Select End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' New code ends '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Select Case FieldName Case "STARTDATE" 'DNL gStrCrntDate = Value Case "COMPLETEDDATE" 'DNL
gStrCrntDate = Value strReqStepID = GetRequiredStepID(grdSalesProcess.GetCurrentField) If strReqStepID <> "" Then strReqStepName = GetStepName(strReqStepID) MsgBox Application.Translator.Localize("The '") & strReqStepName & Application.Translator.Localize("' step has not been completed. You must complete the step before proceeding."),vbOKOnly+vbExclamation, Application.Translator.Localize("Warning") grdSalesProcessEditing = False End If End Select End Function
*************************************************** ' If you click the same grid cell twice, it shows 2 message box twice. ***************************************************
Please let me know if you can find any solution for this... thanks in advance... just want to know if this is salelogix bug
|
|
|
|
Re: Datagrid Editing Event
Posted: 08 Dec 07 4:26 PM
|
I was about to recommend the flag, but I realized that it would surpress any other edits after the first one... Also, the even doesn't reset any values, from what it looks like, so you can't rely on that either. The one constant that I can think of is that the event runs twice every time - never just once, and never three times or more - which means you can keep a flag but operate it like a switch. Declare a global variable called something like "blEditMessagePopped" and set it to False.
Then, in between the "If strReqStepID <> "" Then" and "End If" use this code:
If Not blEditMessagePopped Then strReqStepName = GetStepName(strReqStepID) MsgBox Application.Translator.Localize("The '") & strReqStepName & Application.Translator.Localize("' step has not been completed. You must complete the step before proceeding."),_ vbOKOnly+vbExclamation, Application.Translator.Localize("Warning") blMessagePopped = True Else blMessagePopped = False End If grdSalesProcessEditing = False
On the first time around, it'll see that the message hasn't been popped (because the flag is set to False), and it'll set the flag to True (after all, the message has been popped!). On the second time through, it'll see that the message has been popped, and instead of displaying the message, it'll set the flag back to False (on the second time through, the flag hasn't been popped). Then, the next time the user tries to do that illegal procedure, it'll see that the flag is set to False (no message popped), and it'll pop the message again. That should hopefully accomplish what you are looking for. |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|