AnsweredAssumed Answered

Create related record script

Question asked by JorgeFernandez on Feb 28, 2013
Latest reply on Mar 4, 2013 by JorgeFernandez


Create related record script


     Hi everyone.

     I´m working on a script to create a new related record but "new record" password protected. And you see, it´s working but only when the master record alredy have a related record on the second table, but no when creating a new master record having no related records. This is my script:



     General Data::Id=SecondaryData::SDId



     Set Field [Global::Sign;""]

     Show Custom Dialog ["Password"; "Tupe your password"; Global::Sign]

     If [Get (LastMessageChoice ) = 2)

       Exit Script []


        If [Global::Sign ≠ ********]

           Show Custom Dialog ["Invalid"; "This is password protected"]


          If [SecondaryData::Date = 0]

              Insert Current Date [SecondaryData]


              Go to Field [GeneralData::LastName]

              Show Custom Dialog ["Out of date"; "This record is not editable anymore"]

              Exit Script []

           End If

        End If

     Enf If



     As I said, It works great with a Master Record with existing related records, but no when creating a new master record.


     I´ve being trying to create a script for a new master record with many ways to create a related record at the time, but no sucess...


     Any Ideas??


     Thanks for your reading.