SBX - Search With Button

SBX - Forum Post Title

Dynamics Portal set value on button click

Microsoft Dynamics CRM Forum

Hino asked a question on 29 Nov 2018 3:24 AM

Question Status

Suggested Answer

Hi Experts

In Dynamics Portal , I have an Entity list which shows the lead record whose X field (custom lookup field to contact) doesn't contain any data.

I want to set the current logged in portal user to the X field on click of a button for the selected record.

Please suggest how to achieve this functionality

Thanks

Hino

Reply
Oliver Rodrigues responded on 29 Nov 2018 9:02 AM
My Badges
Suggested Answer

what you mean by click of a button ?

I am assuming you have an Entity Form tied to your entity list, and when you click the item in your list it opens that entity form, right ?

you can add an entity form metadata to set the value for the current user on your field.. this would be on the save of the record

community.adxstudio.com/.../entity-form-metadata

search for "Set value on save"

Reply
Hino responded on 3 Dec 2018 6:16 AM

Thanks for your reply Oliver and sorry for the late response.

Yes !. For now i added details button and on click of it, my Entity form opens for the corresponding record and the X field's value is auto populated with the 'current portal user' using Entity Form Metadata. That is working.

But i want to call JavaScript on click of button or workflow action ( that gets the current portal user as parameter) and set the portal user in background ( without the need for portal user clicking submit manually )

Reply
Oliver Rodrigues responded on 3 Dec 2018 8:25 AM
My Badges
Suggested Answer

ok I see.. in this case you need to trigger a CRM background process (plugin whatever) through JS

the below post suggest a doable way of doing this.. basically you should create a custom entity and add plugins on the RetrieveMultiple message

you would force a retrieve operation through javascript + web template passing a CRM action and its parameters

this would trigger your action in the background

I haven't tested, but the logic makes sense to me, it should work

uds.systems/.../how-to-run-custom-code-in-dynamics-365-portal

Reply
Oliver Rodrigues responded on 4 Jan 2019 10:16 AM
My Badges
Suggested Answer

hi.. did any of the replies answered your question? if yes, can you please mark as verified?

thank you

Reply
Hino responded on 7 Jan 2019 12:30 AM

Thank you for the answer Oliver. Yes the logic makes sense, but we didn't try it.

Reply
Oliver Rodrigues responded on 29 Nov 2018 9:02 AM
My Badges
Suggested Answer

what you mean by click of a button ?

I am assuming you have an Entity Form tied to your entity list, and when you click the item in your list it opens that entity form, right ?

you can add an entity form metadata to set the value for the current user on your field.. this would be on the save of the record

community.adxstudio.com/.../entity-form-metadata

search for "Set value on save"

Reply
Oliver Rodrigues responded on 3 Dec 2018 8:25 AM
My Badges
Suggested Answer

ok I see.. in this case you need to trigger a CRM background process (plugin whatever) through JS

the below post suggest a doable way of doing this.. basically you should create a custom entity and add plugins on the RetrieveMultiple message

you would force a retrieve operation through javascript + web template passing a CRM action and its parameters

this would trigger your action in the background

I haven't tested, but the logic makes sense to me, it should work

uds.systems/.../how-to-run-custom-code-in-dynamics-365-portal

Reply
Oliver Rodrigues responded on 4 Jan 2019 10:16 AM
My Badges
Suggested Answer

hi.. did any of the replies answered your question? if yes, can you please mark as verified?

thank you

Reply

SBX - Two Col Forum

SBX - Migrated JS