Quantcast
Channel: Microsoft Dynamics SL Forum - Recent Threads
Viewing all articles
Browse latest Browse all 2378

Customize BI.AIC.00 default value

$
0
0

Hi All,

I have a customization on the Invoice and Adjustment Maintenance screen (BI.BAM.00) which updates the TermsID value with one populated by a SQL query.  This customization works for me on that screen but when I run Automatic Invoice Creation page (BI.AIC.00) my custom value is lost.

I'm not sure where to re-implement my customization for (BI.AIC.00). Does this require a SQL side change or I set a default value in that screen using VBA?

For a bit of background the BI.BAM.00 screen is using the following code to populate TermsID:

Sub SetTerms()
    Dim strSQLStmt As String
    Dim strTermsID As String
    Dim strProjectID As String
    
    strProjectID = GetObjectValue("cbill_project")
    
    strSQLStmt = ""
    strSQLStmt = "SELECT CASE WHEN c.termsid IS NULL OR c.termsid = '' THEN '00' ELSE c.termsid END AS termsid " & _
                 "FROM pjproj as p LEFT OUTER JOIN pjcont as c on p.contract = c.contract " & _
                 "WHERE p.project = " & SParm(strProjectID)
    
    'We use SqlFetch1 because we are using the data structure we defined for this query: bContResult
    serr1 = SqlFetch1(c1, strSQLStmt, bContResult, LenB(bContResult))
    'MsgBox "Sql executed successfully: " & serr1
    
    'SqlFetch returns 0 if records are returned or NOTFOUND if no records are returned
    If serr1 = NOTFOUND Then
        'Call MessBox("Error Locating Project " + SParm(strProjectID), MB_OK, "Can't Assign TermsID")
        Exit Sub
    Else
        'Check to see if the terms field is enabled or not so we don't modify posted records
        If cTerms.Enabled = True Then
            strTermsID = bContResult.termsid
            'Call MessBox("Assign TermsID: " + strTermsID, MB_OK, "Terms to assign")
            Call SetObjectValue("cTerms", strTermsID)
            'Call SetBufferValue("bpjinvhdr.ih_id18", strTermsID)
            
        End If
    End If
    
End Sub



Viewing all articles
Browse latest Browse all 2378

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>