Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Define automatically the folder id in an input form

salvdangelo
Level 5
Level 5

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 
@Jonathon_wodnicki 

@Jean-Serge_Biro 

@Raj_bounteous 

@Jyoti_Yadav 

1 Accepted Solution
kapilKochar
Correct answer by
Community Advisor
Community Advisor

Hi Salvatore,

 

I understand what you saying now. I replied based on initial question where you were getting error from that <check> tag under form . I checked the nms:core Navigation hierarchies and over there you can see for nodeModel of recipient,groups and Reports they have used <command> to call another form and there they have might set the folderId Not sure exactly how it is working. But something you can look into .  

 

kapilKochar_0-1601108125462.png

 

View solution in original post

0 Replies
salvdangelo
Level 5
Level 5
Hello, is there anyone that can give me an answer to my question?
Jyoti_Yadav
Community Advisor
Community Advisor

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.

salvdangelo
Level 5
Level 5

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

Jyoti_Yadav
Community Advisor
Community Advisor

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.

salvdangelo
Level 5
Level 5

Hello @Jyoti_Yadav,

 

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

Jyoti_Yadav
Community Advisor
Community Advisor

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.

salvdangelo
Level 5
Level 5

Hello @Jyoti_Yadav,

 

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 

Jyoti_Yadav
Community Advisor
Community Advisor

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.

salvdangelo
Level 5
Level 5

Hi @Jyoti_Yadav,

 

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

Sukrity_Wadhwa
Employee
Employee

Hi @salvdangelo,

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

Thanks!

Sukrity_Wadhwa
Employee
Employee
Hi, I have escalated it to our SMEs. They will get back on this thread. Thanks!
kapilKochar
Community Advisor
Community Advisor

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
Level 5
Level 5

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
Level 5
Level 5

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

kapilKochar
Correct answer by
Community Advisor
Community Advisor

Hi Salvatore,

 

I understand what you saying now. I replied based on initial question where you were getting error from that <check> tag under form . I checked the nms:core Navigation hierarchies and over there you can see for nodeModel of recipient,groups and Reports they have used <command> to call another form and there they have might set the folderId Not sure exactly how it is working. But something you can look into .  

 

kapilKochar_0-1601108125462.png

 

Praveen_p1
Level 2
Level 2

Hi Salvatore,

To restrict the records to the created/allocated folder use 'folderLink="folder"' when defining the nodeModel.

something like below

<nodeModel folderLink="folder" img="nl:home.png" label="GenericFields" name="GenericFields">

Also, Please let me know if you were able to solve the issue of defining the folderId automatically.

Thanks,

Praveen.