Define automatically the folder id in an input form

salvdangelo

07-09-2020

Hello all,
I've added a link to "Folder" within my custom schema "Theme":

salvdangelo_0-1599499779626.png

At the same time I have an input form for the creation / editing of records of "Theme" schema and I would like to set the folder id automatically (as done in native "Recipient" and "Service" forms).

 
 
 

form.PNG

As per my tests, I receive the error shown above: "The folder is not specified".
Could you tell me what I'm missing?

Thank you,
Salvatore
@Milan_Vucetic 
@wodnicki 

@Jean-Serge_Biro 

@Raj_bounteous 

@Jyoti_Y 

folder folder-id id Input Form

Accepted Solutions (0)

Answers (6)

Answers (6)

kapilKochar

MVP

24-09-2020

Hi Salvdangelo,

 

Just to replicate the issue I have created custom schema for Theme and also one form and navigation hierarchy for this custom schema. 

 

Schema Definition:

kapilKochar_0-1601008969309.png

 

Form : 

 

kapilKochar_1-1601008998689.png

 

Navigation Hierarchy :

kapilKochar_2-1601009030337.png

 

Folder created by using above navigation  hierarchy  and also after creating folder  ,click on advance properties and check for template name for me it's 'kkktheme'. This name have to be same in your schema and form screenshot shared above. 

 

kapilKochar_3-1601009084730.png

 

Using form to enter values , result is below. You can see Folder ID is coming automatically and no error for related to folder. 

 

kapilKochar_4-1601009189027.png

 

 

Point to check 

1. Make sure you have set default value at schema level and use correct name as the name coming after creating  folder using navigation hierarchy 

2. In Form use correct model name (case sensitive)

3. In navigation hierarchy use correct schema name 

 

Thanks,

Kapil Kochar

salvdangelo

25-09-2020

Hi @kapilKochar ,

I REPLICATED the same schema, navigation item and input form (except for the namespace that is "cus") and I confirm you what I said in the previous message:

Folders created using the same navigation item:
salvdangelo_0-1601023752680.png

salvdangelo_1-1601023827406.png

 

I've created "Customer 1" within Folder 1
and "Customer 2" using Folder 2
... but the folder-id is the same!

salvdangelo_0-1601024264470.png

 

In addition, I should NOT be able to see Customer 1 in the view of Folder 2 (since the folder is not a view)


I hope that now it's clear what is wrong in the solution proposed so far.
Please let me know! thank you in advance

Cheers,
Salvatore

salvdangelo

25-09-2020

Hello @kapilKochar ,

I made these checks again on the schema / navigation item / input form
and I confirm you that all the references are correct.

Could you create another folder (folder 2) with the same navigation item and see if the Folder id assigned to your records is different compared to records created within the first folder (folder 1) you created?
My issue is that: folder id is assigned correctly when I create the first folder, but when I create another folder with the same model records created here have folder-id of the first folder!
Furthermore, in the navigation view I should only see records belonging to the current folder (note: isView = false), not all of them


Please, let me know.
I'll try to create them again in the meanwhile.


Thanks,
Salvatore



salvdangelo

24-09-2020

Is there anyone here that can help me? @Sukrity_Wadhwa 

Sukrity_Wadhwa

Employee

21-09-2020

Hi @salvdangelo,

Were you able to resolve this query with the given solution? Do let us know.

Thanks!

Jyoti_Y

MVP

15-09-2020

Hi,

 

If you look at folder definition in 'Recipient' or 'Service' schema, Default Folder definition is always specified, i.e if user is not specifying where record will be saved, there is always a default Folder location.

 

You need to specify default folder location in your 'Theme' Schema and it will work correctly.

Jyoti_Y_1-1600238289349.png

 

 

Jyoti_Y_0-1600238255036.png

 

How do you assign recipients to specific Folder: By explicitly specifying Folder internal name or primary key. And in case if nothing is specified, then it will be saved to 'Default Folder'.

 

Similar logic you need to implement.

 

Thanks.

Hello @Jyoti_Y,

Could you please clarify this:
"How do you assign recipients to specific Folder: By explicitly specifying Folder internal name or primary key"

How can I specify the primary key or the internal name of the CURRENT folder within the input form?

Thanks,
Salvatore

Hi,

We specify folder internal name in workflow design i.e in update activity. It is not defined in 'Input Form'.

You can assign folder by two ways:

1) Specify Default folder either in Schema or in Form or

2) Create one input parameter in Form to specify Folder Id.

 

Thanks.

Hello @Jyoti_Y,

 

I have defined the default folder in the schema.
This is the current status:
"Tema 3" was created by Folder 1
"Tema 4" was created by Folder 2, but folder-id indicated is the one of Folder 1 (error)
Even if the folders ARE NOT views, I can see all the records no matter which is the folder id (error)

salvdangelo_0-1600240347871.png

 


How can I specify CURRENT folder id in an input field?
And solve the second issue?

Thanks,
Salvatore

Hi Salvatore,

Can you share your Theme table definition once again.

Also, what to do you mean by created by Folder1 and Folder2. Which method you have used to create record.

 

Thanks.

Hello @Jyoti_Y,

 

Here below my "Theme" schema :

salvdangelo_0-1600243290765.png

Folder1 and Folder2 were created thanks to the same custom navigation hierarchy item based on the schema above.
The navigation item has a list view (top) and an input form (bottom)
"Theme" records are created only through the custom input form 

Hi,

 

Your Default Folder is specified wrong.

Jyoti_Y_0-1600254018667.png

 

It should be 'cusGlobalThemeViewPOC' ( G capital).

 

Also, in your input form, give: 

<sysFilter>
<condition expr="@isView=0 and @model='cusGlobalThemeViewPOC'"/>
</sysFilter>

 

Try to perform operation after that.

Hi @Jyoti_Y,

 

I made what you have suggested (capital letter instead of lower one) but still not working.
This cannot be the problem since the name of the template/model used by the folder is specified in the navigation hierarchy and it was consistent with schema/form:

Navigation item:

salvdangelo_0-1600258988090.png


Salvatore