DropDown widget issue for Static Entity

Hi All,

I have 2 entities. Client dynamic entity and Gender is a static entity in Service module.

Gender Contents Male & Female records

and Gender is reference in Client entity.

I wrote REST API for it and it runs fine on POSTMAN.  But during interface creation what do I set as a Variable I don't understand this.






I am creating basic application to store client details. DropDown values should come from Gender static entity.





Hi SP_India ,

You will have to introduce one more Aggregate in the Screen scope called GetGenderTypeByClientId which will be referring the Gender Static Entity as Source Entity and the Aggregate Filter Condition will be Gender.Id = ClientId apart from that the Gender Dropdown widget property value should be as shown below.


Hope this helps you!


Regards,

Benjith Sam

Hi SP_India,

For the purposes of making a dropdown, you can treat a static entity the way you would any other entity.  Add another aggregate to your ClientDetails screen, that fetches the available gender records.  

Use that aggregate as the List property of your dropdown instead of what you are doing now (you now have GetClientById as the source, that won't work.

Then as the Option Text you will probably want your Gender.Label and as the Option Value you will set Gender.Id.  Your Variable should be similar to what you have bound to for example Name input, as that hold the currently chosen value. So that could be maybe GetClientById.List.Current.Client.GenderId or something like that, depends on how you have set up your screen.

Hope this helps,

Dorine

Benjith Sam wrote:

Hi SP_India ,

You will have to introduce one more Aggregate in the Screen scope called GetGenderTypeByClientId which will be referring the Gender Static Entity as Source Entity and the Aggregate Filter Condition will be Gender.Id = ClientId apart from that the Gender Dropdown widget property value should be as shown below.


Hope this helps you!


Regards,

Benjith Sam

 Hi Benjit,

i think yes, but without that filter, right ?  It should have all gender available in dropdown.

 

Dorine Boudry wrote:

Hi Benjit,

i think yes, but without that filter, right ?  It should have all gender available in dropdown. 

Yes Dorine you are correct... Thank you for pointing that :)

Correction: 

Newly introduced Aggregate (called - GetGenderType) won't be having any Filter condition, instead the Gender Dropdown widget Variable should be set to GetClientById.List.Current.Client.GenderId


Regards,

Benjith Sam

Benjith Sam wrote:

Dorine Boudry wrote:

Hi Benjit,

i think yes, but without that filter, right ?  It should have all gender available in dropdown. 

Yes Dorine you are correct... Thank you for pointing that :)

Correction: 

Newly introduced Aggregate (called - GetGenderType) won't be having any Filter condition, instead the Gender Dropdown widget Variable should be set to GetClientById.List.Current.Client.GenderId


Regards,

Benjith Sam

 Hi Benjith,

 

Here Gender is having issue. And In AllGenders aggregare why I see my static entity name as "Gender2". My entity name is just Gender. 




Hi SP_India,

1° is there a reason you want to post over a rest call instead of executing a server call to save the client, is this a test app to test your api, maybe ?

2° the Gender2 is not the fault of the aggregate, apparently you have Gender twice in your datamodel.  Can you show a picture of your data structures ?  maybe Gender comes from the api and gender2 from dependency you added with the model holding gender definition ???

3° can you show the error that is given for the gender in your post call ?


Dorine

Data Structure : 


1] Ans: Yes Normal process I have done it and I recently understand how to with SOAP and REST. Now I want to the simple program with REST and I knew it somewhere I will stuck. 


2] THis is my data structure. I found Gender entity i didn't find anywhere



3]




And just I got "Gender" is my structure name.


Hi SP_India,

Because of the Structure name 'Gender' the referenced Gender static entity is taking the name Gender2. No problem with that....

Could you please let me know, whether the consumed PostSaveClient API action input parameter Gender attribute data type is simple type i.e. GenderId Type or compound record type?


Regards,

Benjith Sam

It shows me Gender2 Indentifier



I have created a structure for Client in my RESTAPI Service then how it create structure for Gender?



Solution

Hi SP_India,

As the ClientPost Structure Gender is a compound type attribute you are encountering the error...

Please Do the below mentioned changes in the ClientPost Structure definition

1) Rename the Gender attribute to GenderId (the static entity will get back the Entity label to Gender)

2) Set the Gender attribute type to GenderId data type

Hope this helps you!

Regards,

Benjith Sam

Solution

Benjith Sam wrote:

Hi SP_India,

As the ClientPost Structure Gender is a compound type attribute you are encountering the error...

Please Do the below mentioned changes in the ClientPost Structure definition

1) Rename the Gender attribute to GenderId (the static entity will get back the Entity label to Gender)

2) Set the Gender attribute type to GenderId data type

Hope this helps you!

Regards,

Benjith Sam

 Yes!!! it is working now... I did silly mistake... 



Thanks


 

You are welcome, SP_India :)

Happy that you got it solved!


Regards,

Benjith Sam