1 2 Previous Next 15 Replies Latest reply on Oct 6, 2016 11:34 AM by laguna92651

    Multi level record creation

    laguna92651

      Any suggestions how I might implement.

      1. I currently create a new record in sales Opportunity list view, selecting an already existing account with a drop down of all existing accounts..
      2. The Opportunity can have multiple contacts, which can be seen in the Opportunity form view in the contacts portal. a check mark is placed next to the primary contact for the Opportunity, the primary contact is what will automatically be displayed under contacts in the Opportunity list view, when a new Opportunity is created.
      3. The contacts shown in the Opportunity form view are a subset of the contacts in the account table.
      4. The Contacts in the account contact portal are are a subset from a list of contacts.

       

      This all work all works well. However, I would like to be able, when needed, to create a new account and new contact as needed when I create a new opportunity, rather than going back to each form individually. Is this a reasonable thing to do? If so, how should I go about it?

       

      1. Opportunity List View (Opportunity table)

      Opp1.png

      2. Opportunity Form View - Contacts Portal (Opportunity table)

      Opp2.png

      3. Account Form View (Account table)

      Opp3.png

      4. Contact List View (Contacts table)

      Opp4.png

        • 1. Re: Multi level record creation
          Johan Hedman

          Create the new record in a portal in Global fields and the have a button "Create new contact" and use a script to create record in both Account and Contact

          • 2. Re: Multi level record creation
            laguna92651

            Could you explain a little more what you mean by:

             

            "Create the new record in a portal in Global fields"

             

            Where would the portal be?

            • 3. Re: Multi level record creation
              mw777rcc

              Hey, I am a Senior engineer with Richard Carlton Constulting and since your solution is based on our FMStartingPoint, this should be pretty straight forward.   You already have a button that will take you to the layout and create a new record and relate it to the Opportunity (looks like you are using estimates or invoices to be opportunities(right?))

               

              Several options:

              1. Edit that script so that it pops a new window so that you simply close it when you are done and you are back at your original context.

              2. Edit that script and make a new/duplicate layout that is cut down to be just the info you need to create that new contact/account.

              3. Creat a process where you could even use a popover with global fields with all of the info you need to create a new contact/account.  Then after the user fills out all of the required fields the can submit it and your script will move the data from global fields into a new record in the appropriate table make sure to go ahead and relate it to this opportunity.

               

              Hope this helps.  Feel free to reach out to me through here or on my contact info if you have more questions.

              • 4. Re: Multi level record creation
                laguna92651

                Thanks, the Opportunity table and layout is a duplicate of the Accounts table and layout.

                When you say, "You already have a button that will take you to the layout and create a new record and relate it to the Opportunity", what layout are you referring to?

                 

                I think I understand your suggestions, as I start to get together the various possible combinations of new records to create, depending on the situation (account exits/contact is new or account is new /contact exits or both are new), it hit me that I should check to see if the account and/or contact already exists, before I create a new record for either. Any suggestions on how I should go about checking for duplicates?

                • 5. Re: Multi level record creation
                  mw777rcc

                  Set up comparison relationships between the globals and your records with things like phone number and last name, address and last name, etc.  If you see anything across the relationships then show a list and ask if any of those existing records match what they are trying to create and give them the option to choose them.

                  • 6. Re: Multi level record creation
                    laguna92651

                    I have the sequence of record creations working fine, thanks.

                     

                    When I complete the script to create the Opportunity record, what is the best way to land on the new record when I return to the original layout? Currently I am doing a find on the new id_opportunity, then a Show All, which keeps the new record selected. However I then lose the date range that was set up before the new record creation.

                    • 7. Re: Multi level record creation
                      mw777rcc

                      If you want to include your record in a previous foundset then do whatever find you need then do the find for the id and instead of "perform find", use "extend find"

                      • 8. Re: Multi level record creation
                        laguna92651

                        I wasn't aware of the Extend Find. But I still have the original problem, when I go back to the original layout I still don't have focus on the just created record. The focus is on the first record in the found set. The layout is a sub-summary if that makes a difference.

                        • 9. Re: Multi level record creation
                          mw777rcc

                          If you do not create the record in your main window then you will have to do a find to get it into that window.  If your find does not center you on that window then simply freeze the window, start at the first record of your find, and cycle through until you land on the right record then exit.  Of course this will only be good if your foundset is limited (say under 100) or there will be a delay.  If there is no sort on the records in the found set then start and the end and work backwards because your most recently created record is likely your last record.

                          • 10. Re: Multi level record creation
                            laguna92651

                            That did the trick.

                            I used the approach of placing globals on a popover, then creating the necessary records. Before I run the script to create the records, I run a script trigger OnObjectExit on the Account global field (on the popover) to check whether the account has contacts associated with it. If there are no contacts, then a new contact can be created, otherwise select from existing contacts. That all seems to work fine, except for the fact the popover has a very noticeable flicker when the script finishes and goes back to the popover with a Go To Object (PopCreate). I do a Freeze Window for the layout in the script, I need to do something like a Freeze Popover? Thanks for the help.

                            • 11. Re: Multi level record creation
                              laguna92651

                              Any thoughts  on how I might get rid of the popover "flicker?" It isn't really a flicker, since I'm going back to the layout and having to reopen the popover.

                              • 12. Re: Multi level record creation
                                mw777rcc

                                Do yo have to leave the layout?  If you open a new window off screen then you should be able to accomplish everything on it and then come back to the existing layout with the popover still open.  I just tested it and opening a new window does not close the popover in the existing window.

                                • 13. Re: Multi level record creation
                                  laguna92651

                                  Here is the script, it just checks to see if records exist for a given account, then comes back to popover. Where should I try the new window?

                                   

                                       Freeze Window

                                       Set Error Capture[On]

                                       Go to Layout[“L10005 Create 2561 New Contact” (T31a1_opportunity_CONTACTS||id_accounts|)]

                                       Enter Find Mode[  ]

                                       Set Field[T31a1_opportunity_CONTACTS||id_accounts|::id_account; T31_OPPORTUNITIES::g_new_account_id]

                                       Perform Find[  ]

                                   

                                       If[Get ( LastError ) > 0]

                                            Show Custom Dialog[Message:" No contacts found, enter a new contact last name."; Default Button:“OK”,

                                            Commit:“Yes”; Button 2:“Cancel”, Commit:“No”]

                                            Go to Layout[original layout]

                                            Set Field[T31_OPPORTUNITIES::g_new_contact_select_name_last; 1]

                                            Set Field[T31_OPPORTUNITIES::g_new_contact_id; ""]

                                            Set Field[T31_OPPORTUNITIES::g_new_contact_name_last; ""]

                                            Set Layout Object Animation[Off]

                                            Go to Object[Object Name:"PopCreate"]

                                            Exit Script[Result:1 // true]

                                       Else

                                            Go to Layout[original layout]

                                            Set Field[T31_OPPORTUNITIES::g_new_contact_select_name_last; ""]

                                            Go to Object[Object Name:"PopCreate"]

                                       End If

                                  • 14. Re: Multi level record creation
                                    mw777rcc

                                    I think the following edits will work for you.

                                     

                                         Freeze Window

                                         Set Error Capture[On]

                                         ***New Window***

                                         Go to Layout[“L10005 Create 2561 New Contact” (T31a1_opportunity_CONTACTS||id_accounts|)]

                                         Enter Find Mode[  ]

                                         Set Field[T31a1_opportunity_CONTACTS||id_accounts|::id_account; T31_OPPORTUNITIES::g_new_account_id]

                                         Perform Find[  ]

                                     

                                         If[Get ( LastError ) > 0]

                                              Show Custom Dialog[Message:" No contacts found, enter a new contact last name."; Default Button:“OK”,

                                              Commit:“Yes”; Button 2:“Cancel”, Commit:“No”]

                                    ** I think you need an exit here if they cancel, don't you **

                                              Go to Layout[original layout]

                                             ** Close Window **

                                              Set Field[T31_OPPORTUNITIES::g_new_contact_select_name_last; 1]

                                              Set Field[T31_OPPORTUNITIES::g_new_contact_id; ""]

                                              Set Field[T31_OPPORTUNITIES::g_new_contact_name_last; ""]

                                              Set Layout Object Animation[Off]

                                              Go to Object[Object Name:"PopCreate"]

                                              Exit Script[Result:1 // true]

                                         Else

                                              Go to Layout[original layout]

                                              ** Close Window **

                                              Set Field[T31_OPPORTUNITIES::g_new_contact_select_name_last; ""]

                                              Go to Object[Object Name:"PopCreate"]

                                         End If

                                    1 2 Previous Next