Solved

Create a linked field or Zoom field

Posted on 2011-02-16
11
339 Views
Last Modified: 2012-05-11
I have a field in RMA Entry Update window that display the related Work Order or RTV Number I would like to be able to click on this field and open the proper work order or RTV .
how can I accomplish that ?
Thanks
0
Comment
Question by:taverny
  • 7
  • 4
11 Comments
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 34911863
In Modifier, create a button under the label of the RTV/WO #, add it to VBA, then hide it. For the label to look blue and underlined (like a link), select the label and set the property Zoom to True.
Add your code to the Button_Changed() event to open the respective transaction.
0
 

Author Comment

by:taverny
ID: 34912219
ok I was able to create a button and hide it. but I am confuse is how to tell the button depending of the data that inside my field to open the correct form and pass the field info . I would like to do somehting like that :
if the field has a WO#  then call WorkOrderEntryupdate window with This WO #.
else if it is a RTV # call the RTV window with RTV #
else if empty or not matching RTV or WO  don't do anything.
0
 

Author Comment

by:taverny
ID: 34912264
ok here is an update and approach I got and seems to work but how I do pass the WO# from my current window.

    If Left(StrWORTVNum.Value, 3) = "WRK" Then
    WorkOrderEntryUpdate.Open

    End If
0
 

Author Comment

by:taverny
ID: 34912338
Well I think I got it. can you please tell me if this code is good enough? or I should be carrefull with something?
thank you

Private Sub ButWoRTVLookup_Changed()

    If Left(StrWORTVNum.Value, 3) = "WRK" Then
        WorkOrderEntryUpdate.Open
        WorkOrderEntryUpdate.WorkOrderNumber = StrWORTVNum.Value
    End If  
    If Left(StrWORTVNum.Value, 3) = "RTV" Then
        RTVEntryUpdate.Open
        RTVEntryUpdate.RTVNumber = StrWORTVNum.Value
    End If
   
End Sub
0
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 34912427
Your code is not bad, but I prefer searching for the StrWORTVNum in the RTV table, if it's not existed then search for it in the WorkOrder table and respond accordingly.

I'm suggesting to search in the WorkOrder table after searching in the RTV table for your code concistency, but you can do something like this:

' Search RTV table
If found in RTV table then
   RTVEntryUpdate.Open
   RTVEntryUpdate.RTVNumber = StrWORTVNum.Value
Else
   WorkOrderEntryUpdate.Open
   WorkOrderEntryUpdate.WorkOrderNumber = StrWORTVNum.Value
End If
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:taverny
ID: 34917446
I think you are right , your approach seems better but since the field is populated if the record exists in either of the table then I should be safe to go directly with the field opening the RTV or WO if the field is not empty.
0
 
LVL 10

Accepted Solution

by:
Abdulmalek_Hamsho earned 500 total points
ID: 34917570
In this case, you can but a flag (Boolean IsRTV) and set it to true if you found the record in RTV table, otherwise, IsRTV = False if found in WO table. And do this:

If IsRTV then
   RTVEntryUpdate.Open
   RTVEntryUpdate.RTVNumber = StrWORTVNum.Value
Else
   WorkOrderEntryUpdate.Open
   WorkOrderEntryUpdate.WorkOrderNumber = StrWORTVNum.Value
End If

The purpose is not to issue two SQL statement to the server, one to decide what's the RTV/WO #, and the next to make sure it's existed.

Your  Left(StrWORTVNum.Value, 3) = "WRK" command is not generic, because it won't work if the Trx Prefix was WO even if you can ensure that your Trx prefix is 3 chars long and either starts with WRK or RTV.
0
 

Author Comment

by:taverny
ID: 34917820
I am sorry I lost you there.

Everytime that my window loads for an RMA line it looks in the table to pull the SVC_Document_Number (which is my RTV/WO #) and put it in the strWORRTVNum field of my screen( just to be clear , the strWORRTVNum is a field on my RMA and not on my table) .and my user can't modify anyway. so either it has an RTV000000 or WO000000 or just empty but can't be anything else.
so if I do a test on the field to be RTV or WRK then I should be safe , anything else would be that it doesn't exists. and those prefix are always gonna be RTV or WRK

am I missing something?
0
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 34918103
I know, but in future, your company many change the prefix of the trx, in this case you would need to alter your code. I always recommend being generic in your code.
0
 

Author Comment

by:taverny
ID: 34918369
I understand , well I know it would be poor programming , I guess I will leave it like that for now and modify it in the future since I really doubt we will ever change it .
but thank you for your concerns
0
 

Author Comment

by:taverny
ID: 34928683
Hi,
 Just wanted to let you know I just open a new question that I think you are the most familiar with my code.
Thanks
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Automatically creating a Trello card using data from a Microsoft Dynamics CRM record turned out to be an easy project that yielded great results.  Here's how I did this for an internal team at General Code.
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now