AnsweredAssumed Answered

I basket case...

Question asked by Cécile on Sep 6, 2017
Latest reply on Sep 7, 2017 by BruceRobertson

Pun intended.

 

I am trying to create a parent record in a related table

 

Tables            Cases            Basket

Keys           ƒid_basket      ID_Basket

 

When we deal with a series of complaints (cases) about the same event, we group them in a basket. So One to Many. One case never belongs to more than one basket. Not every case require the creation of a basket.

 

In the process of filling the form for a case, I want to be able to click on the buttonized edit field "basket ID" placed on the Layout "Cases" from the Cases table. Here is the script for that button.

 

Set Error Capture [ On ]

Go to Related Record [ From table: “Basket”; Using layout: “Basket” (Basket) ] [ Show only related records ]

If [ Get ( LastError ) = 101 ]

Show Custom Dialog [ Title: "Basket does not exist"; Message: "There is currently no basket related to this case. Would you like to create one?"; Default Button: “No”, Commit: “Yes”; Button 2: “Yes”, Commit: “No” ]

 

If [ Get ( LastMessageChoice ) = 1 ]

Exit Script [ ]

Else

Set Field [ Basket::NameBasket; Cases::CaseTitle ]

Go to Related Record [ From table: “Basket”; Using layout: “Basket” (Basket) ] [ Show only related records ]

End If

End If

 

Well, nothing happens when I click Yes to create the record. I am at lost at what is wrong here. And I still have to figure the part to add a case to the basket if this one already exist.

Outcomes