web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

User Fields - Crtd_User, Crtd_DateTime, LUpd_User, LUpd_DateTime

(0) ShareShare
ReportReport
Posted on by

Hi,

Does Dynamics SL 7.0 (SWIM) automatically populate columns Crtd_User, Crtd_DateTime, LUpd_User, LUpd_DateTime when they exist in a table?

I would like to add these to some custom tables I have created.

Thanks

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Nope, SWIM does not do this.  Your custom code will have to do this.

  • Suggested answer
    Apps Mexico Profile Picture
    1,090 on at

    Hi,

    No, the SWIM doesn't populate automatically that columns you have to use something like this.


    bxFESetup.CpnyID = bpes.CpnyID.Trim

    bxFESetup.Crtd_User = Trim(bpes.UserId)
    bxFESetup.Crtd_Prog = bpes.ScrnNbr
    bxFESetup.Crtd_DateTime = bpes.Today
    Call GetSysDate(bxFESetup.Crtd_DateTime)
    bxFESetup.Crtd_DateTime = GetAuditDateTime() 'This is a custom function that save the datetime with hours and minutes.

    ''' <summary>
    ''' Suma la fecha y tiempo actual del sistema para poder almacenar en un formato valido para el solomon el dato fecha - hora.
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function GetAuditDateTime() As Integer
    Dim iTime As Integer
    Dim iDate As Integer
    Try
    Call GetSysDate(iDate)
    Call GetSysTime(iTime)

    GetAuditDateTime = iDate + iTime
    Catch ex As InvalidOperationException
    GetAuditDateTime = 0
    End Try
    End Function

  • Mark E Profile Picture
    6,451 on at

    Carlos,

    I have tried your method above in Version 2011 FP1, but it throws an error with mismatch on the GetSysDate method.  Seems it is looking for the variable to be an SDate value, and not an Integer.  Is there a difference between SL 7 and later versions?

  • Suggested answer
    Apps Mexico Profile Picture
    1,090 on at

    Hi,

    The difference is not between the sl versions y between customization mode and SDK mode.

    Some functions are not avalible on customization mode. In that case you must declare it manually.

    Which method do you need? Customization mode or SDK (VBTools)?

    For customization mode, you can add this lines.

    Declare Sub GetSysDate Lib "swimapi.dll" Alias "#129" (currdate As Sdate)

    Declare Sub GetSysTime Lib "swimapi.dll" Alias "#130" (currtime As Stime)

  • Mark E Profile Picture
    6,451 on at

    I was trying this in Customization Manager VBA, adding a custom table to the screen, and trying to populate the new tables Crtd & LUpd DateTime fields.

    I'll try adding the 2 lines and let you know.

  • Apps Mexico Profile Picture
    1,090 on at

    Ok, you can use Call GetBufferValue("bpes.Today", Variable), too.

    Call GetBufferValue("bpes.CpnyId", bxOMSOHeader.cpnyId)

    This are the field avalible on Pes structure.

    Type PES

    AccessNbr            As Integer

    Administrator        As Integer

    BaseCuryID           As String * 4

    BeforeReport         As Integer

    BegRI_ID             As Integer

    ComputerName         As String * 21

    CpnyID               As String * 10                 ' SQLPort2

    CpnyName             As String * 30

    CurrTitle            As String * 80

    CustomGroupId        As String * 30

    CustomLevel          As String * 1

    CustomUserId         As String * 47

    DBName               As String * 21

    DBNameSystem         As String * 30

    DBServer             As String * 30

    DBServerSystem       As String * 30

    EndRI_ID             As Integer

    EnterKeyAsTAB        As Integer                     ' Should not be used in applications -- ignored by kernel

    ExcludeMacros        As Integer

    InitMode             As Integer

    Language             As String * 6

    NextProg             As String * 12

    PrintDestinationName As String * 255

    PrintIncludeCodes    As Integer

    PrintToFile          As Integer

    QMAction             As Integer

    QMMode               As Integer

    ScrnNbr              As String * 5

    Today                As Sdate

    UserId               As String * 47

    End Type

  • Mark E Profile Picture
    6,451 on at

    Yes, I've used bpes.Today, but it only returns the date.  I needed to populate the date and time in the DateTime fields.  Will try your other method...

  • Mark E Profile Picture
    6,451 on at

    Carlos, those declarations are already made in the VBTools_VBA module, so adding them only creates an ambiguous declaration.

    The difference seems to be that in the SDK, GetSysDate and GetSysTime are declared as integers, and in VBA Customization Mgr, they are declared as sDate and sTime, respectively.

    I need to be able to add the date & time to the Crtd and LUpd DateTime fields in my custom table, and not just the date....

  • Manuel Sanchez Profile Picture
    75 on at


    Could you solve the problem ???? I have the same concern This is my code ...

    Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load

    ' Load all the forms needed for this application
    'Call LoadForm(fSL01001)

    ' Initialize the application as a Microsoft Dynamics SL Application
    Call ApplInit()


    Call Init_GSIntercompania(LEVEL0, True)
    ' Define the cursors that are used by the application

    ' This is an example for a table in the System Database
    'Call SqlCursor(c1, LEVEL0 + SqlSystemDb)

    ' This is an example for a table in an Application Database
    'Call SqlCursor(c1, LEVEL0 )


    ' Call the screen init function
    Call ScreenInit()


    bGSIntercompania.Crtd_User = Trim(bpes.UserId)

    MH = DetailSetup(CSR_GSIntercompania, SafGrid1, PNULL, bGSIntercompania, PNULL, PNULL, PNULL)

    End Sub

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans