Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Unable to assign value to lookup field.

(0) ShareShare
ReportReport
Posted on by 1,040

Hi ,

I have  designed plugin to create  Bookable Resource Booking record on create of an appointment .I have designed and tested this plugin in dev environment.It is working in my dev environment but when I deployed this solution in my UAT environment, it  is not working. I didn't get any error, plugin is creating "Bookable Resource Booking" record but not assigning lookup value on it. I have used following code.

 EntityReference appointmentLookUp = new EntityReference("appointment", appointmentGuid);
 bookableResourceBookingEntity.Attributes.Add("new_appointment", appointmentLookUp);
 return service.Create(bookableResourceBookingEntity);

I have raised support ticket for this issue but didn't receive any update yet. Has anyone encountered this bug?

I need resolution for this issue.

  

*This post is locked for comments

  • Prashant_ Profile Picture
    Prashant_ 1,040 on at
    RE: Unable to assign value to lookup field.

    Thank you for reply,

    My Dev and  UAT environment have same solution so there is no issue related to  logical name of field.I had debug this plugin every time results was same but values assignment was correct. I didn't receive any proper resolution from support either regarding this issue but I have manage to  find its cause.This issue  related to unified resource scheduling.To enable any entity for  URS there is need to configuration. I had tried multiple things but it was useless so I deleted that URS configuration for appointment   entity and My plugin is working fine now but this work around created another problem to me on schedule board.I hope those who encounter same error in field service might this help them to  narrow down issue however I am still working on this issue with support to get resolution  on  this bug.  

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Unable to assign value to lookup field.

    Hi Prashant,

    Ensure that the GUID value for your parameter appointmentGuid exists in your UAT environment.

    Hope this helps.

  • Suggested answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,615 on at
    RE: Unable to assign value to lookup field.

    You can add more line by line plugin trace to see any abnormal behavior.

    Check in audit if any other plugin is removing this value later.

  • Clem Profile Picture
    Clem 2,541 on at
    RE: Unable to assign value to lookup field.

    Hi,

    Do you have any errors ?

    Did you make sure that all your fields / relationship are in place in the UAT environement compare to the dev one ?

    Do you have the same prefix between dev and uat env ?

    Clément

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,375 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans