Auto-generate Key1 for new entry in a UD table

Thanks again Jose, but I still haven't been able to get this to work, here's the code I've tried, as you can see I'm trying apply it to JobMtl, any help would be greatly appreciated

DEF BUFFER bPart FOR PART.
DEF VAR hJobEntry AS HANDLE NO-UNDO.
DEF VAR lv-JobNum LIKE JobHead.JobNum.

RUN bo/JobEntry/JobEntry.p PERSISTENT SET hJobEntry.

FIND first ttJobHead NO-LOCK NO-ERROR.

IF AVAIL ttJobHead THEN
DO:

     ASSIGN lv-JobNum = ttJobHead.JobNum.

     FIND bPart WHERE bPart.Company = ttJobHead.Company 
                              AND bPart.PartNum = ttJobHead.PartNum 
                              AND bpart.UOMClassID = "PAPER"
                              NO-LOCK
                              NO-ERROR.

     FIND Part WHERE Part.Company = ttJobHead.Company 
                              AND Part.PartNum = ipPartNum 
                              AND part.UOMClassID = "PAPER"
                              NO-LOCK
                              NO-ERROR.

     IF AVAIL Part THEN
     DO:

          FIND JobMtl WHERE JobMtl.Company = ttJobHead.Company 
                                        AND JobMtl.JobNum = ttJobHead.JobNum
                                        AND JobMtl.PartNum = ipPartNum
                                        NO-ERROR.

          IF AVAIL JobMtl THEN
          DO:
               ASSIGN JobMtl.EstScrapType = "Q".

          END.
     END.
END.

RUN GetByID IN hJobEntry(INPUT lv-JobNum, {&output_dataset_JobEntryDataSet}).

Greetings All,

 

I’m using a UD table to store data for an issue tracking module. I’d like to automatically generate and set Key1 when the user clicks the New button.

 

If I type in a value and save to a text box bound to UDxx.Key1, then save, all is well. If I programmatically set a value into Key1, the value is accepted so long as I don’t execute an oTrans.Update() in my code or click the Save button; at that point the value I set to Key1 is cleared and I have no more key for that record.

 

I know I’m not the first one to struggle with this, but I’m not finding the solution in my searches. Any ideas?

 

Regards,

 

Earl

I use this a lot on my UD table to create a new record; GetNextKey-it goes out to my company  (I am on 803.409c here is a sample

        Private Function GetNextKey() As String

         '//Use the company Adapter to Store our sequence number Number06

          Dim nextKey As String = String.Empty

          Dim companyAdapter As CompanyAdapter = New CompanyAdapter(UD31Form) 

          companyAdapter.BOConnect()

          Dim company As String = UD31Form.Session.CompanyID

          Dim found As Boolean = companyAdapter.GetByID(company)

 

        if (found) then

            nextKey = companyAdapter.CompanyData.Company.Rows(0)("Number06").toString()

            companyAdapter.CompanyData.Company.Rows(0).BeginEdit()

            companyAdapter.CompanyData.Company.Rows(0)("Number06") += 1

            companyAdapter.CompanyData.Company.Rows(0).EndEdit()

            companyAdapter.Update()

            companyAdapter.Dispose()

        end if

        'messagebox.show("nextKey = " & nextKey)

        return nextKey

    End Function

        Private Sub edvUD31_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) Handles edvUD31.EpiViewNotification

        '// ** Argument Properties and Uses **

        '// view.dataView(args.Row)("[FieldName]")

        '// args.Row, args.Column, args.Sender, args.NotifyType

        '// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes

 

        If (args.NotifyType = EpiTransaction.NotifyType.AddRow) Then

            If (args.Row > -1) Then

                  'messagebox.show("getNextKey")

                  view.dataView(args.Row)("Key1") = GetNextKey

            End If

        End If

    End Sub

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Friday, December 12, 2014 11:24 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Auto-generate Key1 for new entry in a UD table

 

 

Greetings All,

 

I’m using a UD table to store data for an issue tracking module. I’d like to automatically generate and set Key1 when the user clicks the New button.

 

If I type in a value and save to a text box bound to UDxx.Key1, then save, all is well. If I programmatically set a value into Key1, the value is accepted so long as I don’t execute an oTrans.Update() in my code or click the Save button; at that point the value I set to Key1 is cleared and I have no more key for that record.

 

I know I’m not the first one to struggle with this, but I’m not finding the solution in my searches. Any ideas?

 

Regards,

 

Earl

Outside of what was already suggested you can use a Post Processing BPM on GetaNewUDXX to generate the Key1 that works wornders and it works across the system.


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Fri, Dec 12, 2014 at 11:31 AM, 'Leifheit, Nancy Ann' nleifheit@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>

I use this a lot on my UD table to create a new record; GetNextKey-it goes out to my company  (I am on 803.409c here is a sample

        Private Function GetNextKey() As String

        '//Use the company Adapter to Store our sequence number Number06

         Dim nextKey As String = String.Empty

         Dim companyAdapter As CompanyAdapter = New CompanyAdapter(UD31Form)Â

          companyAdapter.BOConnect()

         Dim company As String = UD31Form.Session.CompanyID

         Dim found As Boolean = companyAdapter.GetByID(company)

Â

       if (found) then

           nextKey = companyAdapter.CompanyData.Company.Rows(0)("Number06").toString()

           companyAdapter.CompanyData.Company.Rows(0).BeginEdit()

           companyAdapter.CompanyData.Company.Rows(0)("Number06") += 1

           companyAdapter.CompanyData.Company.Rows(0).EndEdit()

           companyAdapter.Update()

           companyAdapter.Dispose()

       end if

       'messagebox.show("nextKey = " & nextKey)

       return nextKey

   End Function

       Private Sub edvUD31_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) Handles edvUD31.EpiViewNotification

       '// ** Argument Properties and Uses **

       '// view.dataView(args.Row)("[FieldName]")

       '// args.Row, args.Column, args.Sender, args.NotifyType

       '// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes

Â

       If (args.NotifyType = EpiTransaction.NotifyType.AddRow) Then

           If (args.Row > -1) Then

                 'messagebox.show("getNextKey")

                 view.dataView(args.Row)("Key1") = GetNextKey

           End If

       End If

   End Sub

Â

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Friday, December 12, 2014 11:24 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Auto-generate Key1 for new entry in a UD table

Â

Â

Greetings All,

Â

I’m using a UD table to store data for an issue tracking module. I’d like to automatically generate and set Key1 when the user clicks the New button.

Â

If I type in a value and save to a text box bound to UDxx.Key1, then save, all is well. If I programmatically set a value into Key1, the value is accepted so long as I don’t execute an oTrans.Update() in my code or click the Save button; at that point the value I set to Key1 is cleared and I have no more key for that record.

Â

I know I’m not the first one to struggle with this, but I’m not finding the solution in my searches. Any ideas?

Â

Regards,

Â

Earl

</div>
 


<div style="color:#fff;min-height:0;"></div>

Jose/Nancy:

Thanks for your suggestions. I knew this had to be something simple. I failed to use BeginEdit/EndEdit in my original code. Typical newbie mistake. Now it's working much better.

Jose, I'm interested in your suggestion. Can you point me to some documentation for accessing/using the Post Processing BPM? I'm new to this game, so still finding my way around. Thanks in advance for any help. 

Forgot to mention earlier that I'm using Epicor 9.05.701.

Regards,

Earl


On Friday, December 12, 2014 10:38 AM, "Jose Gomez jose@... [vantage]" <vantage@yahoogroups.com> wrote:


 
<div id="ygrps-yiv-2041500946yiv7616949048ygrp-text">
  
  
  <div></div><div dir="ltr"><div class="ygrps-yiv-2041500946yiv7616949048gmail_default" style="font-family:verdana, sans-serif;font-size:small;">Outside of what was already suggested you can use a Post Processing BPM on GetaNewUDXX to generate the Key1 that works wornders and it works across the system.</div></div><div class="ygrps-yiv-2041500946yiv7616949048gmail_extra"><br clear="all"><div><div class="ygrps-yiv-2041500946yiv7616949048gmail_signature"><div dir="ltr"><div><font face="verdana, sans-serif"><br clear="none"><font color="#333333"><b>Jose C Gomez</b></font></font></div><div><font color="#666666" face="verdana, sans-serif" size="1"><b>Software Engineer<br clear="none"><br clear="none"></b></font></div><div><font face="verdana, sans-serif"><font><font color="#666666"><b><br clear="none"></b></font><font color="#FF6600" size="1">T: </font></font><font size="1"><span title="Call with Google Voice"><span title="Call with Google Voice">904.469.1524</span></span> mobile</font></font></div><div><font size="1" face="verdana, sans-serif"><font color="#FF6600">E:</font> <a rel="nofollow" shape="rect" target="_blank" href="mailto:jose@...">jose@...</a></font><font size="1" face="verdana, sans-serif"><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.josecgomez.com/"><font color="#FF6600">http://www.josecgomez.com</font></a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.linkedin.com/in/josecgomez" style="font-size:small;"><img></a>&nbsp;<a rel="nofollow" shape="rect" target="_blank" href="http://www.facebook.com/josegomez" style="font-size:small;"><img></a>&nbsp;</font><a rel="nofollow" shape="rect" target="_blank" href="http://www.google.com/profiles/jose.gomez"><img></a>&nbsp;<a rel="nofollow" shape="rect" target="_blank" href="http://www.twitter.com/joc85"><img></a>&nbsp;<a rel="nofollow" shape="rect" target="_blank" href="http://www.josecgomez.com/professional-resume/"><img></a>&nbsp;<span style="font-family:verdana, sans-serif;"><a rel="nofollow" shape="rect" target="_blank" href="http://www.josecgomez.com/feed/"><img></a>&nbsp;</span></div><div><span lang="LA" style="color:black;"><br clear="none"><font face="Verdana, sans-serif" style="font-weight:bold;" size="1"><i>Quis custodiet

ipsos custodes?


On Fri, Dec 12, 2014 at 11:31 AM, 'Leifheit, Nancy Ann' nleifheit@... [vantage] <vantage@yahoogroups.com> wrote:

 
<div>
  
  
  <div>
I use this a lot on my UD table to create a new record; GetNextKey-it goes out to my company  (I am on 803.409c here is a sample
        Private Function GetNextKey() As String
         '//Use the company Adapter to Store our sequence number Number06
          Dim nextKey As String = String.Empty
          Dim companyAdapter As CompanyAdapter = New CompanyAdapter(UD31Form) 
          companyAdapter.BOConnect()
          Dim company As String = UD31Form.Session.CompanyID
          Dim found As Boolean = companyAdapter.GetByID(company)
 
        if (found) then
            nextKey = companyAdapter.CompanyData.Company.Rows(0)("Number06").toString()
            companyAdapter.CompanyData.Company.Rows(0).BeginEdit()
            companyAdapter.CompanyData.Company.Rows(0)("Number06") += 1
            companyAdapter.CompanyData.Company.Rows(0).EndEdit()
            companyAdapter.Update()
            companyAdapter.Dispose()
        end if
        'messagebox.show("nextKey = " & nextKey)
        return nextKey
    End Function
        Private Sub edvUD31_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) Handles edvUD31.EpiViewNotification
        '// ** Argument Properties and Uses **
        '// view.dataView(args.Row)("[FieldName]")
        '// args.Row, args.Column, args.Sender, args.NotifyType
        '// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
 
        If (args.NotifyType = EpiTransaction.NotifyType.AddRow) Then
            If (args.Row > -1) Then
                  'messagebox.show("getNextKey")
                  view.dataView(args.Row)("Key1") = GetNextKey
            End If
        End If
    End Sub
 
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Friday, December 12, 2014 11:24 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Auto-generate Key1 for new entry in a UD table
 
 
Greetings All,
 
I’m using a UD table to store data for an issue tracking module. I’d like to automatically generate and set Key1 when the user clicks the New button.
 
If I type in a value and save to a text box bound to UDxx.Key1, then save, all is well. If I programmatically set a value into Key1, the value is accepted so long as I don’t execute an oTrans.Update() in my code or click the Save button; at that point the value I set to Key1 is cleared and I have no more key for that record.
 
I know I’m not the first one to struggle with this, but I’m not finding the solution in my searches. Any ideas?
 
Regards,
 
Earl
</div>
 


<div style="color:#fff;min-height:0;"></div>

</div>
 


<div class="ygrps-yiv-2041500946yiv7616949048yqt9844457439" id="ygrps-yiv-2041500946yiv7616949048yqt71423"><div style="color:#fff;height:0;"></div></div>
#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048 -- #ygrps-yiv-2041500946yiv7616949048ygrp-mkp { border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-mkp hr {
border:1px solid #d8d8d8;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-mkp #ygrps-yiv-2041500946yiv7616949048hd {
color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-mkp #ygrps-yiv-2041500946yiv7616949048ads {
margin-bottom:10px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-mkp .ygrps-yiv-2041500946yiv7616949048ad {
padding:0 0;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-mkp .ygrps-yiv-2041500946yiv7616949048ad p {
margin:0;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-mkp .ygrps-yiv-2041500946yiv7616949048ad a {
color:#0000ff;text-decoration:none;}
#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-sponsor #ygrps-yiv-2041500946yiv7616949048ygrp-lc {
font-family:Arial;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-sponsor #ygrps-yiv-2041500946yiv7616949048ygrp-lc #ygrps-yiv-2041500946yiv7616949048hd {
margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-sponsor #ygrps-yiv-2041500946yiv7616949048ygrp-lc .ygrps-yiv-2041500946yiv7616949048ad {
margin-bottom:10px;padding:0 0;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048actions {
font-family:Verdana;font-size:11px;padding:10px 0;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048activity {
background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048activity span {
font-weight:700;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048activity span:first-child {
text-transform:uppercase;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048activity span a {
color:#5085b6;text-decoration:none;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048activity span span {
color:#ff7900;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048activity span .ygrps-yiv-2041500946yiv7616949048underline {
text-decoration:underline;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 .ygrps-yiv-2041500946yiv7616949048attach {
clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 .ygrps-yiv-2041500946yiv7616949048attach div a {
text-decoration:none;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 .ygrps-yiv-2041500946yiv7616949048attach img {
border:none;padding-right:5px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 .ygrps-yiv-2041500946yiv7616949048attach label {
display:block;margin-bottom:5px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 .ygrps-yiv-2041500946yiv7616949048attach label a {
text-decoration:none;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 blockquote {
margin:0 0 0 4px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 .ygrps-yiv-2041500946yiv7616949048bold {
font-family:Arial;font-size:13px;font-weight:700;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 .ygrps-yiv-2041500946yiv7616949048bold a {
text-decoration:none;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 dd.ygrps-yiv-2041500946yiv7616949048last p a {
font-family:Verdana;font-weight:700;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 dd.ygrps-yiv-2041500946yiv7616949048last p span {
margin-right:10px;font-family:Verdana;font-weight:700;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 dd.ygrps-yiv-2041500946yiv7616949048last p span.ygrps-yiv-2041500946yiv7616949048yshortcuts {
margin-right:0;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 div.ygrps-yiv-2041500946yiv7616949048attach-table div div a {
text-decoration:none;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 div.ygrps-yiv-2041500946yiv7616949048attach-table {
width:400px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 div.ygrps-yiv-2041500946yiv7616949048file-title a, #ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 div.ygrps-yiv-2041500946yiv7616949048file-title a:active, #ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 div.ygrps-yiv-2041500946yiv7616949048file-title a:hover, #ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 div.ygrps-yiv-2041500946yiv7616949048file-title a:visited {
text-decoration:none;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 div.ygrps-yiv-2041500946yiv7616949048photo-title a, #ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 div.ygrps-yiv-2041500946yiv7616949048photo-title a:active, #ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 div.ygrps-yiv-2041500946yiv7616949048photo-title a:hover, #ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 div.ygrps-yiv-2041500946yiv7616949048photo-title a:visited {
text-decoration:none;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 div#ygrps-yiv-2041500946yiv7616949048ygrp-mlmsg #ygrps-yiv-2041500946yiv7616949048ygrp-msg p a span.ygrps-yiv-2041500946yiv7616949048yshortcuts {
font-family:Verdana;font-size:10px;font-weight:normal;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 .ygrps-yiv-2041500946yiv7616949048green {
color:#628c2a;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 .ygrps-yiv-2041500946yiv7616949048MsoNormal {
margin:0 0 0 0;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 o {
font-size:0;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048photos div {
float:left;width:72px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048photos div div {
border:1px solid #666666;height:62px;overflow:hidden;width:62px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048photos div label {
color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048reco-category {
font-size:77%;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048reco-desc {
font-size:77%;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 .ygrps-yiv-2041500946yiv7616949048replbq {
margin:4px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-actbar div a:first-child {
margin-right:2px;padding-right:5px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-mlmsg {
font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-mlmsg table {
font-size:inherit;font:100%;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-mlmsg select, #ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 input, #ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 textarea {
font:99% Arial, Helvetica, clean, sans-serif;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-mlmsg pre, #ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 code {
font:115% monospace;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-mlmsg * {
line-height:1.22em;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-mlmsg #ygrps-yiv-2041500946yiv7616949048logo {
padding-bottom:10px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-msg p a {
font-family:Verdana;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-msg p#ygrps-yiv-2041500946yiv7616949048attach-count span {
color:#1E66AE;font-weight:700;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-reco #ygrps-yiv-2041500946yiv7616949048reco-head {
color:#ff7900;font-weight:700;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-reco {
margin-bottom:20px;padding:0px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-sponsor #ygrps-yiv-2041500946yiv7616949048ov li a {
font-size:130%;text-decoration:none;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-sponsor #ygrps-yiv-2041500946yiv7616949048ov li {
font-size:77%;list-style-type:square;padding:6px 0;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-sponsor #ygrps-yiv-2041500946yiv7616949048ov ul {
margin:0;padding:0 0 0 8px;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-text {
font-family:Georgia;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-text p {
margin:0 0 1em 0;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-text tt {
font-size:120%;}

#ygrps-yiv-2041500946 #ygrps-yiv-2041500946yiv7616949048 #ygrps-yiv-2041500946yiv7616949048ygrp-vital ul li:last-child {
border-right:none !important;}
#ygrps-yiv-2041500946



So if you are new to epicor you will find that although documentation is abundant it is rarely the specific thing you are looking for. With that said, here is a quick example with screenshots of what you are trying to do

Go to BPM and Create a New Post Processing Directive on GetaNewUDXXÂ


Go to New -> Post Processing DirectiveÂ



Give it a Name and a Group


Go To Actions -> Click New and Select syncronoysly excecute ABL

click on the word "code" within the selected node


The ABL Action Screen Opens. Click Excecute Code Below and Wirte your 4GL code to assign your key. This can  be base on something simple like the use-rid and the date time as shown

FOR EACH ttCallContextClient, EACH ttUD06 WHERE ttUD06.RowMod='A':
Assign ttUD06.Key1 = ttCallContextClient.CurrentUserId + STRING(NOW).
END.


Click Validate, and Ok. Back at the main BPM Screen click Enabled and Prevent Endless loops Then Save


Now when you click New in your UD form Key 1 is automatically populated.



Hope this helps




Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Fri, Dec 12, 2014 at 12:38 PM, Earl Morren morren5@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p></p><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"><div dir="ltr"><span>Jose/Nancy:</span></div><div dir="ltr"><span><br></span></div><div dir="ltr"><span>Thanks for your suggestions. I knew this had to be something simple. I failed to use BeginEdit/EndEdit in my original code. Typical newbie mistake. Now it&#39;s working much better.</span></div><div dir="ltr"><span><br></span></div><div dir="ltr"><span>Jose, I&#39;m interested in your suggestion. Can you point me to some documentation for accessing/using the Post Processing BPM? I&#39;m new to this game, so still finding my way around. Thanks in advance for any help.</span>Â </div><div dir="ltr"><span><br></span></div><div dir="ltr">Forgot to mention earlier that I&#39;m using Epicor 9.05.701.</div><div dir="ltr"><br></div><div dir="ltr">Regards,</div><div dir="ltr"><br></div><div dir="ltr">Earl</div><div><div class="ygrps-yiv-1327732172h5"> <div><br><br></div><div> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr"> <font face="Arial"> On Friday, December 12, 2014 10:38 AM, &quot;Jose Gomez <a rel="nofollow" target="_blank" href="mailto:jose@...">jose@...</a> [vantage]&quot; &lt;<a rel="nofollow" target="_blank" href="mailto:vantage@yahoogroups.com">vantage@yahoogroups.com</a>&gt; wrote:<br> </font> </div>  <br><br> <div><div><div>

Â

<div>
  
  
  <div></div><div dir="ltr"><div style="font-family:verdana, sans-serif;font-size:small;">Outside of what was already suggested you can use a Post Processing BPM on GetaNewUDXX to generate the Key1 that works wornders and it works across the system.</div></div><div><br clear="all"><div><div><div dir="ltr"><div><font face="verdana, sans-serif"><br clear="none"><font color="#333333"><b>Jose C Gomez</b></font></font></div><div><font color="#666666" face="verdana, sans-serif" size="1"><b>Software Engineer<br clear="none"><br clear="none"></b></font></div><div><font face="verdana, sans-serif"><font><font color="#666666"><b><br clear="none"></b></font><font color="#FF6600" size="1">T: </font></font><font size="1"><span title="Call with Google Voice"><span title="Call with Google Voice"><a rel="nofollow">904.469.1524</a></span></span> mobile</font></font></div><div><font size="1" face="verdana, sans-serif"><font color="#FF6600">E:</font> <a rel="nofollow" shape="rect" target="_blank" href="mailto:jose@...">jose@...</a></font><font size="1" face="verdana, sans-serif"><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.josecgomez.com/"><font color="#FF6600">http://www.josecgomez.com</font></a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.linkedin.com/in/josecgomez" style="font-size:small;"><img></a>Â <a rel="nofollow" shape="rect" target="_blank" href="http://www.facebook.com/josegomez" style="font-size:small;"><img></a>Â </font><a rel="nofollow" shape="rect" target="_blank" href="http://www.google.com/profiles/jose.gomez"><img></a>Â <a rel="nofollow" shape="rect" target="_blank" href="http://www.twitter.com/joc85"><img></a>Â <a rel="nofollow" shape="rect" target="_blank" href="http://www.josecgomez.com/professional-resume/"><img></a>Â <span style="font-family:verdana, sans-serif;"><a rel="nofollow" shape="rect" target="_blank" href="http://www.josecgomez.com/feed/"><img></a>Â </span></div><div><span lang="LA" style="color:black;"><br clear="none"><font face="Verdana, sans-serif" style="font-weight:bold;" size="1"><i>Quis custodiet

ipsos custodes?



On Fri, Dec 12, 2014 at 11:31 AM, 'Leifheit, Nancy Ann' nleifheit@… [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <div>
I use this a lot on my UD table to create a new record; GetNextKey-it goes out to my company  (I am on 803.409c here is a sample
        Private Function GetNextKey() As String
        '//Use the company Adapter to Store our sequence number Number06
         Dim nextKey As String = String.Empty
         Dim companyAdapter As CompanyAdapter = New CompanyAdapter(UD31Form)Â
          companyAdapter.BOConnect()
         Dim company As String = UD31Form.Session.CompanyID
         Dim found As Boolean = companyAdapter.GetByID(company)
Â
       if (found) then
           nextKey = companyAdapter.CompanyData.Company.Rows(0)("Number06").toString()
           companyAdapter.CompanyData.Company.Rows(0).BeginEdit()
           companyAdapter.CompanyData.Company.Rows(0)("Number06") += 1
           companyAdapter.CompanyData.Company.Rows(0).EndEdit()
           companyAdapter.Update()
           companyAdapter.Dispose()
       end if
       'messagebox.show("nextKey = " & nextKey)
       return nextKey
   End Function
       Private Sub edvUD31_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) Handles edvUD31.EpiViewNotification
       '// ** Argument Properties and Uses **
       '// view.dataView(args.Row)("[FieldName]")
       '// args.Row, args.Column, args.Sender, args.NotifyType
       '// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
Â
       If (args.NotifyType = EpiTransaction.NotifyType.AddRow) Then
           If (args.Row > -1) Then
                 'messagebox.show("getNextKey")
                 view.dataView(args.Row)("Key1") = GetNextKey
           End If
       End If
   End Sub
Â
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Friday, December 12, 2014 11:24 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Auto-generate Key1 for new entry in a UD table
Â
Â
Greetings All,
Â
I’m using a UD table to store data for an issue tracking module. I’d like to automatically generate and set Key1 when the user clicks the New button.
Â
If I type in a value and save to a text box bound to UDxx.Key1, then save, all is well. If I programmatically set a value into Key1, the value is accepted so long as I don’t execute an oTrans.Update() in my code or click the Save button; at that point the value I set to Key1 is cleared and I have no more key for that record.
Â
I know I’m not the first one to struggle with this, but I’m not finding the solution in my searches. Any ideas?
Â
Regards,
Â
Earl
</div>
 


<div style="color:#fff;min-height:0;"></div>

</div>
 


<div><div style="color:#fff;min-height:0;"></div></div>


</div>
 


<div style="color:#fff;min-height:0;"></div>

Jose:

Thanks so much for your help. I'll give your instructions a try.

Cheers,

Earl


On Friday, December 12, 2014 12:21 PM, "Jose Gomez jose@... [vantage]" <vantage@yahoogroups.com> wrote:


 
<div id="ygrps-yiv-899863761yiv3729838840ygrp-text">
  
  
  <div></div><div dir="ltr"><div class="ygrps-yiv-899863761yiv3729838840gmail_default" style="font-family:verdana, sans-serif;font-size:small;">So if you are new to epicor you will find that although documentation is abundant it is rarely the specific thing you are looking for. With that said, here is a quick example with screenshots of what you are trying to do</div><div class="ygrps-yiv-899863761yiv3729838840gmail_default" style="font-family:verdana, sans-serif;font-size:small;"><br clear="none"></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default" style="font-family:verdana, sans-serif;font-size:small;">Go to BPM and Create a New Post Processing Directive on GetaNewUDXX&nbsp;</div><div class="ygrps-yiv-899863761yiv3729838840gmail_default" style="font-family:verdana, sans-serif;font-size:small;"><br clear="none"></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><a rel="nofollow" shape="rect" target="_blank" href="http://i.imgur.com/sXukL2x.png">http://i.imgur.com/sXukL2x.png</a><br clear="none"></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><br clear="none"></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default">Go to New -&gt; Post Processing Directive&nbsp;</div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><a rel="nofollow" shape="rect" target="_blank" href="http://i.imgur.com/v1F48Ds.png">http://i.imgur.com/v1F48Ds.png</a></font><br clear="none"></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif">Give it a Name and a Group</font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><a rel="nofollow" shape="rect" target="_blank" href="http://i.imgur.com/wUnZnDz.png">http://i.imgur.com/wUnZnDz.png</a></font><br clear="none"></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif">Go To Actions -&gt; Click New and Select syncronoysly excecute ABL</font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><a rel="nofollow" shape="rect" target="_blank" href="http://i.imgur.com/1fqU9OZ.png">http://i.imgur.com/1fqU9OZ.png</a></font><br clear="none"></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif">click on the word &quot;code&quot; within the selected node</font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><a rel="nofollow" shape="rect" target="_blank" href="http://i.imgur.com/xol1rSZ.png">http://i.imgur.com/xol1rSZ.png</a><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif">The ABL Action Screen Opens. Click Excecute Code Below and Wirte your 4GL code to assign your key. This can &nbsp;be base on something simple like the&nbsp;use-rid&nbsp;and the date time as shown</font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"></font><div class="ygrps-yiv-899863761yiv3729838840gmail_default">FOR EACH ttCallContextClient, EACH ttUD06 WHERE ttUD06.RowMod=&#39;A&#39;:</div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><span class="ygrps-yiv-899863761yiv3729838840class" style="white-space:pre;">		</span>Assign ttUD06.Key1 = ttCallContextClient.CurrentUserId + STRING(NOW).</div><div class="ygrps-yiv-899863761yiv3729838840gmail_default">END.</div></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><a rel="nofollow" shape="rect" target="_blank" href="http://i.imgur.com/9lAowFa.png">http://i.imgur.com/9lAowFa.png</a><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif">Click Validate, and Ok. Back at the main BPM Screen click Enabled and Prevent Endless loops&nbsp;</font><span style="font-family:verdana, sans-serif;">Then Save</span></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><span style="font-family:verdana, sans-serif;"><br clear="none"></span></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><a rel="nofollow" shape="rect" target="_blank" href="http://i.imgur.com/imThJ41.png">http://i.imgur.com/imThJ41.png</a></font><br clear="none"></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif">Now when you click New in your UD form Key 1 is automatically populated.</font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><a rel="nofollow" shape="rect" target="_blank" href="http://i.imgur.com/kACltxp.png">http://i.imgur.com/kACltxp.png</a><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif">Hope this helps</font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div><div class="ygrps-yiv-899863761yiv3729838840gmail_default"><font face="verdana, sans-serif"><br clear="none"></font></div></div><div class="ygrps-yiv-899863761yiv3729838840gmail_extra"><br clear="all"><div><div class="ygrps-yiv-899863761yiv3729838840gmail_signature"><div dir="ltr"><div><font face="verdana, sans-serif"><br clear="none"><font color="#333333"><b>Jose C Gomez</b></font></font></div><div><font color="#666666" face="verdana, sans-serif" size="1"><b>Software Engineer<br clear="none"><br clear="none"></b></font></div><div><font face="verdana, sans-serif"><font><font color="#666666"><b><br clear="none"></b></font><font color="#FF6600" size="1">T: </font></font><font size="1"><span title="Call with Google Voice"><span title="Call with Google Voice">904.469.1524</span></span> mobile</font></font></div><div><font size="1" face="verdana, sans-serif"><font color="#FF6600">E:</font> <a rel="nofollow" shape="rect" target="_blank" href="mailto:jose@...">jose@...</a></font><font size="1" face="verdana, sans-serif"><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.josecgomez.com/"><font color="#FF6600">http://www.josecgomez.com</font></a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.linkedin.com/in/josecgomez" style="font-size:small;"><img></a>&nbsp;<a rel="nofollow" shape="rect" target="_blank" href="http://www.facebook.com/josegomez" style="font-size:small;"><img></a>&nbsp;</font><a rel="nofollow" shape="rect" target="_blank" href="http://www.google.com/profiles/jose.gomez"><img></a>&nbsp;<a rel="nofollow" shape="rect" target="_blank" href="http://www.twitter.com/joc85"><img></a>&nbsp;<a rel="nofollow" shape="rect" target="_blank" href="http://www.josecgomez.com/professional-resume/"><img></a>&nbsp;<span style="font-family:verdana, sans-serif;"><a rel="nofollow" shape="rect" target="_blank" href="http://www.josecgomez.com/feed/"><img></a>&nbsp;</span></div><div><span lang="LA" style="color:black;"><br clear="none"><font face="Verdana, sans-serif" style="font-weight:bold;" size="1"><i>Quis custodiet

ipsos custodes?


On Fri, Dec 12, 2014 at 12:38 PM, Earl Morren morren5@... [vantage] <vantage@yahoogroups.com> wrote:

 
<div>
  
  
  <div></div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"><div dir="ltr"><span>Jose/Nancy:</span></div><div dir="ltr"><span><br clear="none"></span></div><div dir="ltr"><span>Thanks for your suggestions. I knew this had to be something simple. I failed to use BeginEdit/EndEdit in my original code. Typical newbie mistake. Now it&#39;s working much better.</span></div><div dir="ltr"><span><br clear="none"></span></div><div dir="ltr"><span>Jose, I&#39;m interested in your suggestion. Can you point me to some documentation for accessing/using the Post Processing BPM? I&#39;m new to this game, so still finding my way around. Thanks in advance for any help.</span>&nbsp;</div><div dir="ltr"><span><br clear="none"></span></div><div dir="ltr">Forgot to mention earlier that I&#39;m using Epicor 9.05.701.</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Regards,</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Earl</div><div><div class="ygrps-yiv-899863761yiv3729838840h5"> <div><br clear="none"><br clear="none"></div><div> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr"> <font face="Arial"> On Friday, December 12, 2014 10:38 AM, &quot;Jose Gomez <a rel="nofollow" shape="rect" target="_blank" href="mailto:jose@...">jose@...</a> [vantage]&quot; &lt;<a rel="nofollow" shape="rect" target="_blank" href="mailto:vantage@yahoogroups.com">vantage@yahoogroups.com</a>&gt; wrote:<br clear="none"> </font> </div>  <br clear="none"><br clear="none"> <div><div><div>

 

<div>
  
  
  <div></div><div dir="ltr"><div style="font-family:verdana, sans-serif;font-size:small;">Outside of what was already suggested you can use a Post Processing BPM on GetaNewUDXX to generate the Key1 that works wornders and it works across the system.</div></div><div><br clear="all"><div><div><div dir="ltr"><div><font face="verdana, sans-serif"><br clear="none"><font color="#333333"><b>Jose C Gomez</b></font></font></div><div><font color="#666666" face="verdana, sans-serif" size="1"><b>Software Engineer<br clear="none"><br clear="none"></b></font></div><div><font face="verdana, sans-serif"><font><font color="#666666"><b><br clear="none"></b></font><font color="#FF6600" size="1">T: </font></font><font size="1"><span title="Call with Google Voice"><span title="Call with Google Voice"><a rel="nofollow" shape="rect">904.469.1524</a></span></span> mobile</font></font></div><div><font size="1" face="verdana, sans-serif"><font color="#FF6600">E:</font> <a rel="nofollow" shape="rect" target="_blank" href="mailto:jose@...">jose@...</a></font><font size="1" face="verdana, sans-serif"><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.josecgomez.com/"><font color="#FF6600">http://www.josecgomez.com</font></a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.linkedin.com/in/josecgomez" style="font-size:small;"><img></a>&nbsp;<a rel="nofollow" shape="rect" target="_blank" href="http://www.facebook.com/josegomez" style="font-size:small;"><img></a>&nbsp;</font><a rel="nofollow" shape="rect" target="_blank" href="http://www.google.com/profiles/jose.gomez"><img></a>&nbsp;<a rel="nofollow" shape="rect" target="_blank" href="http://www.twitter.com/joc85"><img></a>&nbsp;<a rel="nofollow" shape="rect" target="_blank" href="http://www.josecgomez.com/professional-resume/"><img></a>&nbsp;<span style="font-family:verdana, sans-serif;"><a rel="nofollow" shape="rect" target="_blank" href="http://www.josecgomez.com/feed/"><img></a>&nbsp;</span></div><div><span lang="LA" style="color:black;"><br clear="none"><font face="Verdana, sans-serif" style="font-weight:bold;" size="1"><i>Quis custodiet

ipsos custodes?



On Fri, Dec 12, 2014 at 11:31 AM, 'Leifheit, Nancy Ann' nleifheit@… [vantage] <vantage@yahoogroups.com> wrote:

 
<div>
  
  
  <div>
I use this a lot on my UD table to create a new record; GetNextKey-it goes out to my company  (I am on 803.409c here is a sample
        Private Function GetNextKey() As String
         '//Use the company Adapter to Store our sequence number Number06
          Dim nextKey As String = String.Empty
          Dim companyAdapter As CompanyAdapter = New CompanyAdapter(UD31Form) 
          companyAdapter.BOConnect()
          Dim company As String = UD31Form.Session.CompanyID
          Dim found As Boolean = companyAdapter.GetByID(company)
 
        if (found) then
            nextKey = companyAdapter.CompanyData.Company.Rows(0)("Number06").toString()
            companyAdapter.CompanyData.Company.Rows(0).BeginEdit()
            companyAdapter.CompanyData.Company.Rows(0)("Number06") += 1
            companyAdapter.CompanyData.Company.Rows(0).EndEdit()
            companyAdapter.Update()
            companyAdapter.Dispose()
        end if
        'messagebox.show("nextKey = " & nextKey)
        return nextKey
    End Function
        Private Sub edvUD31_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) Handles edvUD31.EpiViewNotification
        '// ** Argument Properties and Uses **
        '// view.dataView(args.Row)("[FieldName]")
        '// args.Row, args.Column, args.Sender, args.NotifyType
        '// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
 
        If (args.NotifyType = EpiTransaction.NotifyType.AddRow) Then
            If (args.Row > -1) Then
                  'messagebox.show("getNextKey")
                  view.dataView(args.Row)("Key1") = GetNextKey
            End If
        End If
    End Sub
 
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Friday, December 12, 2014 11:24 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Auto-generate Key1 for new entry in a UD table
 
 
Greetings All,
 
I’m using a UD table to store data for an issue tracking module. I’d like to automatically generate and set Key1 when the user clicks the New button.
 
If I type in a value and save to a text box bound to UDxx.Key1, then save, all is well. If I programmatically set a value into Key1, the value is accepted so long as I don’t execute an oTrans.Update() in my code or click the Save button; at that point the value I set to Key1 is cleared and I have no more key for that record.
 
I know I’m not the first one to struggle with this, but I’m not finding the solution in my searches. Any ideas?
 
Regards,
 
Earl
</div>
 


<div style="color:#fff;min-height:0;"></div>

</div>
 


<div><div style="color:#fff;min-height:0;"></div></div>


</div>
 


<div style="color:#fff;min-height:0;"></div>

</div>
 


<div class="ygrps-yiv-899863761yiv3729838840yqt8283469511" id="ygrps-yiv-899863761yiv3729838840yqt39484"><div style="color:#fff;height:0;"></div></div>
#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840 -- #ygrps-yiv-899863761yiv3729838840ygrp-mkp { border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-mkp hr {
border:1px solid #d8d8d8;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-mkp #ygrps-yiv-899863761yiv3729838840hd {
color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-mkp #ygrps-yiv-899863761yiv3729838840ads {
margin-bottom:10px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-mkp .ygrps-yiv-899863761yiv3729838840ad {
padding:0 0;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-mkp .ygrps-yiv-899863761yiv3729838840ad p {
margin:0;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-mkp .ygrps-yiv-899863761yiv3729838840ad a {
color:#0000ff;text-decoration:none;}
#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-sponsor #ygrps-yiv-899863761yiv3729838840ygrp-lc {
font-family:Arial;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-sponsor #ygrps-yiv-899863761yiv3729838840ygrp-lc #ygrps-yiv-899863761yiv3729838840hd {
margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-sponsor #ygrps-yiv-899863761yiv3729838840ygrp-lc .ygrps-yiv-899863761yiv3729838840ad {
margin-bottom:10px;padding:0 0;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840actions {
font-family:Verdana;font-size:11px;padding:10px 0;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840activity {
background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840activity span {
font-weight:700;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840activity span:first-child {
text-transform:uppercase;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840activity span a {
color:#5085b6;text-decoration:none;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840activity span span {
color:#ff7900;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840activity span .ygrps-yiv-899863761yiv3729838840underline {
text-decoration:underline;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 .ygrps-yiv-899863761yiv3729838840attach {
clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 .ygrps-yiv-899863761yiv3729838840attach div a {
text-decoration:none;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 .ygrps-yiv-899863761yiv3729838840attach img {
border:none;padding-right:5px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 .ygrps-yiv-899863761yiv3729838840attach label {
display:block;margin-bottom:5px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 .ygrps-yiv-899863761yiv3729838840attach label a {
text-decoration:none;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 blockquote {
margin:0 0 0 4px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 .ygrps-yiv-899863761yiv3729838840bold {
font-family:Arial;font-size:13px;font-weight:700;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 .ygrps-yiv-899863761yiv3729838840bold a {
text-decoration:none;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 dd.ygrps-yiv-899863761yiv3729838840last p a {
font-family:Verdana;font-weight:700;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 dd.ygrps-yiv-899863761yiv3729838840last p span {
margin-right:10px;font-family:Verdana;font-weight:700;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 dd.ygrps-yiv-899863761yiv3729838840last p span.ygrps-yiv-899863761yiv3729838840yshortcuts {
margin-right:0;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 div.ygrps-yiv-899863761yiv3729838840attach-table div div a {
text-decoration:none;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 div.ygrps-yiv-899863761yiv3729838840attach-table {
width:400px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 div.ygrps-yiv-899863761yiv3729838840file-title a, #ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 div.ygrps-yiv-899863761yiv3729838840file-title a:active, #ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 div.ygrps-yiv-899863761yiv3729838840file-title a:hover, #ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 div.ygrps-yiv-899863761yiv3729838840file-title a:visited {
text-decoration:none;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 div.ygrps-yiv-899863761yiv3729838840photo-title a, #ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 div.ygrps-yiv-899863761yiv3729838840photo-title a:active, #ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 div.ygrps-yiv-899863761yiv3729838840photo-title a:hover, #ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 div.ygrps-yiv-899863761yiv3729838840photo-title a:visited {
text-decoration:none;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 div#ygrps-yiv-899863761yiv3729838840ygrp-mlmsg #ygrps-yiv-899863761yiv3729838840ygrp-msg p a span.ygrps-yiv-899863761yiv3729838840yshortcuts {
font-family:Verdana;font-size:10px;font-weight:normal;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 .ygrps-yiv-899863761yiv3729838840green {
color:#628c2a;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 .ygrps-yiv-899863761yiv3729838840MsoNormal {
margin:0 0 0 0;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 o {
font-size:0;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840photos div {
float:left;width:72px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840photos div div {
border:1px solid #666666;height:62px;overflow:hidden;width:62px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840photos div label {
color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840reco-category {
font-size:77%;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840reco-desc {
font-size:77%;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 .ygrps-yiv-899863761yiv3729838840replbq {
margin:4px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-actbar div a:first-child {
margin-right:2px;padding-right:5px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-mlmsg {
font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-mlmsg table {
font-size:inherit;font:100%;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-mlmsg select, #ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 input, #ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 textarea {
font:99% Arial, Helvetica, clean, sans-serif;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-mlmsg pre, #ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 code {
font:115% monospace;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-mlmsg * {
line-height:1.22em;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-mlmsg #ygrps-yiv-899863761yiv3729838840logo {
padding-bottom:10px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-msg p a {
font-family:Verdana;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-msg p#ygrps-yiv-899863761yiv3729838840attach-count span {
color:#1E66AE;font-weight:700;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-reco #ygrps-yiv-899863761yiv3729838840reco-head {
color:#ff7900;font-weight:700;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-reco {
margin-bottom:20px;padding:0px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-sponsor #ygrps-yiv-899863761yiv3729838840ov li a {
font-size:130%;text-decoration:none;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-sponsor #ygrps-yiv-899863761yiv3729838840ov li {
font-size:77%;list-style-type:square;padding:6px 0;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-sponsor #ygrps-yiv-899863761yiv3729838840ov ul {
margin:0;padding:0 0 0 8px;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-text {
font-family:Georgia;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-text p {
margin:0 0 1em 0;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-text tt {
font-size:120%;}

#ygrps-yiv-899863761 #ygrps-yiv-899863761yiv3729838840 #ygrps-yiv-899863761yiv3729838840ygrp-vital ul li:last-child {
border-right:none !important;}
#ygrps-yiv-899863761