2 Replies Latest reply on Nov 16, 2009 4:28 PM by leesan

    Validation issue..

    leesan

      Title

      Validation issue..

      Post

      Good day!

      I've got a question here.

       

      I have 3 table; Job(job_id, product_name), Costing(cost_id, job_id, cost_amount, status), Quotation(quotation_id, job_id, quoted_amount) and these  

      tables are linked using job_id field.

       

      A job needs to be recorded first. Then costing will be made for this job. To create a quotation, costing must be completed first.

       

      I need help on how what command to use or how to solve this problem so that I can create a quotation from Costing layout. 

       

      To create a quotation:

          1. Check if a quotation for a job is already created.

          2. If already created, promp a message "Quotation already created!"

          3. If not created yet;

                  3.1 If Costing status != "Complete", prompt message "Cannot create Quotation. Costing is not completed."

                  3.2 If Costing status = "Complete", create a quotation for specified Job and Go to Quotation layout.

       

      Please help..:manhappy: 

       

        • 1. Re: Validation issue..
          mrvodka
            

          Try something like:

           

           

          If [ not IsEmpty ( Quotation::quotation_id ) ]

            Show Custom Dialog [ "Quotation already created!" ]

          Else If [ Costing::status <> "Complete" ]

            Show Custom Dialog [ "Cannot create Quotation. Costing is not completed." ] 

          Else

            Set Variable [ $jobID; Costing::job_id ]

            Go to Layout [ "Quotation" ]

            New Record

            Set Field [  Quotation::job_id; $jobID ]

          End If

           

           

          BTW this assumes that you have your relationships setup properly.

           

          • 2. Re: Validation issue..
            leesan
              

            Thanks a lot to you Mr. Vodka.

            That solved my problem.

            Yuhuuuu....  :smileyvery-happy: