Forums

Forums / Developing Portals / How to configure form to submit contactid in case caller field.

How to configure form to submit contactid in case caller field.

10 posts, 1 answered
  1. Mason Ambery
    Mason Ambery avatar
    67 posts
    Registered:
    19 Nov 2021
    02 Jun 2022
    Link to this post
    I have built both an add or view case form.  I'm able to view an existing case record from CRM and submit it back with changes and everything is fine.  On my Add case form, I receive the following error/edit at the bottom of the form "You should specify a parent contact or account.".  I tried adding the static widget and setting the caller field to be equal to the user's contact id but that didn't resolve the issue.   

    I was able to get a case record added by adding the Caller field to the form but I figured the static value widget would submit this value for me since I always want to set to the contact.  

    Question, how do I get the logged in contact value submitted when attempting to add the record without the Caller field having to be populated?
  2. Eric Mann
    Eric Mann avatar
    59 posts
    Registered:
    16 Oct 2020
    02 Jun 2022 in reply to Mason Ambery
    Link to this post
    Mason,
    Yeah we use Static Value on Case entity/table just the way you are describing to set a custom field/column as 'created by' which is a lookup to Contact entity/table. We have it selected to Use Logged in User Contact Id and Always Submit with the Form. Have you checked if CustomerId field is the issue as it's a required field on Case entity/table and I've seen some issues with required fields when creating record in Dynamics. 

    Eric 
  3. Mason Ambery
    Mason Ambery avatar
    67 posts
    Registered:
    19 Nov 2021
    02 Jun 2022 in reply to Eric Mann
    Link to this post
    Eric,
    Thanks for the reply and based on my testing, it's the Caller field that is the issue.  This is how I have the Static Value widget configured which I assumed was going to resolve the issue.  Although it seems like it is configured correctly, I don't know if the value is actually being passed.  I do know that if I add the actual Caller field to form with the lookup widget and set an actual field value, the add works.  I must not have the widget configured correctly but it seems straight forward.  I'm going to try and set another field value to see if I fan get it working.

    Attribute = Caller***
    Use Logged in User Contact Id = True
    Always Submit with the Form = True

    ***The Attribute label when looking at the content view shows the value customerid.  It's within the edit dialog of the widget where the caller field was selected from the dropdown.
  4. Mason Ambery
    Mason Ambery avatar
    67 posts
    Registered:
    19 Nov 2021
    02 Jun 2022 in reply to Mason Ambery
    Link to this post
    I'm going to go back and read the documentation to see what I'm doing wrong as I tried using the widget with other fields on my case entity and they didn't populate either.  I tried a lookup field where I provide the GUID value and a text field and neither created record populated with the field value which tells me either the widget doesn't work or I'm doing something wrong and I'm going to assume that it is user error.  Do I have to add the field that I want the static value associated with on the form and not display it or something simple that I'm missing?  
  5. Mason Ambery
    Mason Ambery avatar
    67 posts
    Registered:
    19 Nov 2021
    03 Jun 2022
    Link to this post
    I can't figure out how to get this to work.  I have tried it with both the lookup field set to the Caller attribute on the form, both visible and not visible as well as not adding the Caller field.  In either situation, the static value isn't submitted with the insert.  The only way I can get the record added is by selecting the Caller field value before submitting the form.
  6. Eric Mann
    Eric Mann avatar
    59 posts
    Registered:
    16 Oct 2020
    03 Jun 2022 in reply to Mason Ambery
    Link to this post
    Mason,
    Have you enabled and checked Audit History on the entity/table and reviewed for records created? i noticed on Static Value that occurs as an Update even on Create form as a second step/process after Create. If your Caller field is Required by D365 then that could be the hang up. A workaround would be set it as a default then the Static Value would update to correct value. 
  7. Mason Ambery
    Mason Ambery avatar
    67 posts
    Registered:
    19 Nov 2021
    03 Jun 2022 in reply to Eric Mann
    Link to this post
    I'll try setting a default value to see if it get's overwritten but if that is the case, this is going to create an issue because I have workflows that trigger in CRM based on the creation of a case as well as the updating.  I know that the record is not being created when the edit is returned.  

    Do you know if there is another way to set the Caller field to the logged in contact on submit of an add?  This portal solution is closed to the public and will only be accessible by Contacts that exist in our CRM environment. 
  8. Eric Mann
    Eric Mann avatar
    59 posts
    Registered:
    16 Oct 2020
    03 Jun 2022 in reply to Mason Ambery
    Link to this post
    Mason,
    You can use Lookup field and use FetchXML along with hidden and Filters to accomplish. It's a workaround and I'd still investigate Static Value but may get you up and running. 
  9. Mason Ambery
    Mason Ambery avatar
    67 posts
    Registered:
    19 Nov 2021
    03 Jun 2022
    Link to this post
    I enabled logging and confirmed that nothing is being passed when the insert is being fired which tells me either the widget isn't working or the configuration or implementation of the widget(s) on the form is incorrect.  

    "Key":"customerid","Value":null}
  10. Vladyslav Makar
    Vladyslav Makar avatar
    20 posts
    Registered:
    16 Dec 2020
    Answered
    16 Jun 2022 in reply to Mason Ambery
    Link to this post
    Good day Mason,

    I hope your day is going well!

    Kindly, let me know if you still facing an issue and need help with it.

    Best regards,

    Vlad
10 posts, 1 answered