Was this page helpful?

Custom Forms

    Web servies

    todo

     

    Use cases

    There are 3 basic use cases (and 1 deprecated), how does the bussiness object hold the reference to the data in custom form structure. There is a reason behind the diffenrence and it is important to understand them.

    A) formvalues id is stored in the object

    The main and basic use case is storing the ID of formvalues in the bussiness object, so when some client needs to show form values of the object, it just reads the formvalue id from the object and then call API method ListItemValue forminfo = formvalueid. The field in the object has usually DB constraint to formvalues table. This solution is best when it is essential feature of the object. Typically the formvalues are created and set into the object immidiatelly after its creation. 

    This way is used in folder, project, activtiy - they all have formvaluesid field, so when you get folder detail, you can ask for form item values by this id. 

    This is the only way, which is also supported in reporting, also the only way how to get these information into timeline.

    B) remoteid is used to the object

    Another way how to bind form data to an object is to save the ID of the object into remoteid field in formvalues. This allows us storing the reference to the form without actual need for the object moidfication. Sometimes we do not want to modify the structure of the object (it is not worth it) or we can not (pairing form values with external objects, which we can not modify). In such a case, we just set the ID of the object into field remoteid. When doing this, it is also mandatory to fill field remote_id_type, so later on we know, what kind of object does the formvalues belong to (tasks for example have com.atollon.task, if I want to pair the form with some external subject - like linkedin profile, structure in external system - we use linkedin.profile etc.).

    C) combination of context and formid

    This is very specific usage and it is used very rarely. The problem which this addresses is, that sometimes you need more customforms on one context. In such a scenario, as unique reference for form values you can use combination of context and formid. See example bellow:

    The client needed to save dynamical custom form on the applicant. The form was his accomodation history and for each accomodation they needed to save few basic data. So for this scenario we implemented the custom app, where you configure formID. 

    So the client creates new form by calling CreateCustomForm with formID and context, and then fills this values with new id from form values. So when displaying the existing forms, client list all formvalues by context + formID and then for each form value render the form as usual (so the form then ask formitemvalues by formvalue id as forminfo).

    D) forminfo directly contains the id of the object !DEPRECATED!

    We used to have 2 types of forms on folder/project/activity. One by template (case A) and one by type. That means that into formitemvalues we used to save directly ID of folder/project/activity. That means that those formitemvalues did not even have a formvalue. We dislike it and it is no longer supported. Theoretically, if we would like to have something like this nowdays, it would be better to use case B. But so far we do not need it and I do not see any usage in the near future. 

    Formvalues vs form

    This paragraph with focus on why dataset for form (formvalues) is not same as form. todo

     

    Atollon provides Forms functionality that allows Atollon administrators add new custom fields to existing Contact Folders, Simple Folders, Projects or Activities and Milestones.

    Custom Forms Features

    Custom Form Fields

    Edit Field

    You can add new Edit Field into Form to add simple text, date field, inteager or numeric field into Custom Form. Set it in Edit Fields variables: Constraint.

    Checkbox

    This field is used to set Yes/No data.

    Memo Field

    It is possible to add multi-line plain-text notes to Custom Form.

    Listbox

    This it the only multi-select component for fixed values. You can switch whether the Listbox is multi-select or simple-select.

    Combo

    Simple option selector for fixed values.

    How to Create New Custom Form?

    How to Assign Custom Form to Contact Type?

    You can assign the Custom Form to Contact Type eithery by assigning it to Contact Folder Type or Contact Folder Template.

    How to Assign Custom Form to Project?

    You can assign the Custom Form to Project either by assigning it to Project Type or Project Template. Both Forms may be used at the same time.

    How to Copy Custom Form?

    1. You must create blank destination form (for create ACL)

    2. Go to psql for get ID of used forms

    select id,form_name from forms;

    3. move copyFormIntoFormSql.sh into /tmp (Available down at Attachments)

    4. Start backup-db (what if)

    5. Edit copyFormIntoFormSql for name of target DB

    6. Start Form copy as a asp user

    sh copyFormIntoFormSql.sh soucre_form_id destination_form_id
    

    Troubleshooting

    Some records ain't displaying in report results

    It may happen due data inconsistency when someone change form on folder.

    How do I know?

    This returns non-zero result

    select formvalues.id, formitems.formid, formvalues.form from formitemvalues left join formitems on formitemvalues.formitem = formitems.id left join formvalues on formitemvalues.forminfo = formvalues.id where formitems.formid != formvalues.form group by formvalues.id, formitems.formid, formvalues.form;
    

    How do I fix?

    With this hopefully

    update formvalues set form = smt.formid from (select formvalues.id, formitems.formid, formvalues.form from formitemvalues left join formitems on formitemvalues.formitem = formitems.id left join formvalues on formitemvalues.forminfo = formvalues.id where formitems.formid != formvalues.form group by formvalues.id, formitems.formid, formvalues.form) as smt where formvalues.id = smt.id;
    
    Was this page helpful?
    Tag page (Edit tags)
    Pages that link here
    Page statistics
    2751 view(s), 7 edit(s), and 6383 character(s)

    Comments

    You must login to post a comment.

    Attach file

    Attachments

    FileSizeDateAttached by 
    copyFormIntoFormSql.sh
    Includes select init_session();
    1160 bytes16:41, 11 Jun 2014jansafkaActions