Solved

Create a linked field or Zoom field

Posted on 2011-02-16
11
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

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
 

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a walkthrough guide I wrote whilst upgrading my on-premise MS Dynamics CRM 3.0 deployment to 4.0. This covers the actual installation of the product to a working level for my system, I ran into a lot of issues that the steps below fixed so h…
On Sep 22nd 2014 Microsoft released Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 and back in July Update Rollup 3 was released.  So we now have:   Update Rollup 1Update Rollup 2Update Rollup 3Service Pack 1Update Rollup 1 for S…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

738 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